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

EMAN::NSigmaClampingProcessor Class Reference

This function clamps the min and max vals in the image at minval and maxval at mean-n*sigma and mean+n*sigma, respectively. More...

#include <processor.h>

Inheritance diagram for EMAN::NSigmaClampingProcessor:

[legend]
Collaboration diagram for EMAN::NSigmaClampingProcessor:
[legend]
List of all members.

Public Member Functions

 NSigmaClampingProcessor ()
string get_name () const
 Get the processor's name.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.
void process_inplace (EMData *image)
 To process an image in-place.
string get_desc () const
 Get the descrition of this specific processor.

Static Public Member Functions

ProcessorNEW ()

Static Public Attributes

const string NAME = "threshold.clampminmax.nsigma"

Protected Attributes

float default_sigma

Detailed Description

This function clamps the min and max vals in the image at minval and maxval at mean-n*sigma and mean+n*sigma, respectively.

The parameter specified by the user is n, the default value of n is 2.

Parameters:
nsigma The number (n) of sigmas to clamp min and max vals at, so that the clamped boundaries are mean-n*sigma and mean+n*sigma
tomean Replace outlying pixels values with the mean pixel value instead

Definition at line 1700 of file processor.h.


Constructor & Destructor Documentation

EMAN::NSigmaClampingProcessor::NSigmaClampingProcessor  )  [inline]
 

Definition at line 1703 of file processor.h.

01703 : default_sigma(2.0) {}


Member Function Documentation

string EMAN::NSigmaClampingProcessor::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.

Reimplemented from EMAN::ClampingProcessor.

Definition at line 1725 of file processor.h.

01726                         {
01727                                 return "This function clamps the min and max vals in the image at minval and maxval at mean-n*sigma and mean+n*sigma, respectively. The parameter specified by the user is n, the default value of n is 2.";
01728                         }

string EMAN::NSigmaClampingProcessor::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Reimplemented from EMAN::ClampingProcessor.

Definition at line 1705 of file processor.h.

01706                         {
01707                                 return NAME;
01708                         }

TypeDict EMAN::NSigmaClampingProcessor::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::ClampingProcessor.

Definition at line 1715 of file processor.h.

References EMAN::TypeDict::put().

01716                         {
01717                                 TypeDict d;
01718                                 d.put("nsigma", EMObject::FLOAT, "The number (n) of sigmas to clamp min and max vals at, so that the clamped boundaries are mean-n*sigma and mean+n*sigma" );
01719                                 d.put("tomean", EMObject::BOOL, "Replace outlying pixels values with the mean pixel value instead" );
01720                                 return d;
01721                         }

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

Reimplemented from EMAN::ClampingProcessor.

Definition at line 1710 of file processor.h.

01711                         {
01712                                 return new NSigmaClampingProcessor();
01713                         }

void NSigmaClampingProcessor::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.

Reimplemented from EMAN::ClampingProcessor.

Definition at line 9032 of file processor.cpp.

References default_sigma, EMAN::EMData::get_attr(), process_inplace(), and EMAN::Dict::set_default().

09033 {
09034         float nsigma = params.set_default("nsigma",default_sigma);
09035         float sigma = image->get_attr("sigma");
09036         float mean = image->get_attr("mean");
09037         params.set_default("minval",mean - nsigma*sigma);
09038         params.set_default("maxval",mean + nsigma*sigma);
09039 
09040         ClampingProcessor::process_inplace(image);
09041 }


Member Data Documentation

float EMAN::NSigmaClampingProcessor::default_sigma [protected]
 

Definition at line 1733 of file processor.h.

Referenced by process_inplace().

const string NSigmaClampingProcessor::NAME = "threshold.clampminmax.nsigma" [static]
 

Reimplemented from EMAN::ClampingProcessor.

Definition at line 92 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Apr 30 15:39:20 2010 for EMAN2 by  doxygen 1.3.9.1