#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 | |
Aligner * | NEW () |
Static Public Attributes | |
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.
|
Implements EMAN::Aligner. Definition at line 1169 of file aligner.h. References align(). 01170 { 01171 return align(this_img, to_img, "ccc", Dict()); 01172 }
|
|
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 1513 of file aligner.cpp. References EMAN::Averager::add_image(), EMAN::Averager::finish(), EMAN::Symmetry3D::gen_orientations(), EMAN::Factory< T >::get(), EMAN::EMData::get_attr(), EMAN::FactoryBase::get_params(), EMAN::Symmetry3D::get_symmetries(), phi, EMAN::EMData::process(), EMAN::Dict::set_default(), EMAN::Transform::set_rotation(), and t. 01514 { 01515 01516 // Set parms 01517 float dphi = params.set_default("dphi",10.f); 01518 float lphi = params.set_default("lphi",0.0f); 01519 float uphi = params.set_default("uphi",359.9f); 01520 01521 Dict d; 01522 d["inc_mirror"] = true; 01523 d["delta"] = params.set_default("delta",10.f); 01524 01525 //Genrate points on a sphere in an asymmetric unit 01526 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params.set_default("sym","c1")); 01527 vector<Transform> transforms = sym->gen_orientations((string)params.set_default("orientgen","eman"),d); 01528 01529 //Genrate symmetry related orritenations 01530 vector<Transform> syms = Symmetry3D::get_symmetries((string)params["sym"]); 01531 01532 float bestquality = 0.0f; 01533 EMData* bestimage = 0; 01534 for(vector<Transform>::const_iterator trans_it = transforms.begin(); trans_it != transforms.end(); trans_it++) { 01535 Dict tparams = trans_it->get_params("eman"); 01536 Transform t(tparams); 01537 for( float phi = lphi; phi < uphi; phi += dphi ) { 01538 tparams["phi"] = phi; 01539 t.set_rotation(tparams); 01540 01541 //Get the averagaer 01542 Averager* imgavg = Factory<Averager>::get((string)params.set_default("avger","mean")); 01543 //Now make the averages 01544 for ( vector<Transform>::const_iterator it = syms.begin(); it != syms.end(); ++it ) { 01545 Transform sympos = (*it)*t; 01546 EMData* transformed = this_img->process("xform",Dict("transform",&sympos)); 01547 imgavg->add_image(transformed); 01548 delete transformed; 01549 } 01550 01551 EMData* symptcl=imgavg->finish(); 01552 delete imgavg; 01553 //See which average is the best 01554 float quality = symptcl->get_attr("sigma"); 01555 cout << quality << " " << phi << endl; 01556 if(quality > bestquality) { 01557 bestquality = quality; 01558 bestimage = symptcl; 01559 } else { 01560 delete symptcl; 01561 } 01562 } 01563 } 01564 if(sym != 0) delete sym; 01565 01566 return bestimage; 01567 }
|
|
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 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 1173 of file aligner.h. 01174 {
01175 return NAME;
01176 }
|
|
Implements EMAN::Aligner. Definition at line 1183 of file aligner.h. References EMAN::TypeDict::put(). 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 }
|
|
Definition at line 1178 of file aligner.h. 01179 { 01180 return new SymAlignProcessor(); 01181 }
|
|
Definition at line 81 of file aligner.cpp. |