#include <aligner.h>
Inheritance diagram for EMAN::RotateFlipAligner:
Public Member Functions | |
virtual EMData * | align (EMData *this_img, EMData *to_img, const string &cmp_name="dot", const Dict &cmp_params=Dict()) const |
To align 'this_img' with another image passed in through its parameters. | |
virtual EMData * | align (EMData *this_img, EMData *to_img) const |
virtual string | get_name () const |
Get the Aligner's name. | |
virtual string | get_desc () const |
virtual TypeDict | get_param_types () const |
Static Public Member Functions | |
static Aligner * | NEW () |
static TypeDict | static_get_param_types () |
Static Public Attributes | |
static const string | NAME = "rotate_flip" |
imask | ||
rfp_mode | Either 0,1 or 2. A temporary flag for testing the rotational foot print |
Definition at line 720 of file aligner.h.
virtual EMData* EMAN::RotateFlipAligner::align | ( | EMData * | this_img, | |
EMData * | to_img | |||
) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 725 of file aligner.h.
References align().
00726 { 00727 return align(this_img, to_img, "dot", Dict()); 00728 }
EMData * RotateFlipAligner::align | ( | EMData * | this_img, | |
EMData * | to_img, | |||
const string & | cmp_name = "dot" , |
|||
const Dict & | cmp_params = Dict() | |||
) | const [virtual] |
To align 'this_img' with another image passed in through its parameters.
The alignment uses a user-given comparison method to compare the two images. If none is given, a default one is used.
this_img | The image to be compared. | |
to_img | 'this_img" is aligned with 'to_img'. | |
cmp_name | The comparison method to compare the two images. | |
cmp_params | The parameter dictionary for comparison method. |
Implements EMAN::Aligner.
Definition at line 1016 of file aligner.cpp.
References EMAN::EMData::align(), EMAN::EMData::cmp(), cmp1(), cmp2(), EMAN::EMData::get_attr(), EMAN::Aligner::params, EMAN::EMData::process(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), and t.
Referenced by align().
01018 { 01019 Dict rot_params("rfp_mode",params.set_default("rfp_mode",2)); 01020 EMData *r1 = this_img->align("rotational", to, rot_params,cmp_name, cmp_params); 01021 01022 01023 EMData* flipped =to->process("xform.flip", Dict("axis", "x")); 01024 EMData *r2 = this_img->align("rotational", flipped,rot_params, cmp_name, cmp_params); 01025 Transform* t = r2->get_attr("xform.align2d"); 01026 t->set_mirror(true); 01027 r2->set_attr("xform.align2d",t); 01028 delete t; 01029 01030 float cmp1 = r1->cmp(cmp_name, to, cmp_params); 01031 float cmp2 = r2->cmp(cmp_name, flipped, cmp_params); 01032 01033 delete flipped; flipped = 0; 01034 01035 EMData *result = 0; 01036 01037 if (cmp1 < cmp2) { 01038 if( r2 ) 01039 { 01040 delete r2; 01041 r2 = 0; 01042 } 01043 result = r1; 01044 } 01045 else { 01046 if( r1 ) 01047 { 01048 delete r1; 01049 r1 = 0; 01050 } 01051 result = r2; 01052 result->process_inplace("xform.flip",Dict("axis","x")); 01053 } 01054 01055 return result; 01056 }
virtual string EMAN::RotateFlipAligner::get_desc | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 734 of file aligner.h.
00735 { 00736 return "Performs two rotational alignments, one using the original image and one using the hand-flipped image. Decides which alignment is better using a comparitor and returns it"; 00737 }
virtual string EMAN::RotateFlipAligner::get_name | ( | ) | const [inline, virtual] |
virtual TypeDict EMAN::RotateFlipAligner::get_param_types | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 744 of file aligner.h.
References static_get_param_types().
00745 { 00746 return static_get_param_types(); 00747 }
static Aligner* EMAN::RotateFlipAligner::NEW | ( | ) | [inline, static] |
static TypeDict EMAN::RotateFlipAligner::static_get_param_types | ( | ) | [inline, static] |
Definition at line 749 of file aligner.h.
References EMAN::EMObject::INT, and EMAN::TypeDict::put().
Referenced by get_param_types().
00749 { 00750 TypeDict d; 00751 00752 d.put("imask", EMObject::INT); 00753 d.put("rfp_mode", EMObject::INT,"Either 0,1 or 2. A temporary flag for testing the rotational foot print"); 00754 return d; 00755 }
const string RotateFlipAligner::NAME = "rotate_flip" [static] |