#include <processor.h>
Inheritance diagram for EMAN::AutoMaskAsymUnit:
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 TypeDict | get_param_types () const |
Get processor parameter information in a dictionary. | |
virtual string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "mask.asymunit" |
au | The asymmetric unit to mask, if -1 masks all asymmetric units but assigns each a unique value | |
sym | The symmetry type, for example, "tet" |
Definition at line 4982 of file processor.h.
virtual string EMAN::AutoMaskAsymUnit::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 5005 of file processor.h.
05006 { 05007 return "Masks out a specific asymmetric unit of the given symmetry. If the au parameter is -1 will mask all asymmetric units, assigning the asymetric unit number to the masked area."; 05008 }
virtual string EMAN::AutoMaskAsymUnit::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 4987 of file processor.h.
References NAME.
04988 { 04989 return NAME; 04990 }
virtual TypeDict EMAN::AutoMaskAsymUnit::get_param_types | ( | ) | const [inline, virtual] |
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 4997 of file processor.h.
References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.
04998 { 04999 TypeDict d; 05000 d.put("au", EMObject::INT, "The asymmetric unit to mask out. If this is -1 will mask all asymmetric units, giving each a unique number."); 05001 d.put("sym", EMObject::STRING, "The symmetry, for example, d7"); 05002 return d; 05003 }
static Processor* EMAN::AutoMaskAsymUnit::NEW | ( | ) | [inline, static] |
void AutoMaskAsymUnit::process_inplace | ( | EMData * | image | ) | [virtual] |
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.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 5349 of file processor.cpp.
References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, EMAN::Processor::params, EMAN::Symmetry3D::point_in_which_asym_unit(), and v.
05349 { 05350 if (!image) { 05351 LOGWARN("NULL Image"); 05352 return; 05353 } 05354 05355 int nx = image->get_xsize(); 05356 int ny = image->get_ysize(); 05357 int nz = image->get_zsize(); 05358 05359 int ox = nx/2; 05360 int oy = ny/2; 05361 int oz = nz/2; 05362 05363 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]); 05364 int au = params.set_default("au",0); 05365 05366 float *d = image->get_data(); 05367 for(int k = 0; k < nz; ++k ) { 05368 for(int j = 0; j < ny; ++j ) { 05369 for (int i = 0; i< nx; ++i, ++d) { 05370 //cout << i << " " << j << " " << k << endl; 05371 Vec3f v(i-ox,j-oy,k-oz); 05372 // v.normalize(); 05373 int a = sym->point_in_which_asym_unit(v); 05374 if (au == -1) { 05375 *d = (float)a; 05376 } else { 05377 if ( a == au ) *d = 1; 05378 else *d = 0; 05379 } 05380 } 05381 } 05382 } 05383 05384 delete sym; 05385 05386 }
const string AutoMaskAsymUnit::NAME = "mask.asymunit" [static] |