#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 3877 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 3891 of file processor.h.
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3881 of file processor.h. References NAME. 03882 { 03883 return NAME; 03884 }
|
|
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 3896 of file processor.h. References EMAN::EMObject::INT, and EMAN::TypeDict::put(). 03897 { 03898 TypeDict d; 03899 d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels"); 03900 return d; 03901 }
|
|
Definition at line 3886 of file processor.h. 03887 { 03888 return new DecayEdgeProcessor(); 03889 }
|
|
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 3262 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(). 03263 { 03264 if (!image) { 03265 LOGWARN("NULL Image"); 03266 return; 03267 } 03268 03269 if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported"); 03270 03271 int nx = image->get_xsize(); 03272 int ny = image->get_ysize(); 03273 03274 float *d = image->get_data(); 03275 int width = params["width"]; 03276 03277 for (int i=0; i<width; i++) { 03278 float frac=i/(float)width; 03279 for (int j=0; j<nx; j++) { 03280 d[j+i*nx]*=frac; 03281 d[nx*ny-j-i*nx-1]*=frac; 03282 } 03283 for (int j=0; j<ny; j++) { 03284 d[j*nx+i]*=frac; 03285 d[nx*ny-j*nx-i-1]*=frac; 03286 } 03287 } 03288 03289 image->update(); 03290 }
|
|
Definition at line 3903 of file processor.h. Referenced by get_name(). |