#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 4321 of file processor.h.
|
Implements EMAN::NormalizeProcessor. Definition at line 3717 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. 03718 { 03719 if (!image) { 03720 LOGWARN("NULL Image"); 03721 return 0; 03722 } 03723 double sum = 0; 03724 int nx = image->get_xsize(); 03725 int ny = image->get_ysize(); 03726 int nz = image->get_zsize(); 03727 float *d = image->get_data(); 03728 size_t nyz = ny * nz; 03729 03730 for (size_t i = 0; i < nyz; i++) { 03731 size_t l = i * nx; 03732 size_t r = l + nx - 2; 03733 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03734 } 03735 float mean = (float) sum / (4 * nyz); 03736 return mean; 03737 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 4334 of file processor.h. 04335 { 04336 return "normalizes an image, uses 2 pixels on left and right edge"; 04337 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4324 of file processor.h. 04325 {
04326 return NAME;
04327 }
|
|
Definition at line 4329 of file processor.h. 04330 { 04331 return new NormalizeLREdgeMeanProcessor(); 04332 }
|
|
Definition at line 151 of file processor.cpp. |