EMAN::RangeThresholdProcessor Class Reference

f(x) = 1 if (low <= x <= high); else f(x) = 0 More...

#include <processor.h>

Inheritance diagram for EMAN::RangeThresholdProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RangeThresholdProcessor ()
string get_name () const
 Get the processor's name.
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.
string get_desc () const
 Get the descrition of this specific processor.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "threshold.binaryrange"

Protected Member Functions

void process_pixel (float *x) const

Private Attributes

float low
float high

Detailed Description

f(x) = 1 if (low <= x <= high); else f(x) = 0

Parameters:
low The lower limit of the range that will be set to 1
high The upper limit of the range that will be set to 1

Definition at line 2155 of file processor.h.


Constructor & Destructor Documentation

EMAN::RangeThresholdProcessor::RangeThresholdProcessor (  )  [inline]

Definition at line 2158 of file processor.h.

Referenced by NEW().

02158                                          :low(0), high(0)
02159                 {
02160                 }


Member Function Documentation

string EMAN::RangeThresholdProcessor::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 2186 of file processor.h.

02187                 {
02188                         return "Range thresholding. A range of values is set to 1, all else is set to 0. f(x) = 1 if (low <= x <= high); else f(x) = 0";
02189                 }

string EMAN::RangeThresholdProcessor::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 2162 of file processor.h.

References NAME.

02163                 {
02164                         return NAME;
02165                 }

TypeDict EMAN::RangeThresholdProcessor::get_param_types (  )  const [inline, virtual]

Get processor parameter information in a dictionary.

Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 2178 of file processor.h.

References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().

02179                 {
02180                         TypeDict d;
02181                         d.put("low", EMObject::FLOAT, "The lower limit of the range that will be set to 1");
02182                         d.put("high", EMObject::FLOAT, "The upper limit of the range that will be set to 1");
02183                         return d;
02184                 }

static Processor* EMAN::RangeThresholdProcessor::NEW (  )  [inline, static]

Definition at line 2166 of file processor.h.

References RangeThresholdProcessor().

02167                 {
02168                         return new RangeThresholdProcessor();
02169                 }

void EMAN::RangeThresholdProcessor::process_pixel ( float *  x  )  const [inline, protected, virtual]

Implements EMAN::RealPixelProcessor.

Definition at line 2194 of file processor.h.

References high, and low.

02195                 {
02196                         if (*x >= low && *x <= high) {
02197                                 *x = 1;
02198                         }
02199                         else {
02200                                 *x = 0;
02201                         }
02202                 }

void EMAN::RangeThresholdProcessor::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::RealPixelProcessor.

Definition at line 2171 of file processor.h.

References EMAN::Dict::get(), high, low, and EMAN::Processor::params.

02172                 {
02173                         params = new_params;
02174                         low = params.get("low");
02175                         high = params.get("high");
02176                 }


Member Data Documentation

float EMAN::RangeThresholdProcessor::high [private]

Definition at line 2205 of file processor.h.

Referenced by process_pixel(), and set_params().

float EMAN::RangeThresholdProcessor::low [private]

Definition at line 2204 of file processor.h.

Referenced by process_pixel(), and set_params().

const string RangeThresholdProcessor::NAME = "threshold.binaryrange" [static]

Definition at line 2191 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Mon Jul 19 12:43:17 2010 for EMAN2 by  doxygen 1.4.7