#include <aligner.h>
Inheritance diagram for EMAN::RotateTranslateAligner:
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" |
maxshift | Maximum translation in pixels | |
nozero | Zero translation not permitted (useful for CCD images) | |
rfp_mode | Either 0,1 or 2. A temporary flag for testing the rotational foot print |
Definition at line 340 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 346 of file aligner.h. References align(). 00347 { 00348 return align(this_img, to_img, "sqeuclidean", Dict()); 00349 }
|
|
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 439 of file aligner.cpp. References EMAN::EMData::align(), EMAN::RotationalAligner::align_180_ambiguous(), EMAN::EMData::cmp(), EMAN::EMData::copy(), EMAN::EMData::get_attr(), EMAN::Transform::get_rotation(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), EMAN::Transform::set_rotation(), and t. 00441 { 00442 // Get the 180 degree ambiguously rotationally aligned and its 180 degree rotation counterpart 00443 int rfp_mode = params.set_default("rfp_mode",0); 00444 EMData *rot_align = RotationalAligner::align_180_ambiguous(this_img,to,rfp_mode); 00445 Transform * tmp = rot_align->get_attr("xform.align2d"); 00446 Dict rot = tmp->get_rotation("2d"); 00447 float rotate_angle_solution = rot["alpha"]; 00448 delete tmp; 00449 00450 EMData *rot_align_180 = rot_align->copy(); 00451 rot_align_180->process_inplace("math.rotate.180"); 00452 00453 Dict trans_params; 00454 trans_params["intonly"] = 0; 00455 trans_params["maxshift"] = params.set_default("maxshift", -1); 00456 trans_params["useflcf"]=params.set_default("useflcf",0); 00457 00458 // Do the first case translational alignment 00459 trans_params["nozero"] = params.set_default("nozero",false); 00460 EMData* rot_trans = rot_align->align("translational", to, trans_params, cmp_name, cmp_params); 00461 if( rot_align ) { // Clean up 00462 delete rot_align; 00463 rot_align = 0; 00464 } 00465 00466 // Do the second case translational alignment 00467 EMData* rot_180_trans = rot_align_180->align("translational", to, trans_params, cmp_name, cmp_params); 00468 if( rot_align_180 ) { // Clean up 00469 delete rot_align_180; 00470 rot_align_180 = 0; 00471 } 00472 00473 // Finally decide on the result 00474 float cmp1 = rot_trans->cmp(cmp_name, to, cmp_params); 00475 float cmp2 = rot_180_trans->cmp(cmp_name, to, cmp_params); 00476 00477 EMData *result = 0; 00478 if (cmp1 < cmp2) { // Assumes smaller is better - thus all comparitors should support "smaller is better" 00479 if( rot_180_trans ) { 00480 delete rot_180_trans; 00481 rot_180_trans = 0; 00482 } 00483 result = rot_trans; 00484 } 00485 else { 00486 if( rot_trans ) { 00487 delete rot_trans; 00488 rot_trans = 0; 00489 } 00490 result = rot_180_trans; 00491 rotate_angle_solution -= 180.f; 00492 } 00493 00494 Transform* t = result->get_attr("xform.align2d"); 00495 t->set_rotation(Dict("type","2d","alpha",rotate_angle_solution)); 00496 result->set_attr("xform.align2d",t); 00497 delete t; 00498 00499 return result; 00500 }
|
|
Implements EMAN::Aligner. Definition at line 356 of file aligner.h. 00357 { 00358 return "Performs rotational alignment and follows this with translational alignment."; 00359 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 351 of file aligner.h. 00352 {
00353 return NAME;
00354 }
|
|
Implements EMAN::Aligner. Definition at line 366 of file aligner.h. References EMAN::TypeDict::put(). 00367 { 00368 TypeDict d; 00369 //d.put("usedot", EMObject::INT); 00370 d.put("maxshift", EMObject::INT, "Maximum translation in pixels"); 00371 d.put("nozero", EMObject::INT,"Zero translation not permitted (useful for CCD images)"); 00372 d.put("rfp_mode", EMObject::INT,"Either 0,1 or 2. A temporary flag for testing the rotational foot print"); 00373 d.put("useflcf", EMObject::INT,"Use Fast Local Correlation Function rather than CCF for translational alignment"); 00374 return d; 00375 }
|
|
Definition at line 361 of file aligner.h. 00362 { 00363 return new RotateTranslateAligner(); 00364 }
|
|
Definition at line 57 of file aligner.cpp. |