#include <processor.h>


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 () |
| 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 4595 of file processor.h.
| 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 4734 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.
04734 { 04735 if (!image) { 04736 LOGWARN("NULL Image"); 04737 return; 04738 } 04739 04740 int nx = image->get_xsize(); 04741 int ny = image->get_ysize(); 04742 int nz = image->get_zsize(); 04743 04744 int ox = nx/2; 04745 int oy = ny/2; 04746 int oz = nz/2; 04747 04748 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]); 04749 int au = params.set_default("au",0); 04750 04751 float *d = image->get_data(); 04752 for(int k = 0; k < nz; ++k ) { 04753 for(int j = 0; j < ny; ++j ) { 04754 for (int i = 0; i< nx; ++i, ++d) { 04755 //cout << i << " " << j << " " << k << endl; 04756 Vec3f v(i-ox,j-oy,k-oz); 04757 // v.normalize(); 04758 int a = sym->point_in_which_asym_unit(v); 04759 if (au == -1) { 04760 *d = (float)a; 04761 } else { 04762 if ( a == au ) *d = 1; 04763 else *d = 0; 04764 } 04765 } 04766 } 04767 } 04768 04769 delete sym; 04770 04771 }
| 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 4600 of file processor.h.
| static Processor* EMAN::AutoMaskAsymUnit::NEW | ( | ) | [inline, static] |
| 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 4610 of file processor.h.
References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.
04611 { 04612 TypeDict d; 04613 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."); 04614 d.put("sym", EMObject::STRING, "The symmetry, for example, d7"); 04615 return d; 04616 }
| 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 4618 of file processor.h.
04619 { 04620 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."; 04621 }
1.5.6