#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 1170 of file aligner.h.
|
Implements EMAN::Aligner. Definition at line 1175 of file aligner.h. References align(). 01176 { 01177 return align(this_img, to_img, "ccc", Dict()); 01178 }
|
|
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 1529 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. 01530 { 01531 01532 // Set parms 01533 float dphi = params.set_default("dphi",10.f); 01534 float lphi = params.set_default("lphi",0.0f); 01535 float uphi = params.set_default("uphi",359.9f); 01536 01537 Dict d; 01538 d["inc_mirror"] = true; 01539 d["delta"] = params.set_default("delta",10.f); 01540 01541 //Genrate points on a sphere in an asymmetric unit 01542 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params.set_default("sym","c1")); 01543 vector<Transform> transforms = sym->gen_orientations((string)params.set_default("orientgen","eman"),d); 01544 01545 //Genrate symmetry related orritenations 01546 vector<Transform> syms = Symmetry3D::get_symmetries((string)params["sym"]); 01547 01548 float bestquality = 0.0f; 01549 EMData* bestimage = 0; 01550 for(vector<Transform>::const_iterator trans_it = transforms.begin(); trans_it != transforms.end(); trans_it++) { 01551 Dict tparams = trans_it->get_params("eman"); 01552 Transform t(tparams); 01553 for( float phi = lphi; phi < uphi; phi += dphi ) { 01554 tparams["phi"] = phi; 01555 t.set_rotation(tparams); 01556 01557 //Get the averagaer 01558 Averager* imgavg = Factory<Averager>::get((string)params.set_default("avger","mean")); 01559 //Now make the averages 01560 for ( vector<Transform>::const_iterator it = syms.begin(); it != syms.end(); ++it ) { 01561 Transform sympos = (*it)*t; 01562 EMData* transformed = this_img->process("xform",Dict("transform",&sympos)); 01563 imgavg->add_image(transformed); 01564 delete transformed; 01565 } 01566 01567 EMData* symptcl=imgavg->finish(); 01568 delete imgavg; 01569 //See which average is the best 01570 float quality = symptcl->get_attr("sigma"); 01571 cout << quality << " " << phi << endl; 01572 if(quality > bestquality) { 01573 bestquality = quality; 01574 bestimage = symptcl; 01575 } else { 01576 delete symptcl; 01577 } 01578 } 01579 } 01580 if(sym != 0) delete sym; 01581 01582 return bestimage; 01583 }
|
|
Implements EMAN::Aligner. Definition at line 1201 of file aligner.h. 01202 { 01203 return "The image is centered and rotated to the standard orientation for the specified symmetry"; 01204 }
|
|
Get the Aligner's name. Each Aligner is identified by a unique name.
Implements EMAN::Aligner. Definition at line 1179 of file aligner.h. 01180 {
01181 return NAME;
01182 }
|
|
Implements EMAN::Aligner. Definition at line 1189 of file aligner.h. References EMAN::TypeDict::put(). 01190 { 01191 TypeDict d; 01192 d.put("sym", EMObject::STRING, "The symmetry under which to do the alignment, Default=c1" ); 01193 d.put("delta", EMObject::FLOAT,"Angle the separates points on the sphere. This is exclusive of the \'n\' paramater. Default is 10"); 01194 d.put("dphi", EMObject::FLOAT,"The angle increment in the phi direction. Default is 10"); 01195 d.put("lphi", EMObject::FLOAT,"Lower bound for phi. Default it 0"); 01196 d.put("uphi", EMObject::FLOAT,"Upper bound for phi. Default it 359.9"); 01197 d.put("avger", EMObject::STRING, "The sort of averager to use, Default=mean" ); 01198 return d; 01199 }
|
|
Definition at line 1184 of file aligner.h. 01185 { 01186 return new SymAlignProcessor(); 01187 }
|
|
Definition at line 81 of file aligner.cpp. |