#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 3958 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 3972 of file processor.h. 03973 { 03974 return "Decay edges of image to zero"; 03975 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 3962 of file processor.h. 03963 {
03964 return NAME;
03965 }
|
|
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 3977 of file processor.h. References EMAN::TypeDict::put(). 03978 { 03979 TypeDict d; 03980 d.put("width", EMObject::INT, "Width of the decay region around the edge of the image in pixels"); 03981 return d; 03982 }
|
|
Definition at line 3967 of file processor.h. 03968 { 03969 return new DecayEdgeProcessor(); 03970 }
|
|
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 3434 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(). 03435 { 03436 if (!image) { 03437 LOGWARN("NULL Image"); 03438 return; 03439 } 03440 03441 if (image->get_zsize() > 1) throw ImageDimensionException("3D model not supported"); 03442 03443 int nx = image->get_xsize(); 03444 int ny = image->get_ysize(); 03445 03446 float *d = image->get_data(); 03447 int width = params["width"]; 03448 03449 for (int i=0; i<width; i++) { 03450 float frac=i/(float)width; 03451 for (int j=0; j<nx; j++) { 03452 d[j+i*nx]*=frac; 03453 d[nx*ny-j-i*nx-1]*=frac; 03454 } 03455 for (int j=0; j<ny; j++) { 03456 d[j*nx+i]*=frac; 03457 d[nx*ny-j*nx-i-1]*=frac; 03458 } 03459 } 03460 03461 image->update(); 03462 }
|
|
Definition at line 139 of file processor.cpp. |