#include <processor.h>
Inheritance diagram for EMAN::NormalizeLREdgeMeanProcessor:
Public Member Functions | |
string | get_name () const |
Get the processor's name. | |
string | get_desc () const |
Get the descrition of this specific processor. | |
Static Public Member Functions | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "normalize.lredge" |
Protected Member Functions | |
float | calc_mean (EMData *image) const |
Definition at line 4252 of file processor.h.
|
Implements EMAN::NormalizeProcessor. Definition at line 3674 of file processor.cpp. References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, nx, and ny. 03675 { 03676 if (!image) { 03677 LOGWARN("NULL Image"); 03678 return 0; 03679 } 03680 double sum = 0; 03681 int nx = image->get_xsize(); 03682 int ny = image->get_ysize(); 03683 int nz = image->get_zsize(); 03684 float *d = image->get_data(); 03685 size_t nyz = ny * nz; 03686 03687 for (size_t i = 0; i < nyz; i++) { 03688 size_t l = i * nx; 03689 size_t r = l + nx - 2; 03690 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03691 } 03692 float mean = (float) sum / (4 * nyz); 03693 return mean; 03694 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 4265 of file processor.h. 04266 { 04267 return "normalizes an image, uses 2 pixels on left and right edge"; 04268 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4255 of file processor.h. 04256 {
04257 return NAME;
04258 }
|
|
Definition at line 4260 of file processor.h. 04261 { 04262 return new NormalizeLREdgeMeanProcessor(); 04263 }
|
|
Definition at line 150 of file processor.cpp. |