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

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

ProcessorNEW ()

Static Public Attributes

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


Constructor & Destructor Documentation

EMAN::RangeThresholdProcessor::RangeThresholdProcessor  )  [inline]
 

Definition at line 2121 of file processor.h.

02121                                          :low(0), high(0)
02122                 {
02123                 }


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

02150                 {
02151                         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";
02152                 }

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

02126                 {
02127                         return NAME;
02128                 }

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

References EMAN::TypeDict::put().

02142                 {
02143                         TypeDict d;
02144                         d.put("low", EMObject::FLOAT, "The lower limit of the range that will be set to 1");
02145                         d.put("high", EMObject::FLOAT, "The upper limit of the range that will be set to 1");
02146                         return d;
02147                 }

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

Definition at line 2129 of file processor.h.

02130                 {
02131                         return new RangeThresholdProcessor();
02132                 }

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

Implements EMAN::RealPixelProcessor.

Definition at line 2157 of file processor.h.

References x.

02158                 {
02159                         if (*x >= low && *x <= high) {
02160                                 *x = 1;
02161                         }
02162                         else {
02163                                 *x = 0;
02164                         }
02165                 }

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

References EMAN::Dict::get().

02135                 {
02136                         params = new_params;
02137                         low = params.get("low");
02138                         high = params.get("high");
02139                 }


Member Data Documentation

float EMAN::RangeThresholdProcessor::high [private]
 

Definition at line 2168 of file processor.h.

float EMAN::RangeThresholdProcessor::low [private]
 

Definition at line 2167 of file processor.h.

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

Definition at line 107 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 12 13:50:59 2011 for EMAN2 by  doxygen 1.3.9.1