#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 674 of file aligner.h.
|
||||||||||||
|
Implements EMAN::Aligner. Definition at line 679 of file aligner.h. References align(). 00680 {
00681 return align(this_img, to_img, "sqeuclidean", Dict());
00682 }
|
|
||||||||||||||||||||
|
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 667 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. 00669 {
00670 // Get the non flipped rotational, tranlsationally aligned image
00671 Dict rt_params("maxshift", params["maxshift"],"r1",params.set_default("r1",-1),"r2",params.set_default("r2",-1));
00672 EMData *rot_trans_align = this_img->align("rotate_translate.iterative",to,rt_params,cmp_name, cmp_params);
00673
00674 // Do the same alignment, but using the flipped version of the image
00675 EMData *flipped = params.set_default("flip", (EMData *) 0);
00676 bool delete_flag = false;
00677 if (flipped == 0) {
00678 flipped = to->process("xform.flip", Dict("axis", "x"));
00679 delete_flag = true;
00680 }
00681
00682 EMData * rot_trans_align_flip = this_img->align("rotate_translate.iterative", flipped, rt_params, cmp_name, cmp_params);
00683 Transform* t = rot_trans_align_flip->get_attr("xform.align2d");
00684 t->set_mirror(true);
00685 rot_trans_align_flip->set_attr("xform.align2d",t);
00686 delete t;
00687
00688 // Now finally decide on what is the best answer
00689 float cmp1 = rot_trans_align->cmp(cmp_name, to, cmp_params);
00690 float cmp2 = rot_trans_align_flip->cmp(cmp_name, flipped, cmp_params);
00691
00692 if (delete_flag){
00693 if(flipped) {
00694 delete flipped;
00695 flipped = 0;
00696 }
00697 }
00698
00699 EMData *result = 0;
00700 if (cmp1 < cmp2 ) {
00701
00702 if( rot_trans_align_flip ) {
00703 delete rot_trans_align_flip;
00704 rot_trans_align_flip = 0;
00705 }
00706 result = rot_trans_align;
00707 }
00708 else {
00709 if( rot_trans_align ) {
00710 delete rot_trans_align;
00711 rot_trans_align = 0;
00712 }
00713 result = rot_trans_align_flip;
00714 result->process_inplace("xform.flip",Dict("axis","x"));
00715 }
00716
00717 return result;
00718 }
|
|
|
Implements EMAN::Aligner. Definition at line 689 of file aligner.h. 00690 {
00691 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";
00692 }
|
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 684 of file aligner.h. 00685 {
00686 return NAME;
00687 }
|
|
|
Implements EMAN::Aligner. Definition at line 699 of file aligner.h. 00700 {
00701 return static_get_param_types();
00702 }
|
|
|
Definition at line 694 of file aligner.h. 00695 {
00696 return new RotateTranslateFlipAlignerIterative();
00697 }
|
|
|
Definition at line 704 of file aligner.h. References EMAN::TypeDict::put(). 00704 {
00705 TypeDict d;
00706 d.put("flip", EMObject::EMDATA);
00707 d.put("r1", EMObject::INT, "Inner ring, pixels");
00708 d.put("r2", EMObject::INT, "Outer ring, pixels");
00709 d.put("maxiter", EMObject::INT, "Maximum number of iterations");
00710 d.put("maxshift", EMObject::INT, "Maximum translation in pixels");
00711 return d;
00712 }
|
|
|
Definition at line 69 of file aligner.cpp. |
1.3.9.1