EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
EMAN::NormalizeUnitSumProcessor Class Reference

Normalize an image so its elements sum to 1.0 (fails if mean=0) More...

#include <processor.h>

Inheritance diagram for EMAN::NormalizeUnitSumProcessor:
Inheritance graph
[legend]
Collaboration diagram for EMAN::NormalizeUnitSumProcessor:
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.unitsum"

Protected Member Functions

float calc_sigma (EMData *image) const
float calc_mean (EMData *image) const

Detailed Description

Normalize an image so its elements sum to 1.0 (fails if mean=0)

Definition at line 4348 of file processor.h.


Member Function Documentation

float EMAN::NormalizeUnitSumProcessor::calc_mean ( EMData image) const [inline, protected, virtual]

Implements EMAN::NormalizeProcessor.

Definition at line 4373 of file processor.h.

{ return 0; }
float NormalizeUnitSumProcessor::calc_sigma ( EMData image) const [protected, virtual]

Reimplemented from EMAN::NormalizeProcessor.

Definition at line 3659 of file processor.cpp.

References EMAN::EMData::get_attr(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), and LOGWARN.

{
        if (!image) {
                LOGWARN("NULL Image");
                return 0;
        }
        float ret=(float)image->get_attr("mean")*image->get_xsize()*image->get_ysize()*image->get_zsize();
        return ret==0.0f?1.0f:ret;
}
string EMAN::NormalizeUnitSumProcessor::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 4361 of file processor.h.

                {
                        return "Normalize an image so its elements sum to 1.0 (fails if mean=0)";
                }
string EMAN::NormalizeUnitSumProcessor::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 4351 of file processor.h.

References NAME.

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

Definition at line 4356 of file processor.h.

                {
                        return new NormalizeUnitSumProcessor();
                }

Member Data Documentation

const string NormalizeUnitSumProcessor::NAME = "normalize.unitsum" [static]

Definition at line 4366 of file processor.h.

Referenced by get_name().


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