#include <processor.h>
Inheritance diagram for EMAN::NSigmaClampingProcessor:
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 Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "threshold.clampminmax.nsigma" |
Protected Attributes | |
float | default_sigma |
The parameter specified by the user is n, the default value of n is 2.
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 1709 of file processor.h.
EMAN::NSigmaClampingProcessor::NSigmaClampingProcessor | ( | ) | [inline] |
string EMAN::NSigmaClampingProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Reimplemented from EMAN::ClampingProcessor.
Definition at line 1734 of file processor.h.
01735 { 01736 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."; 01737 }
string EMAN::NSigmaClampingProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Reimplemented from EMAN::ClampingProcessor.
Definition at line 1714 of file processor.h.
References NAME.
01715 { 01716 return NAME; 01717 }
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.
Reimplemented from EMAN::ClampingProcessor.
Definition at line 1724 of file processor.h.
References EMAN::EMObject::BOOL, EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
01725 { 01726 TypeDict d; 01727 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" ); 01728 d.put("tomean", EMObject::BOOL, "Replace outlying pixels values with the mean pixel value instead" ); 01729 return d; 01730 }
static Processor* EMAN::NSigmaClampingProcessor::NEW | ( | ) | [inline, static] |
Reimplemented from EMAN::ClampingProcessor.
Definition at line 1719 of file processor.h.
References NSigmaClampingProcessor().
01720 { 01721 return new NSigmaClampingProcessor(); 01722 }
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.
image | The image to be processed. |
Reimplemented from EMAN::ClampingProcessor.
Definition at line 9157 of file processor.cpp.
References default_sigma, EMAN::EMData::get_attr(), mean(), EMAN::Processor::params, process_inplace(), and EMAN::Dict::set_default().
09158 { 09159 float nsigma = params.set_default("nsigma",default_sigma); 09160 float sigma = image->get_attr("sigma"); 09161 float mean = image->get_attr("mean"); 09162 params.set_default("minval",mean - nsigma*sigma); 09163 params.set_default("maxval",mean + nsigma*sigma); 09164 09165 ClampingProcessor::process_inplace(image); 09166 }
float EMAN::NSigmaClampingProcessor::default_sigma [protected] |
const string NSigmaClampingProcessor::NAME = "threshold.clampminmax.nsigma" [static] |
Reimplemented from EMAN::ClampingProcessor.
Definition at line 1739 of file processor.h.
Referenced by get_name().