EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
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

static ProcessorNEW ()

Static Public Attributes

static 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 4570 of file processor.h.


Member Function Documentation

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

Implements EMAN::NormalizeProcessor.

Definition at line 3905 of file processor.cpp.

References EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, mean(), and nx.

{
        if (!image) {
                LOGWARN("NULL Image");
                return 0;
        }
        double sum = 0;
        int nx = image->get_xsize();
        int ny = image->get_ysize();
        int nz = image->get_zsize();
        float *d = image->get_data();
        size_t nyz = ny * nz;

        for (size_t i = 0; i < nyz; i++) {
                size_t l = i * nx;
                size_t r = l + nx - 2;
                sum += d[l] + d[l + 1] + d[r] + d[r + 1];
        }
        float mean = (float) sum / (4 * nyz);
        return mean;
}
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 4583 of file processor.h.

                {
                        return "normalizes an image, uses 2 pixels on left and right edge";
                }
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 4573 of file processor.h.

References NAME.

                {
                        return NAME;
                }
static Processor* EMAN::NormalizeLREdgeMeanProcessor::NEW ( ) [inline, static]

Definition at line 4578 of file processor.h.

                {
                        return new NormalizeLREdgeMeanProcessor();
                }

Member Data Documentation

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

Definition at line 4588 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: