EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes
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:
Inheritance graph
[legend]
Collaboration diagram for EMAN::NSigmaClampingProcessor:
Collaboration graph
[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

static ProcessorNEW ()

Static Public Attributes

static 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:
nsigmaThe number (n) of sigmas to clamp min and max vals at, so that the clamped boundaries are mean-n*sigma and mean+n*sigma
tomeanReplace outlying pixels values with the mean pixel value instead

Definition at line 1884 of file processor.h.


Constructor & Destructor Documentation

EMAN::NSigmaClampingProcessor::NSigmaClampingProcessor ( ) [inline]

Definition at line 1887 of file processor.h.

Referenced by NEW().

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

                        {
                                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.";
                        }
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 1889 of file processor.h.

References NAME.

                        {
                                return NAME;
                        }
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 1899 of file processor.h.

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

                        {
                                TypeDict d;
                                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" );
                                d.put("tomean", EMObject::BOOL, "Replace outlying pixels values with the mean pixel value instead" );
                                d.put("tozero", EMObject::BOOL, "Replace outlying pixels values with zero" );
                                return d;
                        }
static Processor* EMAN::NSigmaClampingProcessor::NEW ( ) [inline, static]

Reimplemented from EMAN::ClampingProcessor.

Definition at line 1894 of file processor.h.

References NSigmaClampingProcessor().

                        {
                                return new NSigmaClampingProcessor();
                        }
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:
imageThe image to be processed.

Reimplemented from EMAN::ClampingProcessor.

Definition at line 10027 of file processor.cpp.

References EMAN::EMData::get_attr(), mean(), EMAN::Processor::params, EMAN::CutoffBlockProcessor::process_inplace(), EMAN::Dict::put(), and EMAN::Dict::set_default().

{
        float nsigma = params.set_default("nsigma",default_sigma);
        float sigma = image->get_attr("sigma");
        float mean = image->get_attr("mean");
        params.put("minval",mean - nsigma*sigma);
        params.put("maxval",mean + nsigma*sigma);

        ClampingProcessor::process_inplace(image);
}

Member Data Documentation

Definition at line 1918 of file processor.h.

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

Reimplemented from EMAN::ClampingProcessor.

Definition at line 1915 of file processor.h.

Referenced by get_name().


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