#include <processor.h>
Inheritance diagram for EMAN::PhaseToMassCenterProcessor:
Public Member Functions | |
virtual void | process_inplace (EMData *image) |
To process an image in-place. | |
virtual string | get_name () const |
Get the processor's name. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
virtual TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
Static Public Member Functions | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "xform.phasecenterofmass" |
int_shift_only | set to 1 only shift by integer, no interpolation |
Definition at line 5051 of file processor.h.
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 5066 of file processor.h. 05067 { 05068 return "centers the image the center of mass, which is calculated using Fourier phases, ignores old dx, dy."; 05069 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5056 of file processor.h. References NAME. 05057 { 05058 return NAME; 05059 }
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
Reimplemented from EMAN::Processor. Definition at line 5071 of file processor.h. References EMAN::EMObject::INT, and EMAN::TypeDict::put(). 05072 { 05073 TypeDict d; 05074 d.put("int_shift_only", EMObject::INT, "set to 1 only shift by integer, no interpolation"); 05075 return d; 05076 }
|
|
Definition at line 5061 of file processor.h. 05062 { 05063 return new PhaseToMassCenterProcessor(); 05064 }
|
|
To process an image in-place. For those processors which can only be processed out-of-place, override this function to just print out some error message to remind user call the out-of-place version.
Implements EMAN::Processor. Definition at line 5570 of file processor.cpp. References EMAN::EMData::get_ndim(), LOGWARN, EMAN::Processor::params, EMAN::EMData::phase_cog(), EMAN::EMData::set_attr(), EMAN::Dict::set_default(), EMAN::Transform::set_trans(), t, and EMAN::EMData::translate(). 05571 { 05572 if (!image) { 05573 LOGWARN("NULL Image"); 05574 return; 05575 } 05576 05577 int int_shift_only = params.set_default("int_shift_only",1); 05578 05579 vector<float> pcog = image->phase_cog(); 05580 05581 int dims = image->get_ndim(); 05582 05583 if (int_shift_only) { 05584 int dx=-int(pcog[0]+0.5f),dy=0,dz=0; 05585 if ( dims >= 2 ) dy = -int(pcog[1]+0.5); 05586 if ( dims == 3 ) dz = -int(pcog[2]+0.5); 05587 05588 Transform t; 05589 t.set_trans((float)dx,(float)dy,(float)dz); 05590 if (dims == 3) image->set_attr("xform.align3d",&t); 05591 else if (dims == 2) image->set_attr("xform.align2d",&t); 05592 05593 image->translate(dx,dy,dz); 05594 } else { 05595 float dx=-pcog[0],dy=0.0,dz=0.0; 05596 if ( dims >= 2 ) dy = -pcog[1]; 05597 if ( dims == 3 ) dz = -pcog[2]; 05598 image->translate(dx,dy,dz); 05599 05600 Transform t; 05601 t.set_trans(dx,dy,dz); 05602 if (dims == 3) image->set_attr("xform.align3d",&t); 05603 else if (dims == 2) image->set_attr("xform.align2d",&t); 05604 } 05605 }
|
|
Definition at line 5078 of file processor.h. Referenced by get_name(). |