#include <aligner.h>
Inheritance diagram for EMAN::RotateFlipAligner:
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 TypeDict | static_get_param_types () |
Static Public Attributes | |
static const string | NAME = "rotate_flip" |
imask | ||
rfp_mode | Either 0,1 or 2. A temporary flag for testing the rotational foot print |
Definition at line 384 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 389 of file aligner.h. References align(). 00390 { 00391 return align(this_img, to_img, "", Dict()); 00392 }
|
|
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 475 of file aligner.cpp. References EMAN::EMData::align(), EMAN::EMData::cmp(), cmp1(), cmp2(), EMAN::EMData::get_attr(), EMAN::Aligner::params, EMAN::EMData::process(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), EMAN::Transform::set_mirror(), and t. Referenced by align(). 00477 { 00478 Dict rot_params("rfp_mode",params.set_default("rfp_mode",0)); 00479 EMData *r1 = this_img->align("rotational", to, rot_params,cmp_name, cmp_params); 00480 00481 00482 EMData* flipped =to->process("xform.flip", Dict("axis", "x")); 00483 EMData *r2 = this_img->align("rotational", flipped,rot_params, cmp_name, cmp_params); 00484 Transform* t = r2->get_attr("xform.align2d"); 00485 t->set_mirror(true); 00486 r2->set_attr("xform.align2d",t); 00487 delete t; 00488 00489 float cmp1 = r1->cmp(cmp_name, to, cmp_params); 00490 float cmp2 = r2->cmp(cmp_name, flipped, cmp_params); 00491 00492 delete flipped; flipped = 0; 00493 00494 EMData *result = 0; 00495 00496 if (cmp1 < cmp2) { 00497 if( r2 ) 00498 { 00499 delete r2; 00500 r2 = 0; 00501 } 00502 result = r1; 00503 } 00504 else { 00505 if( r1 ) 00506 { 00507 delete r1; 00508 r1 = 0; 00509 } 00510 result = r2; 00511 result->process_inplace("xform.flip",Dict("axis","x")); 00512 } 00513 00514 return result; 00515 }
|
|
Implements EMAN::Aligner. Definition at line 398 of file aligner.h. 00399 { 00400 return "Performs two rotational alignments, one using the original image and one using the hand-flipped image. Decides which alignment is better using a comparitor and returns it"; 00401 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 393 of file aligner.h. References NAME. 00394 { 00395 return NAME; 00396 }
|
|
Implements EMAN::Aligner. Definition at line 408 of file aligner.h. References static_get_param_types(). 00409 { 00410 return static_get_param_types(); 00411 }
|
|
Definition at line 403 of file aligner.h.
|
|
Definition at line 413 of file aligner.h. References EMAN::EMObject::INT, and EMAN::TypeDict::put(). Referenced by get_param_types(). 00413 { 00414 TypeDict d; 00415 00416 d.put("imask", EMObject::INT); 00417 d.put("rfp_mode", EMObject::INT,"Either 0,1 or 2. A temporary flag for testing the rotational foot print"); 00418 return d; 00419 }
|
|
Definition at line 421 of file aligner.h. Referenced by get_name(). |