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

EMAN::RealPixelProcessor Class Reference

The base class for real space processor working on individual pixels. More...

#include <processor.h>

Inheritance diagram for EMAN::RealPixelProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RealPixelProcessor ()
void process_inplace (EMData *image)
 To process an image in-place.
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.

Static Public Member Functions

string get_group_desc ()
 Get the description of this group of processors.

Protected Member Functions

virtual void process_pixel (float *x) const =0
virtual void calc_locals (EMData *)
virtual void normalize (EMData *) const

Protected Attributes

float value
float maxval
float mean
float sigma

Detailed Description

The base class for real space processor working on individual pixels.

The processor won't consider the pixel's coordinates and neighbors.

Definition at line 1121 of file processor.h.


Constructor & Destructor Documentation

EMAN::RealPixelProcessor::RealPixelProcessor  )  [inline]
 

Definition at line 1124 of file processor.h.

01124                                     :value(0), maxval(1), mean(0), sigma(0)
01125                 {
01126                 }


Member Function Documentation

virtual void EMAN::RealPixelProcessor::calc_locals EMData  )  [inline, protected, virtual]
 

Definition at line 1145 of file processor.h.

Referenced by process_inplace().

01146                 {
01147                 }

string EMAN::RealPixelProcessor::get_group_desc  )  [inline, static]
 

Get the description of this group of processors.

This function is defined in a parent class. It gives a introduction to a group of processors.

Returns:
The description of this group of processors.

Reimplemented from EMAN::Processor.

Definition at line 1138 of file processor.h.

01139                 {
01140                         return "The base class for real space processor working on individual pixels. The processor won't consider the pixel's coordinates and neighbors.";
01141                 }

virtual void EMAN::RealPixelProcessor::normalize EMData  )  const [inline, protected, virtual]
 

Definition at line 1148 of file processor.h.

01149                 {
01150                 }

void RealPixelProcessor::process_inplace EMData image  )  [virtual]
 

To process an image in-place.

For those processors which can only be processed out-of-place, override this function to just print out some error message to remind user call the out-of-place version.

Parameters:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 1221 of file processor.cpp.

References calc_locals(), data, EMAN::EMData::get_attr(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), LOGWARN, maxval, mean, process_pixel(), sigma, and EMAN::EMData::update().

01222 {
01223         if (!image) {
01224                 LOGWARN("NULL Image");
01225                 return;
01226         }
01227 
01228         maxval = image->get_attr("maximum");
01229         mean = image->get_attr("mean");
01230         sigma = image->get_attr("sigma");
01231 
01232         calc_locals(image);
01233 
01234         size_t size = (size_t)image->get_xsize() *
01235                           (size_t)image->get_ysize() *
01236                           (size_t)image->get_zsize();
01237         float *data = image->get_data();
01238 
01239         for (size_t i = 0; i < size; ++i) {
01240                 process_pixel(&data[i]);
01241         }
01242         image->update();
01243 }

virtual void EMAN::RealPixelProcessor::process_pixel float *  x  )  const [protected, pure virtual]
 

Implemented in EMAN::AbsoluateValueProcessor, EMAN::FloorValueProcessor, EMAN::BooleanProcessor, EMAN::InvertCarefullyProcessor, EMAN::ValuePowProcessor, EMAN::ValueSquaredProcessor, EMAN::ValueSqrtProcessor, EMAN::ToZeroProcessor, EMAN::CutToZeroProcessor, EMAN::BinarizeProcessor, EMAN::CollapseProcessor, EMAN::LinearXformProcessor, EMAN::ExpProcessor, EMAN::FiniteProcessor, EMAN::RangeThresholdProcessor, EMAN::SigmaProcessor, and EMAN::LogProcessor.

Referenced by process_inplace().

virtual void EMAN::RealPixelProcessor::set_params const Dict new_params  )  [inline, virtual]
 

Set the processor parameters using a key/value dictionary.

Parameters:
new_params A dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Reimplemented in EMAN::InvertCarefullyProcessor, EMAN::ValuePowProcessor, EMAN::CollapseProcessor, EMAN::LinearXformProcessor, EMAN::ExpProcessor, EMAN::FiniteProcessor, EMAN::RangeThresholdProcessor, and EMAN::SigmaProcessor.

Definition at line 1129 of file processor.h.

References EMAN::Dict::values().

01130                 {
01131                         params = new_params;
01132                         if (params.size() == 1) {
01133                                 vector < EMObject > dict_values = params.values();
01134                                 value = dict_values[0];
01135                         }
01136                 }


Member Data Documentation

float EMAN::RealPixelProcessor::maxval [protected]
 

Definition at line 1153 of file processor.h.

Referenced by process_inplace().

float EMAN::RealPixelProcessor::mean [protected]
 

Definition at line 1154 of file processor.h.

Referenced by process_inplace().

float EMAN::RealPixelProcessor::sigma [protected]
 

Definition at line 1155 of file processor.h.

Referenced by process_inplace().

float EMAN::RealPixelProcessor::value [protected]
 

Definition at line 1152 of file processor.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 17 12:45:52 2011 for EMAN2 by  doxygen 1.3.9.1