#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 2603 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 2618 of file processor.h. 02619 { 02620 return "Multiplies image by a 'linear pyramid', 1-(|x-xsize/2|*|y-ysize/2|*4/(xsize*ysize))"; 02621 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2606 of file processor.h. 02607 {
02608 return NAME;
02609 }
|
|
Definition at line 2613 of file processor.h. 02614 { 02615 return new LinearPyramidProcessor(); 02616 }
|
|
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 1056 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. 01056 { 01057 01058 if (image->get_zsize()!=1) { throw ImageDimensionException("Only 2-D images supported"); } 01059 01060 float *d=image->get_data(); 01061 int nx=image->get_xsize(); 01062 int ny=image->get_ysize(); 01063 01064 for (int y=0; y<ny; y++) { 01065 for (int x=0; x<nx; x++) { 01066 int l=x+y*nx; 01067 d[l]*=1.0f-abs(x-nx/2)*abs(y-ny/2)*4.0f/(nx*ny); 01068 } 01069 } 01070 image->update(); 01071 }
|
|
Definition at line 108 of file processor.cpp. |