#include <aligner.h>
Inheritance diagram for EMAN::RotateTranslateAlignerIterative:
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 Public Attributes | |
static const string | NAME = "rotate_translate_iterative" |
Basically, we find the best translation, and move to that pointer then we find the best rotation and rotate to that point. Next we iterate X times.
maxshift | Maximum translation in pixels | |
r1 | inner ring | |
r2 | outer ring | |
maxiter | maximum number of alignment iterations | |
nozero | Zero translation not permitted (useful for CCD images) |
Definition at line 522 of file aligner.h.
virtual EMData* EMAN::RotateTranslateAlignerIterative::align | ( | EMData * | this_img, | |
EMData * | to_img | |||
) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 528 of file aligner.h.
References align().
00529 { 00530 return align(this_img, to_img, "sqeuclidean", Dict()); 00531 }
EMData * RotateTranslateAlignerIterative::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 583 of file aligner.cpp.
References EMAN::EMData::align(), EMAN::EMData::get_attr(), EMAN::Aligner::params, EMAN::EMData::process(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), and t.
Referenced by align().
00585 { 00586 int maxiter = params.set_default("maxiter", 3); 00587 00588 Dict trans_params; 00589 trans_params["intonly"] = 0; 00590 trans_params["maxshift"] = params.set_default("maxshift", -1); 00591 trans_params["useflcf"] = params.set_default("useflcf",0); 00592 trans_params["nozero"] = params.set_default("nozero",false); 00593 00594 Dict rot_params; 00595 rot_params["r1"] = params.set_default("r1", -1); 00596 rot_params["r2"] = params.set_default("r2", -1); 00597 00598 Transform t; 00599 EMData * moving_img = this_img; 00600 for(int it = 0; it < maxiter; it++){ 00601 00602 // First do a translational alignment 00603 EMData * trans_align = moving_img->align("translational", to, trans_params, cmp_name, cmp_params); 00604 Transform * tt = trans_align->get_attr("xform.align2d"); 00605 t = *tt*t; 00606 delete tt; 00607 00608 //now do rotation 00609 EMData * rottrans_align = trans_align->align("rotational_iterative", to, rot_params, cmp_name, cmp_params); 00610 Transform * rt = rottrans_align->get_attr("xform.align2d"); 00611 t = *rt*t; 00612 delete trans_align; trans_align = 0; 00613 delete rottrans_align; rottrans_align = 0; 00614 delete rt; 00615 00616 //this minimizes interpolation errors (all images that are futher processed will be interpolated at most twice) 00617 if(it > 0){delete moving_img;} 00618 00619 moving_img = this_img->process("xform",Dict("transform",&t)); //iterate 00620 } 00621 00622 //write the total transformation; Avoids interpolation erros 00623 moving_img->set_attr("xform.align2d", &t); 00624 00625 return moving_img; 00626 }
virtual string EMAN::RotateTranslateAlignerIterative::get_desc | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 538 of file aligner.h.
00539 { 00540 return "Performs rotational alignment and follows this with translational alignment using the iterative method."; 00541 }
virtual string EMAN::RotateTranslateAlignerIterative::get_name | ( | ) | const [inline, virtual] |
virtual TypeDict EMAN::RotateTranslateAlignerIterative::get_param_types | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 548 of file aligner.h.
References EMAN::EMObject::INT, and EMAN::TypeDict::put().
00549 { 00550 TypeDict d; 00551 d.put("maxshift", EMObject::INT, "Maximum translation in pixels"); 00552 d.put("r1", EMObject::INT, "Inner ring, pixels"); 00553 d.put("r2", EMObject::INT, "Outer ring, pixels"); 00554 d.put("maxiter", EMObject::INT, "Maximum number of iterations"); 00555 d.put("nozero", EMObject::INT,"Zero translation not permitted (useful for CCD images)"); 00556 d.put("useflcf", EMObject::INT,"Use Fast Local Correlation Function rather than CCF for translational alignment"); 00557 return d; 00558 }
static Aligner* EMAN::RotateTranslateAlignerIterative::NEW | ( | ) | [inline, static] |
const string RotateTranslateAlignerIterative::NAME = "rotate_translate_iterative" [static] |