#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 2697 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 2712 of file processor.h. 02713 { 02714 return "Multiplies image by a 'linear pyramid', 1-(|x-xsize/2|*|y-ysize/2|*4/(xsize*ysize))"; 02715 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 2700 of file processor.h. 02701 {
02702 return NAME;
02703 }
|
|
Definition at line 2707 of file processor.h. 02708 { 02709 return new LinearPyramidProcessor(); 02710 }
|
|
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 1090 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. 01090 { 01091 01092 if (image->get_zsize()!=1) { throw ImageDimensionException("Only 2-D images supported"); } 01093 01094 float *d=image->get_data(); 01095 int nx=image->get_xsize(); 01096 int ny=image->get_ysize(); 01097 01098 for (int y=0; y<ny; y++) { 01099 for (int x=0; x<nx; x++) { 01100 int l=x+y*nx; 01101 d[l]*=1.0f-abs(x-nx/2)*abs(y-ny/2)*4.0f/(nx*ny); 01102 } 01103 } 01104 image->update(); 01105 }
|
|
Definition at line 116 of file processor.cpp. |