#include <cmp.h>
Inheritance diagram for EMAN::TomoCccCmp:
Public Member Functions | |
virtual float | cmp (EMData *image, EMData *with) const |
To compare 'image' with another image passed in through its parameters. | |
virtual string | get_name () const |
Get the Cmp's name. | |
virtual string | get_desc () const |
TypeDict | get_param_types () const |
Get Cmp parameter information in a dictionary. | |
Static Public Member Functions | |
Cmp * | NEW () |
Static Public Attributes | |
const string | NAME = "ccc.tomo" |
Somewhat of a heuristic solution, but it seems to work. Basiaclly it relies on the observation that 'good' matchs will conentrate the correlation signal in the peak, wheras 'bad' correlations will distribute the signal.
norm | Normalize the ccf (you need to do this if a missing wedge is present) | |
ccf | Supply your own ccf function (can be used for speedups) | |
searchx | The maximum acceptable tx from the origin | |
searchy | The maximum acceptable ty from the origin | |
searchz | The maximum acceptable tz from the origin |
Definition at line 314 of file cmp.h.
|
To compare 'image' with another image passed in through its parameters. An optional transformation may be used to transform the 2 images.
Implements EMAN::Cmp. Definition at line 582 of file cmp.cpp. References EMAN::EMData::calc_ccf(), EMAN::EMData::calc_max_location_wrap(), EMAN::EMData::get_value_at_wrap(), norm(), EMAN::EMData::process_inplace(), EMAN::EMData::set_attr(), and EMAN::Dict::set_default(). 00583 { 00584 ENTERFUNC; 00585 EMData* ccf = params.set_default("ccf",(EMData*) NULL); 00586 bool ccf_ownership = false; 00587 if (!ccf) { 00588 ccf = image->calc_ccf(with); 00589 ccf_ownership = true; 00590 } 00591 bool norm = params.set_default("norm",true); 00592 bool zeroori = params.set_default("zeroori",false); 00593 00594 if (norm) ccf->process_inplace("normalize"); 00595 00596 IntPoint point; 00597 if (zeroori) { 00598 point[0] = 0; point[1] = 0; point[2] = 0; 00599 } else { 00600 int searchx = params.set_default("searchx",-1); 00601 int searchy = params.set_default("searchy",-1); 00602 int searchz = params.set_default("searchz",-1); 00603 point = ccf->calc_max_location_wrap(searchx,searchy,searchz); 00604 } 00605 00606 //this is to prevent us from doing a ccf twice 00607 float tx = (float)point[0]; float ty = (float)point[1]; float tz = (float)point[2]; 00608 image->set_attr("tx", tx); 00609 image->set_attr("ty", ty); 00610 image->set_attr("tz", tz); 00611 00612 float best_score = ccf->get_value_at_wrap(tx,ty,tz); 00613 if (ccf_ownership) delete ccf; ccf = 0; 00614 00615 return -best_score; 00616 00617 }
|
|
Implements EMAN::Cmp. Definition at line 324 of file cmp.h. 00325 { 00326 return "Ccc with consideration given for the missing wedge"; 00327 }
|
|
Get the Cmp's name. Each Cmp is identified by a unique name.
Implements EMAN::Cmp. Definition at line 319 of file cmp.h. 00320 {
00321 return NAME;
00322 }
|
|
Get Cmp parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Implements EMAN::Cmp. Definition at line 334 of file cmp.h. References EMAN::TypeDict::put(). 00335 { 00336 TypeDict d; 00337 d.put("norm", EMObject::BOOL,"Whether the cross correlation image should be normalized (should be for normalized images). Default is true."); 00338 d.put("ccf", EMObject::EMDATA,"The ccf image, can be provided if it already exists to avoid recalculating it"); 00339 d.put("searchx", EMObject::INT, "The maximum range of the peak location in the x direction. Default is sizex/4"); 00340 d.put("searchy", EMObject::INT, "The maximum range of the peak location in the y direction. Default is sizey/4"); 00341 d.put("searchz", EMObject::INT, "The maximum range of the peak location in the z direction. Default is sizez/4"); 00342 d.put("zeroori", EMObject::FLOAT,"When using the ccc.tomo aligner, use the peak at origin (use only with refine3D aligner)."); 00343 return d; 00344 }
|
|
Definition at line 329 of file cmp.h. 00330 { 00331 return new TomoCccCmp(); 00332 }
|
|
|