#include <processor.h>
Inheritance diagram for EMAN::LinearPyramidProcessor:
Public Member Functions | |
string | get_name () const |
Get the processor's name. | |
void | process_inplace (EMData *image) |
To process an image in-place. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "math.linearpyramid" |
Definition at line 2518 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 2533 of file processor.h. 02534 { 02535 return "Multiplies image by a 'linear pyramid', 1-(|x-xsize/2|*|y-ysize/2|*4/(xsize*ysize))"; 02536 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2521 of file processor.h. 02522 {
02523 return NAME;
02524 }
|
|
Definition at line 2528 of file processor.h. 02529 { 02530 return new LinearPyramidProcessor(); 02531 }
|
|
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 994 of file processor.cpp. References abs, EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), ImageDimensionException, nx, ny, EMAN::EMData::update(), x, and y. 00994 { 00995 00996 if (image->get_zsize()!=1) { throw ImageDimensionException("Only 2-D images supported"); } 00997 00998 float *d=image->get_data(); 00999 int nx=image->get_xsize(); 01000 int ny=image->get_ysize(); 01001 01002 for (int y=0; y<ny; y++) { 01003 for (int x=0; x<nx; x++) { 01004 int l=x+y*nx; 01005 d[l]*=1.0f-abs(x-nx/2)*abs(y-ny/2)*4.0f/(nx*ny); 01006 } 01007 } 01008 image->update(); 01009 }
|
|
Definition at line 105 of file processor.cpp. |