#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 1508 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. 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 }
|
|
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 80 of file aligner.cpp. |