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

EMAN::BinarizeProcessor Class Reference

f(x) = 0 if x < value; f(x) = 1 if x >= value. More...

#include <processor.h>

Inheritance diagram for EMAN::BinarizeProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

string get_name () const
 Get the processor's name.
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.binary"

Protected Member Functions

void process_pixel (float *x) const

Detailed Description

f(x) = 0 if x < value; f(x) = 1 if x >= value.

Parameters:
value The thresholding value. If a pixel value is equal to or above the threshold it is set to 1. If it is below it is set to 0

Definition at line 1824 of file processor.h.


Member Function Documentation

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

01843                 {
01844                         return "f(x) = 0 if x < value; f(x) = 1 if x >= value.";
01845                 }

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

01828                 {
01829                         return NAME;
01830                 }

TypeDict EMAN::BinarizeProcessor::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 1835 of file processor.h.

References EMAN::TypeDict::put().

01836                 {
01837                         TypeDict d;
01838                         d.put("value", EMObject::FLOAT, "The thresholding value. If a pixel value is equal to or above the threshold it is set to 1. If it is below it is set to 0" );
01839                         return d;
01840                 }

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

Definition at line 1831 of file processor.h.

01832                 {
01833                         return new BinarizeProcessor();
01834                 }

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

Implements EMAN::RealPixelProcessor.

Definition at line 1850 of file processor.h.

References x.

01851                 {
01852                         if (*x < value)
01853                         {
01854                                 *x = 0;
01855                         }
01856                         else
01857                         {
01858                                 *x = 1;
01859                         }
01860                 }


Member Data Documentation

const string BinarizeProcessor::NAME = "threshold.binary" [static]
 

Definition at line 100 of file processor.cpp.


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