#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 | |
static Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "normalize.lredge" |
Protected Member Functions | |
float | calc_mean (EMData *image) const |
Definition at line 4287 of file processor.h.
float NormalizeLREdgeMeanProcessor::calc_mean | ( | EMData * | image | ) | const [protected, virtual] |
Implements EMAN::NormalizeProcessor.
Definition at line 3628 of file processor.cpp.
References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), and LOGWARN.
03629 { 03630 if (!image) { 03631 LOGWARN("NULL Image"); 03632 return 0; 03633 } 03634 double sum = 0; 03635 int nx = image->get_xsize(); 03636 int ny = image->get_ysize(); 03637 int nz = image->get_zsize(); 03638 float *d = image->get_data(); 03639 int nyz = ny * nz; 03640 03641 for (int i = 0; i < nyz; i++) { 03642 size_t l = i * nx; 03643 size_t r = l + nx - 2; 03644 sum += d[l] + d[l + 1] + d[r] + d[r + 1]; 03645 } 03646 float mean = (float) sum / (4 * nyz); 03647 return mean; 03648 }
string EMAN::NormalizeLREdgeMeanProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 4300 of file processor.h.
string EMAN::NormalizeLREdgeMeanProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 4290 of file processor.h.
References NAME.
04291 { 04292 return NAME; 04293 }
static Processor* EMAN::NormalizeLREdgeMeanProcessor::NEW | ( | ) | [inline, static] |
Definition at line 4295 of file processor.h.
04296 { 04297 return new NormalizeLREdgeMeanProcessor(); 04298 }
const string NormalizeLREdgeMeanProcessor::NAME = "normalize.lredge" [static] |