#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 4290 of file processor.h.
|
Implements EMAN::NormalizeProcessor. Definition at line 3702 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. 03703 { 03704 if (!image) { 03705 LOGWARN("NULL Image"); 03706 return 0; 03707 } 03708 double sum = 0; 03709 int nx = image->get_xsize(); 03710 int ny = image->get_ysize(); 03711 int nz = image->get_zsize(); 03712 float *d = image->get_data(); 03713 size_t nyz = ny * nz; 03714 03715 for (size_t i = 0; i < nyz; i++) { 03716 size_t l = i * nx; 03717 size_t r = l + nx - 2; 03718 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03719 } 03720 float mean = (float) sum / (4 * nyz); 03721 return mean; 03722 }
|
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
Implements EMAN::Processor. Definition at line 4303 of file processor.h. 04304 { 04305 return "normalizes an image, uses 2 pixels on left and right edge"; 04306 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 4293 of file processor.h. 04294 {
04295 return NAME;
04296 }
|
|
Definition at line 4298 of file processor.h. 04299 { 04300 return new NormalizeLREdgeMeanProcessor(); 04301 }
|
|
Definition at line 156 of file processor.cpp. |