#include <processor.h>
Inheritance diagram for EMAN::DecayEdgeProcessor:
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 Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "mask.decayedge2d" |
width | Width of the decay region around the edge of the image in pixels |
Definition at line 3956 of file processor.h.
string EMAN::DecayEdgeProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 3970 of file processor.h.
string EMAN::DecayEdgeProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 3960 of file processor.h.
References NAME.
03961 { 03962 return NAME; 03963 }
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.
Reimplemented from EMAN::Processor.
Definition at line 3975 of file processor.h.
References EMAN::EMObject::INT, and EMAN::TypeDict::put().
03976 { 03977 TypeDict d; 03978 d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels"); 03979 return d; 03980 }
static Processor* EMAN::DecayEdgeProcessor::NEW | ( | ) | [inline, static] |
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.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 3432 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().
03433 { 03434 if (!image) { 03435 LOGWARN("NULL Image"); 03436 return; 03437 } 03438 03439 if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported"); 03440 03441 int nx = image->get_xsize(); 03442 int ny = image->get_ysize(); 03443 03444 float *d = image->get_data(); 03445 int width = params["width"]; 03446 03447 for (int i=0; i<width; i++) { 03448 float frac=i/(float)width; 03449 for (int j=0; j<nx; j++) { 03450 d[j+i*nx]*=frac; 03451 d[nx*ny-j-i*nx-1]*=frac; 03452 } 03453 for (int j=0; j<ny; j++) { 03454 d[j*nx+i]*=frac; 03455 d[nx*ny-j*nx-i-1]*=frac; 03456 } 03457 } 03458 03459 image->update(); 03460 }
const string DecayEdgeProcessor::NAME = "mask.decayedge2d" [static] |