Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EMAN::NormalizeLREdgeMeanProcessor Class Reference

normalizes an image, uses 2 pixels on left and right edge More...

#include <processor.h>

Inheritance diagram for EMAN::NormalizeLREdgeMeanProcessor:

Inheritance graph
[legend]
Collaboration diagram for EMAN::NormalizeLREdgeMeanProcessor:

Collaboration graph
[legend]
List of all members.

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

ProcessorNEW ()

Static Public Attributes

const string NAME = "normalize.lredge"

Protected Member Functions

float calc_mean (EMData *image) const

Detailed Description

normalizes an image, uses 2 pixels on left and right edge

Definition at line 4368 of file processor.h.


Member Function Documentation

float NormalizeLREdgeMeanProcessor::calc_mean EMData image  )  const [protected, virtual]
 

Implements EMAN::NormalizeProcessor.

Definition at line 3795 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.

03796 {
03797         if (!image) {
03798                 LOGWARN("NULL Image");
03799                 return 0;
03800         }
03801         double sum = 0;
03802         int nx = image->get_xsize();
03803         int ny = image->get_ysize();
03804         int nz = image->get_zsize();
03805         float *d = image->get_data();
03806         size_t nyz = ny * nz;
03807 
03808         for (size_t i = 0; i < nyz; i++) {
03809                 size_t l = i * nx;
03810                 size_t r = l + nx - 2;
03811                 sum += d[l] + d[l + 1] + d[r] + d[r + 1];
03812         }
03813         float mean = (float) sum / (4 * nyz);
03814         return mean;
03815 }

string EMAN::NormalizeLREdgeMeanProcessor::get_desc  )  const [inline, virtual]
 

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

Returns:
The description of this processor.

Implements EMAN::Processor.

Definition at line 4381 of file processor.h.

04382                 {
04383                         return "normalizes an image, uses 2 pixels on left and right edge";
04384                 }

string EMAN::NormalizeLREdgeMeanProcessor::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 4371 of file processor.h.

04372                 {
04373                         return NAME;
04374                 }

Processor* EMAN::NormalizeLREdgeMeanProcessor::NEW  )  [inline, static]
 

Definition at line 4376 of file processor.h.

04377                 {
04378                         return new NormalizeLREdgeMeanProcessor();
04379                 }


Member Data Documentation

const string NormalizeLREdgeMeanProcessor::NAME = "normalize.lredge" [static]
 

Definition at line 151 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 13:42:34 2013 for EMAN2 by  doxygen 1.3.9.1