EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
EMAN::MaskGaussProcessor Class Reference

a gaussian falloff to zero, radius is the 1/e of the width. More...

#include <processor.h>

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

List of all members.

Public Member Functions

string get_name () const
 Get the processor's name.
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
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 ()

Static Public Attributes

static const string NAME = "mask.gaussian"

Protected Member Functions

void process_dist_pixel (float *pixel, float dist) const

Protected Attributes

float exponent

Detailed Description

a gaussian falloff to zero, radius is the 1/e of the width.

Definition at line 2748 of file processor.h.


Member Function Documentation

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

Definition at line 2776 of file processor.h.

                {
                        return "a gaussian falloff to zero, radius is the 1/e of the width. If inner_radius>0, then \
outer radius specifies width of Gaussian starting at inner_radius rather than total radius.";
                }
string EMAN::MaskGaussProcessor::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 2751 of file processor.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::MaskGaussProcessor::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::CircularMaskProcessor.

Definition at line 2769 of file processor.h.

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

                {
                        TypeDict d = CircularMaskProcessor::get_param_types();
                        d.put("exponent", EMObject::FLOAT, "The exponent, f in e^-Bs^f. default 2.0, producing a Gaussian");
                        return d;
                }
static Processor* EMAN::MaskGaussProcessor::NEW ( ) [inline, static]

Definition at line 2755 of file processor.h.

                {
                        return new MaskGaussProcessor();
                }
void EMAN::MaskGaussProcessor::process_dist_pixel ( float *  pixel,
float  dist 
) const [inline, protected, virtual]

Implements EMAN::CircularMaskProcessor.

Definition at line 2786 of file processor.h.

References exponent, EMAN::CircularMaskProcessor::inner_radius, EMAN::CircularMaskProcessor::inner_radius_square, EMAN::CircularMaskProcessor::outer_radius_square, and sqrt().

                {
                        if (inner_radius_square>0) {
                                if (dist>inner_radius_square) {
                                        if (exponent==2.0f) (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,2.0f) / outer_radius_square);
                                        else (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,exponent) / pow((float)outer_radius_square,exponent/2.0f));
                                }
                        }
                        else {
                                if (exponent==2.0f) (*pixel) *= exp(-dist / outer_radius_square);
                                else (*pixel) *= exp(-pow(dist,exponent/2.0f) / pow((float)outer_radius_square,exponent/2.0f));
                        }
                }
void EMAN::MaskGaussProcessor::set_params ( const Dict new_params) [inline, virtual]

Set the processor parameters using a key/value dictionary.

Parameters:
new_paramsA dictionary containing the new parameters.

Reimplemented from EMAN::CircularMaskProcessor.

Definition at line 2760 of file processor.h.

References exponent, and EMAN::Processor::params.

                {
                        CircularMaskProcessor::set_params(new_params);
                        exponent = params["exponent"];
                        if (exponent <= 0.0) {
                                exponent = 2.0;
                        }
                }

Member Data Documentation

Definition at line 2785 of file processor.h.

Referenced by process_dist_pixel(), and set_params().

const string MaskGaussProcessor::NAME = "mask.gaussian" [static]

Definition at line 2782 of file processor.h.

Referenced by get_name().


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