#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 | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "mask.decayedge2d" |
width | Width of the decay region around the edge of the image in pixels |
Definition at line 3911 of file processor.h.
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 3925 of file processor.h. 03926 { 03927 return "Decay edges of image to zero"; 03928 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3915 of file processor.h. 03916 {
03917 return NAME;
03918 }
|
|
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 3930 of file processor.h. References EMAN::TypeDict::put(). 03931 { 03932 TypeDict d; 03933 d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels"); 03934 return d; 03935 }
|
|
Definition at line 3920 of file processor.h. 03921 { 03922 return new DecayEdgeProcessor(); 03923 }
|
|
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.
Implements EMAN::Processor. Definition at line 3356 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, and EMAN::EMData::update(). 03357 { 03358 if (!image) { 03359 LOGWARN("NULL Image"); 03360 return; 03361 } 03362 03363 if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported"); 03364 03365 int nx = image->get_xsize(); 03366 int ny = image->get_ysize(); 03367 03368 float *d = image->get_data(); 03369 int width = params["width"]; 03370 03371 for (int i=0; i<width; i++) { 03372 float frac=i/(float)width; 03373 for (int j=0; j<nx; j++) { 03374 d[j+i*nx]*=frac; 03375 d[nx*ny-j-i*nx-1]*=frac; 03376 } 03377 for (int j=0; j<ny; j++) { 03378 d[j*nx+i]*=frac; 03379 d[nx*ny-j*nx-i-1]*=frac; 03380 } 03381 } 03382 03383 image->update(); 03384 }
|
|
Definition at line 139 of file processor.cpp. |