EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
EMAN::DecayEdgeProcessor Class Reference

Decay edges of image to zero. More...

#include <processor.h>

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

List of all members.

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place.
string get_name () const
 Get the processor's name.
string get_desc () const
 Get the descrition of this specific processor.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "mask.decayedge2d"

Detailed Description

Decay edges of image to zero.

Parameters:
widthWidth of the decay region around the edge of the image in pixels

Definition at line 4152 of file processor.h.


Member Function Documentation

string EMAN::DecayEdgeProcessor::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 4166 of file processor.h.

                {
                        return "Decay edges of image to zero";
                }
string EMAN::DecayEdgeProcessor::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 4156 of file processor.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::DecayEdgeProcessor::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 4171 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels");
                        return d;
                }
static Processor* EMAN::DecayEdgeProcessor::NEW ( ) [inline, static]

Definition at line 4161 of file processor.h.

                {
                        return new DecayEdgeProcessor();
                }
void DecayEdgeProcessor::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 3496 of file processor.cpp.

References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), ImageDimensionException, LOGWARN, nx, ny, EMAN::Processor::params, and EMAN::EMData::update().

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

        if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported");

        int nx = image->get_xsize();
        int ny = image->get_ysize();

        float *d = image->get_data();
        int width = params["width"];

        for (int i=0; i<width; i++) {
                float frac=i/(float)width;
                for (int j=0; j<nx; j++) {
                        d[j+i*nx]*=frac;
                        d[nx*ny-j-i*nx-1]*=frac;
                }
                for (int j=0; j<ny; j++) {
                        d[j*nx+i]*=frac;
                        d[nx*ny-j*nx-i-1]*=frac;
                }
        }

        image->update();
}

Member Data Documentation

const string DecayEdgeProcessor::NAME = "mask.decayedge2d" [static]

Definition at line 4178 of file processor.h.

Referenced by get_name().


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