#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 | |
Aligner * | NEW () |
Static Public Attributes | |
const string | NAME = "rotate_translate.iterative" |
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 388 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 394 of file aligner.h. References align(). 00395 { 00396 return align(this_img, to_img, "sqeuclidean", Dict()); 00397 }
|
|
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 393 of file aligner.cpp. References EMAN::EMData::align(), EMAN::EMData::get_attr(), EMAN::EMData::process(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), and t. 00395 { 00396 00397 int maxiter = params.set_default("maxiter", 3); 00398 00399 Dict trans_params; 00400 trans_params["intonly"] = 0; 00401 trans_params["maxshift"] = params.set_default("maxshift", -1); 00402 trans_params["useflcf"] = params.set_default("useflcf",0); 00403 trans_params["nozero"] = params.set_default("nozero",false); 00404 00405 Dict rot_params; 00406 rot_params["r1"] = params.set_default("r1", -1); 00407 rot_params["r2"] = params.set_default("r2", -1); 00408 00409 Transform t; 00410 EMData * moving_img = this_img; 00411 for(int it = 0; it < maxiter; it++){ 00412 00413 // First do a translational alignment 00414 EMData * trans_align = moving_img->align("translational", to, trans_params, cmp_name, cmp_params); 00415 Transform * tt = trans_align->get_attr("xform.align2d"); 00416 t = *tt*t; 00417 delete tt; 00418 00419 //now do rotation 00420 EMData * rottrans_align = trans_align->align("rotational.iterative", to, rot_params, cmp_name, cmp_params); 00421 Transform * rt = rottrans_align->get_attr("xform.align2d"); 00422 t = *rt*t; 00423 delete trans_align; trans_align = 0; 00424 delete rottrans_align; rottrans_align = 0; 00425 delete rt; 00426 00427 //this minimizes interpolation errors (all images that are futher processed will be interpolated at most once) 00428 if(it > 0){delete moving_img;} 00429 00430 moving_img = this_img->process("xform",Dict("transform",&t)); //iterate 00431 } 00432 00433 //write the total transformation; 00434 moving_img->set_attr("xform.align2d", &t); 00435 00436 return moving_img; 00437 }
|
|
Implements EMAN::Aligner. Definition at line 404 of file aligner.h. 00405 { 00406 return "Performs rotational alignment and follows this with translational alignment using the iterative method."; 00407 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 399 of file aligner.h. 00400 {
00401 return NAME;
00402 }
|
|
Implements EMAN::Aligner. Definition at line 414 of file aligner.h. References EMAN::TypeDict::put(). 00415 { 00416 TypeDict d; 00417 //d.put("usedot", EMObject::INT); 00418 d.put("maxshift", EMObject::INT, "Maximum translation in pixels"); 00419 d.put("r1", EMObject::INT, "Inner ring, pixels"); 00420 d.put("r2", EMObject::INT, "Outer ring, pixels"); 00421 d.put("maxiter", EMObject::INT, "Maximum number of iterations"); 00422 d.put("nozero", EMObject::INT,"Zero translation not permitted (useful for CCD images)"); 00423 d.put("useflcf", EMObject::INT,"Use Fast Local Correlation Function rather than CCF for translational alignment"); 00424 return d; 00425 }
|
|
Definition at line 409 of file aligner.h. 00410 { 00411 return new RotateTranslateAlignerIterative(); 00412 }
|
|
Definition at line 58 of file aligner.cpp. |