Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::AutoMaskAsymUnit Class Reference

Tries to mask out only interesting density. More...

#include <processor.h>

Inheritance diagram for EMAN::AutoMaskAsymUnit:

Inheritance graph
[legend]
Collaboration diagram for EMAN::AutoMaskAsymUnit:

Collaboration graph
[legend]
List of all members.

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 ProcessorNEW ()

Static Public Attributes

static const string NAME = "mask.asymunit"

Detailed Description

Tries to mask out only interesting density.

Parameters:
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"
Author:
David Woolford
Date:
February 2009

Definition at line 4901 of file processor.h.


Member Function Documentation

virtual string EMAN::AutoMaskAsymUnit::get_desc  )  const [inline, virtual]
 

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

Returns:
The description of this processor.

Implements EMAN::Processor.

Definition at line 4924 of file processor.h.

04925                         {
04926                                 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.";
04927                         }

virtual string EMAN::AutoMaskAsymUnit::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 4906 of file processor.h.

References NAME.

04907                         {
04908                                 return NAME;
04909                         }

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.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 4916 of file processor.h.

References EMAN::EMObject::INT, EMAN::TypeDict::put(), and EMAN::EMObject::STRING.

04917                         {
04918                                 TypeDict d;
04919                                 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.");
04920                                 d.put("sym", EMObject::STRING, "The symmetry, for example, d7");
04921                                 return d;
04922                         }

static Processor* EMAN::AutoMaskAsymUnit::NEW  )  [inline, static]
 

Definition at line 4911 of file processor.h.

04912                         {
04913                                 return new AutoMaskAsymUnit();
04914                         }

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.

Parameters:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 5198 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, EMAN::Processor::params, EMAN::Symmetry3D::point_in_which_asym_unit(), and v.

05198                                                     {
05199         if (!image) {
05200                 LOGWARN("NULL Image");
05201                 return;
05202         }
05203 
05204         int nx = image->get_xsize();
05205         int ny = image->get_ysize();
05206         int nz = image->get_zsize();
05207 
05208         int ox = nx/2;
05209         int oy = ny/2;
05210         int oz = nz/2;
05211 
05212         Symmetry3D* sym = Factory<Symmetry3D>::get((string)params["sym"]);
05213         int au = params.set_default("au",0);
05214 
05215         float *d = image->get_data();
05216         for(int k = 0; k < nz; ++k ) {
05217                 for(int j = 0; j < ny; ++j ) {
05218                         for (int i = 0; i< nx; ++i, ++d) {
05219                                 //cout << i << " " << j << " " << k << endl;
05220                                 Vec3f v(i-ox,j-oy,k-oz);
05221 //                              v.normalize();
05222                                 int a = sym->point_in_which_asym_unit(v);
05223                                 if (au == -1) {
05224                                         *d = (float)a;
05225                                 } else {
05226                                         if ( a == au ) *d = 1;
05227                                         else *d = 0;
05228                                 }
05229                         }
05230                 }
05231         }
05232 
05233         delete sym;
05234 
05235 }


Member Data Documentation

const string AutoMaskAsymUnit::NAME = "mask.asymunit" [static]
 

Definition at line 4929 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Tue May 25 17:37:35 2010 for EMAN2 by  doxygen 1.4.4