EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
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

static ProcessorNEW ()

Static Public Attributes

static 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:
filenamemask image file name
ismasksetIf set to 1, it will take a file containing a set of masks and apply the first mask to the image

Definition at line 5792 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 5815 of file processor.h.

                {
                        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.";
                }
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 5797 of file processor.h.

References NAME.

                {
                        return NAME;
                }
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 5807 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("filename", EMObject::STRING, "mask image file name");
                        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");
                        return d;
                }
static Processor* EMAN::IndexMaskFileProcessor::NEW ( ) [inline, static]

Definition at line 5802 of file processor.h.

                {
                        return new IndexMaskFileProcessor();
                }
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:
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 6567 of file processor.cpp.

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

{
        if (!image) {
                LOGWARN("NULL Image");
                return;
        }

        const char *filename = params["filename"];
        EMData *msk = new EMData();
        msk->read_image(filename);
        if (!EMUtil::is_same_size(image, msk)) {
                LOGERR("IndexMaskFileProcessor: Mask size different than image");
                return;
        }

        if ((int) params["ismaskset"] != 0) {
                msk->process_inplace("threshold.binaryrange", Dict("low", 0.5f, "high", 1.5f));
        }

        image->mult(*msk);
        if( msk )
        {
                delete msk;
                msk = 0;
        }
}

Member Data Documentation

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

Definition at line 5820 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: