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

a gaussian falloff to zero, with nonisotropic widths along x,y,z More...

#include <processor.h>

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

List of all members.

Public Member Functions

 MaskGaussNonuniformProcessor ()
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_name () const
 Get the processor's name.
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.nonuniform"

Protected Member Functions

void process_pixel (float *pixel, int xi, int yi, int zi) const

Protected Attributes

float radius_x
float radius_y
float radius_z
float gauss_width

Detailed Description

a gaussian falloff to zero, with nonisotropic widths along x,y,z

Parameters:
radius_xx-axis radius
radius_yy-axis radius
radius_zz-axis radius
gauss_widthGaussian falloff width, relative to each radius, default 0.05

Definition at line 2807 of file processor.h.


Constructor & Destructor Documentation

EMAN::MaskGaussNonuniformProcessor::MaskGaussNonuniformProcessor ( ) [inline]

Definition at line 2810 of file processor.h.

Referenced by NEW().

                                              :radius_x(0), radius_y(0), radius_z(0), gauss_width(0)
                {
                }

Member Function Documentation

string EMAN::MaskGaussNonuniformProcessor::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 2852 of file processor.h.

                {
                        return "A Gaussian falloff to zero. Nonisotropic, specify inner radius for x,y,z and Gaussian falloff width. Falloff \
width is also nonisotropic and relative to the radii, with 1 being equal to the radius on that axis.";
                }
string EMAN::MaskGaussNonuniformProcessor::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 2843 of file processor.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::MaskGaussNonuniformProcessor::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 2831 of file processor.h.

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

                {
                        TypeDict d;

                        d.put("radius_x", EMObject::INT, "x-axis radius");
                        d.put("radius_y", EMObject::INT, "y-axis radius");
                        d.put("radius_z", EMObject::INT, "z-axis radius");
                        d.put("gauss_width", EMObject::FLOAT, "Gaussian falloff width, relative to each radius, default 0.05");

                        return d;
                }
static Processor* EMAN::MaskGaussNonuniformProcessor::NEW ( ) [inline, static]

Definition at line 2847 of file processor.h.

References MaskGaussNonuniformProcessor().

                {
                        return new MaskGaussNonuniformProcessor();
                }
void EMAN::MaskGaussNonuniformProcessor::process_pixel ( float *  pixel,
int  xi,
int  yi,
int  zi 
) const [inline, protected, virtual]

Implements EMAN::CoordinateProcessor.

Definition at line 2861 of file processor.h.

References dist(), gauss_width, EMAN::CoordinateProcessor::nx, EMAN::CoordinateProcessor::ny, EMAN::CoordinateProcessor::nz, radius_x, radius_y, radius_z, and sqrt().

                {
                        float dist = pow((xi - nx/2)/radius_x,2.0f) + pow((yi - ny/2)/radius_y,2.0f) + pow((zi - nz/2)/radius_z,2.0f);
                        if (dist>1.0) (*pixel)*=exp(-pow((sqrt(dist)-1.0f)/gauss_width,2.0f));
                }
void EMAN::MaskGaussNonuniformProcessor::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::Processor.

Definition at line 2814 of file processor.h.

References gauss_width, EMAN::Dict::has_key(), EMAN::Processor::params, radius_x, radius_y, and radius_z.

                {
                        params = new_params;

                        if (params.has_key("radius_x")) radius_x=params["radius_x"];
                        else radius_x=5.0;

                        if (params.has_key("radius_y")) radius_y=params["radius_y"];
                        else radius_y=5.0;

                        if (params.has_key("radius_z")) radius_z=params["radius_z"];
                        else radius_z=5.0;

                        if (params.has_key("gauss_width")) gauss_width=params["gauss_width"];
                        else gauss_width=0.05f;
                }

Member Data Documentation

Definition at line 2867 of file processor.h.

Referenced by process_pixel(), and set_params().

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

Definition at line 2858 of file processor.h.

Referenced by get_name().

Definition at line 2867 of file processor.h.

Referenced by process_pixel(), and set_params().

Definition at line 2867 of file processor.h.

Referenced by process_pixel(), and set_params().

Definition at line 2867 of file processor.h.

Referenced by process_pixel(), and set_params().


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