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

EMAN::IndexMaskFileProcessor Class Reference

Multiplies the image by the specified file using pixel indices. More...

#include <processor.h>

Inheritance diagram for EMAN::IndexMaskFileProcessor:

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

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

ProcessorNEW ()

Static Public Attributes

const string NAME = "mask.fromfile"

Detailed Description

Multiplies the image by the specified file using pixel indices.

The images must be same size. If 'ismaskset=' is 1, it will take a file containing a set of masks and apply the first mask to the image.

Parameters:
filename mask image file name
ismaskset If set to 1, it will take a file containing a set of masks and apply the first mask to the image

Definition at line 5210 of file processor.h.


Member Function Documentation

virtual string EMAN::IndexMaskFileProcessor::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 5233 of file processor.h.

05234                 {
05235                         return "Multiplies the image by the specified file using pixel indices. The images must be same size. If 'ismaskset=' is 1, it will take a file containing a set of masks and apply the first mask to the image.";
05236                 }

virtual string EMAN::IndexMaskFileProcessor::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 5215 of file processor.h.

05216                 {
05217                         return NAME;
05218                 }

virtual TypeDict EMAN::IndexMaskFileProcessor::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 5225 of file processor.h.

References EMAN::TypeDict::put().

05226                 {
05227                         TypeDict d;
05228                         d.put("filename", EMObject::STRING, "mask image file name");
05229                         d.put("ismaskset", EMObject::INT, "If set to 1, it will take a file containing a set of masks and apply the first mask to the image");
05230                         return d;
05231                 }

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

Definition at line 5220 of file processor.h.

05221                 {
05222                         return new IndexMaskFileProcessor();
05223                 }

void IndexMaskFileProcessor::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 5964 of file processor.cpp.

References EMAN::EMUtil::is_same_size(), LOGERR, LOGWARN, EMAN::EMData::mult(), EMAN::EMData::process_inplace(), and EMAN::EMData::read_image().

05965 {
05966         if (!image) {
05967                 LOGWARN("NULL Image");
05968                 return;
05969         }
05970 
05971         const char *filename = params["filename"];
05972         EMData *msk = new EMData();
05973         msk->read_image(filename);
05974         if (!EMUtil::is_same_size(image, msk)) {
05975                 LOGERR("IndexMaskFileProcessor: Mask size different than image");
05976                 return;
05977         }
05978 
05979         if ((int) params["ismaskset"] != 0) {
05980                 msk->process_inplace("threshold.binaryrange", Dict("low", 0.5f, "high", 1.5f));
05981         }
05982 
05983         image->mult(*msk);
05984         if( msk )
05985         {
05986                 delete msk;
05987                 msk = 0;
05988         }
05989 }


Member Data Documentation

const string IndexMaskFileProcessor::NAME = "mask.fromfile" [static]
 

Definition at line 175 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Mar 10 23:00:21 2011 for EMAN2 by  doxygen 1.3.9.1