#include <aligner.h>
Inheritance diagram for EMAN::RotateTranslateFlipAlignerIterative:
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 | |
Aligner * | NEW () |
TypeDict | static_get_param_types () |
Static Public Attributes | |
const string | NAME = "rotate_translate_flip_iterative" |
flip | ||
r1 | inner ring | |
r2 | outer ring | |
maxiter | maximum number of alignment iterations | |
maxshift | Maximum translation in pixels |
Definition at line 925 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 930 of file aligner.h. References align(). 00931 { 00932 return align(this_img, to_img, "sqeuclidean", Dict()); 00933 }
|
|
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.
Implements EMAN::Aligner. Definition at line 862 of file aligner.cpp. References EMAN::EMData::align(), EMAN::EMData::cmp(), EMAN::EMData::get_attr(), EMAN::EMData::process(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), EMAN::Transform::set_mirror(), and t. 00864 { 00865 // Get the non flipped rotational, tranlsationally aligned image 00866 Dict rt_params("maxshift", params["maxshift"],"r1",params.set_default("r1",-1),"r2",params.set_default("r2",-1)); 00867 EMData *rot_trans_align = this_img->align("rotate_translate_iterative",to,rt_params,cmp_name, cmp_params); 00868 00869 // Do the same alignment, but using the flipped version of the image 00870 EMData *flipped = params.set_default("flip", (EMData *) 0); 00871 bool delete_flag = false; 00872 if (flipped == 0) { 00873 flipped = to->process("xform.flip", Dict("axis", "x")); 00874 delete_flag = true; 00875 } 00876 00877 EMData * rot_trans_align_flip = this_img->align("rotate_translate_iterative", flipped, rt_params, cmp_name, cmp_params); 00878 Transform* t = rot_trans_align_flip->get_attr("xform.align2d"); 00879 t->set_mirror(true); 00880 rot_trans_align_flip->set_attr("xform.align2d",t); 00881 delete t; 00882 00883 // Now finally decide on what is the best answer 00884 float cmp1 = rot_trans_align->cmp(cmp_name, to, cmp_params); 00885 float cmp2 = rot_trans_align_flip->cmp(cmp_name, flipped, cmp_params); 00886 00887 if (delete_flag){ 00888 if(flipped) { 00889 delete flipped; 00890 flipped = 0; 00891 } 00892 } 00893 00894 EMData *result = 0; 00895 if (cmp1 < cmp2 ) { 00896 00897 if( rot_trans_align_flip ) { 00898 delete rot_trans_align_flip; 00899 rot_trans_align_flip = 0; 00900 } 00901 result = rot_trans_align; 00902 } 00903 else { 00904 if( rot_trans_align ) { 00905 delete rot_trans_align; 00906 rot_trans_align = 0; 00907 } 00908 result = rot_trans_align_flip; 00909 result->process_inplace("xform.flip",Dict("axis","x")); 00910 } 00911 00912 return result; 00913 }
|
|
Implements EMAN::Aligner. Definition at line 940 of file aligner.h. 00941 { 00942 return " Does two 'rotate_translate.iterative' alignments, one to accommodate for possible handedness change. Decided which alignment is better using a comparitor and returns the aligned image as the solution"; 00943 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 935 of file aligner.h. 00936 {
00937 return NAME;
00938 }
|
|
Implements EMAN::Aligner. Definition at line 950 of file aligner.h. 00951 { 00952 return static_get_param_types(); 00953 }
|
|
Definition at line 945 of file aligner.h. 00946 { 00947 return new RotateTranslateFlipAlignerIterative(); 00948 }
|
|
Definition at line 955 of file aligner.h. References EMAN::TypeDict::put(). 00955 { 00956 TypeDict d; 00957 d.put("flip", EMObject::EMDATA); 00958 d.put("r1", EMObject::INT, "Inner ring, pixels"); 00959 d.put("r2", EMObject::INT, "Outer ring, pixels"); 00960 d.put("maxiter", EMObject::INT, "Maximum number of iterations"); 00961 d.put("maxshift", EMObject::INT, "Maximum translation in pixels"); 00962 return d; 00963 }
|
|
Definition at line 73 of file aligner.cpp. |