#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 | |
Processor * | NEW () |
Static Public Attributes | |
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 4900 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 4923 of file processor.h. 04924 { 04925 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."; 04926 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4905 of file processor.h. 04906 {
04907 return NAME;
04908 }
|
|
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 4915 of file processor.h. References EMAN::TypeDict::put(). 04916 { 04917 TypeDict d; 04918 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."); 04919 d.put("sym", EMObject::STRING, "The symmetry, for example, d7"); 04920 return d; 04921 }
|
|
Definition at line 4910 of file processor.h. 04911 { 04912 return new AutoMaskAsymUnit(); 04913 }
|
|
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 5167 of file processor.cpp. References EMAN::Factory< T >::get(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, nx, ny, EMAN::Symmetry3D::point_in_which_asym_unit(), v, and EMAN::Vec3f. 05167 { 05168 if (!image) { 05169 LOGWARN("NULL Image"); 05170 return; 05171 } 05172 05173 int nx = image->get_xsize(); 05174 int ny = image->get_ysize(); 05175 int nz = image->get_zsize(); 05176 05177 int ox = nx/2; 05178 int oy = ny/2; 05179 int oz = nz/2; 05180 05181 Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]); 05182 int au = params.set_default("au",0); 05183 05184 float *d = image->get_data(); 05185 for(int k = 0; k < nz; ++k ) { 05186 for(int j = 0; j < ny; ++j ) { 05187 for (int i = 0; i< nx; ++i, ++d) { 05188 //cout << i << " " << j << " " << k << endl; 05189 Vec3f v(i-ox,j-oy,k-oz); 05190 // v.normalize(); 05191 int a = sym->point_in_which_asym_unit(v); 05192 if (au == -1) { 05193 *d = (float)a; 05194 } else { 05195 if ( a == au ) *d = 1; 05196 else *d = 0; 05197 } 05198 } 05199 } 05200 } 05201 05202 delete sym; 05203 05204 }
|
|
Definition at line 166 of file processor.cpp. |