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

static ProcessorNEW ()

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


Member Function Documentation

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

01645                 {
01646                         return "threshold.binary";
01647                 }

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

Definition at line 1648 of file processor.h.

01649                 {
01650                         return new BinarizeProcessor();
01651                 }

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

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

01653                 {
01654                         TypeDict d;
01655                         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" );
01656                         return d;
01657                 }

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

01660                 {
01661                         return "f(x) = 0 if x < value; f(x) = 1 if x >= value.";
01662                 }

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

Implements EMAN::RealPixelProcessor.

Definition at line 1665 of file processor.h.

References EMAN::RealPixelProcessor::value.

01666                 {
01667                         if (*x < value)
01668                         {
01669                                 *x = 0;
01670                         }
01671                         else
01672                         {
01673                                 *x = 1;
01674                         }
01675                 }


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

Generated on Sat Nov 21 02:20:26 2009 for EMAN2 by  doxygen 1.5.6