#include <aligner.h>
Inheritance diagram for EMAN::SymAlignProcessor:
Public Member Functions | |
virtual EMData * | align (EMData *this_img, EMData *to_img, const string &cmp_name="ccc", 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 TypeDict | get_param_types () const |
virtual string | get_desc () const |
Static Public Member Functions | |
static Aligner * | NEW () |
Static Public Attributes | |
static const string | NAME = "symalign" |
Works by searching over a Grid and maximizing the recon variance after symmetrization. NOTE: This function is depricated. Use the SymAlignProcessorQuat procssor instead.
sym | A string specifying the symmetry under which to do the alignment |
Definition at line 1164 of file aligner.h.
virtual EMData* EMAN::SymAlignProcessor::align | ( | EMData * | this_img, | |
EMData * | to_img | |||
) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 1169 of file aligner.h.
References align().
01170 { 01171 return align(this_img, to_img, "ccc", Dict()); 01172 }
EMData * SymAlignProcessor::align | ( | EMData * | this_img, | |
EMData * | to_img, | |||
const string & | cmp_name = "ccc" , |
|||
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 1508 of file aligner.cpp.
References EMAN::Averager::add_image(), EMAN::Averager::finish(), EMAN::Symmetry3D::gen_orientations(), EMAN::EMData::get_attr(), EMAN::Symmetry3D::get_symmetries(), EMAN::Aligner::params, phi, EMAN::EMData::process(), EMAN::Dict::set_default(), and t.
Referenced by align().
01509 { 01510 01511 // Set parms 01512 float dphi = params.set_default("dphi",10.f); 01513 float lphi = params.set_default("lphi",0.0f); 01514 float uphi = params.set_default("uphi",359.9f); 01515 01516 Dict d; 01517 d["inc_mirror"] = true; 01518 d["delta"] = params.set_default("delta",10.f); 01519 01520 //Genrate points on a sphere in an asymmetric unit 01521 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params.set_default("sym","c1")); 01522 vector<Transform> transforms = sym->gen_orientations((string)params.set_default("orientgen","eman"),d); 01523 01524 //Genrate symmetry related orritenations 01525 vector<Transform> syms = Symmetry3D::get_symmetries((string)params["sym"]); 01526 01527 float bestquality = 0.0f; 01528 EMData* bestimage = 0; 01529 for(vector<Transform>::const_iterator trans_it = transforms.begin(); trans_it != transforms.end(); trans_it++) { 01530 Dict tparams = trans_it->get_params("eman"); 01531 Transform t(tparams); 01532 for( float phi = lphi; phi < uphi; phi += dphi ) { 01533 tparams["phi"] = phi; 01534 t.set_rotation(tparams); 01535 01536 //Get the averagaer 01537 Averager* imgavg = Factory<Averager>::get((string)params.set_default("avger","mean")); 01538 //Now make the averages 01539 for ( vector<Transform>::const_iterator it = syms.begin(); it != syms.end(); ++it ) { 01540 Transform sympos = (*it)*t; 01541 EMData* transformed = this_img->process("xform",Dict("transform",&sympos)); 01542 imgavg->add_image(transformed); 01543 delete transformed; 01544 } 01545 01546 EMData* symptcl=imgavg->finish(); 01547 delete imgavg; 01548 //See which average is the best 01549 float quality = symptcl->get_attr("sigma"); 01550 cout << quality << " " << phi << endl; 01551 if(quality > bestquality) { 01552 bestquality = quality; 01553 bestimage = symptcl; 01554 } else { 01555 delete symptcl; 01556 } 01557 } 01558 } 01559 if(sym != 0) delete sym; 01560 01561 return bestimage; 01562 }
virtual string EMAN::SymAlignProcessor::get_desc | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 1195 of file aligner.h.
01196 { 01197 return "The image is centered and rotated to the standard orientation for the specified symmetry"; 01198 }
virtual string EMAN::SymAlignProcessor::get_name | ( | ) | const [inline, virtual] |
virtual TypeDict EMAN::SymAlignProcessor::get_param_types | ( | ) | const [inline, virtual] |
Implements EMAN::Aligner.
Definition at line 1183 of file aligner.h.
References EMAN::EMObject::FLOAT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.
01184 { 01185 TypeDict d; 01186 d.put("sym", EMObject::STRING, "The symmetry under which to do the alignment, Default=c1" ); 01187 d.put("delta", EMObject::FLOAT,"Angle the separates points on the sphere. This is exclusive of the \'n\' paramater. Default is 10"); 01188 d.put("dphi", EMObject::FLOAT,"The angle increment in the phi direction. Default is 10"); 01189 d.put("lphi", EMObject::FLOAT,"Lower bound for phi. Default it 0"); 01190 d.put("uphi", EMObject::FLOAT,"Upper bound for phi. Default it 359.9"); 01191 d.put("avger", EMObject::STRING, "The sort of averager to use, Default=mean" ); 01192 return d; 01193 }
static Aligner* EMAN::SymAlignProcessor::NEW | ( | ) | [inline, static] |
const string SymAlignProcessor::NAME = "symalign" [static] |