#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 4111 of file processor.h.
|
Implements EMAN::NormalizeProcessor. Definition at line 3583 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. 03584 { 03585 if (!image) { 03586 LOGWARN("NULL Image"); 03587 return 0; 03588 } 03589 double sum = 0; 03590 int nx = image->get_xsize(); 03591 int ny = image->get_ysize(); 03592 int nz = image->get_zsize(); 03593 float *d = image->get_data(); 03594 int nyz = ny * nz; 03595 03596 for (int i = 0; i < nyz; i++) { 03597 size_t l = i * nx; 03598 size_t r = l + nx - 2; 03599 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03600 } 03601 float mean = (float) sum / (4 * nyz); 03602 return mean; 03603 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 4124 of file processor.h. 04125 { 04126 return "normalizes an image, uses 2 pixels on left and right edge"; 04127 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4114 of file processor.h. 04115 {
04116 return NAME;
04117 }
|
|
Definition at line 4119 of file processor.h. 04120 { 04121 return new NormalizeLREdgeMeanProcessor(); 04122 }
|
|
Definition at line 145 of file processor.cpp. |