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

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:
width Width of the decay region around the edge of the image in pixels

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

03932                 {
03933                         return "Decay edges of image to zero";
03934                 }

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 3921 of file processor.h.

References NAME.

03922                 {
03923                         return NAME;
03924                 }

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 3936 of file processor.h.

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

03937                 {
03938                         TypeDict d;
03939                         d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels");
03940                         return d;
03941                 }

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

Definition at line 3926 of file processor.h.

03927                 {
03928                         return new DecayEdgeProcessor();
03929                 }

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:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 3369 of file processor.cpp.

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

03370 {
03371         if (!image) {
03372                 LOGWARN("NULL Image");
03373                 return;
03374         }
03375 
03376         if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported");
03377 
03378         int nx = image->get_xsize();
03379         int ny = image->get_ysize();
03380 
03381         float *d = image->get_data();
03382         int width = params["width"];
03383 
03384         for (int i=0; i<width; i++) {
03385                 float frac=i/(float)width;
03386                 for (int j=0; j<nx; j++) {
03387                         d[j+i*nx]*=frac;
03388                         d[nx*ny-j-i*nx-1]*=frac;
03389                 }
03390                 for (int j=0; j<ny; j++) {
03391                         d[j*nx+i]*=frac;
03392                         d[nx*ny-j*nx-i-1]*=frac;
03393                 }
03394         }
03395 
03396         image->update();
03397 }


Member Data Documentation

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

Definition at line 3943 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Mon Jul 19 13:06:58 2010 for EMAN2 by  doxygen 1.4.4