EMAN2
Public Member Functions | Protected Member Functions | Protected Attributes
EMAN::CircularMaskProcessor Class Reference

CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circular mask processors.Its subclass must implement process_dist_pixel(). More...

#include <processor.h>

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

List of all members.

Public Member Functions

 CircularMaskProcessor ()
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
string get_desc () const
 Get the descrition of this specific processor.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Protected Member Functions

void calc_locals (EMData *image)
bool is_valid () const
void process_pixel (float *pixel, int xi, int yi, int zi) const
virtual void process_dist_pixel (float *pixel, float dist) const =0

Protected Attributes

int inner_radius
int outer_radius
int inner_radius_square
int outer_radius_square
float dx
float dy
float dz
float xc
float yc
float zc

Detailed Description

CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circular mask processors.Its subclass must implement process_dist_pixel().

Parameters:
inner_radiusinner mask radius. optional, default=-1
outer_radiusouter mask radius
dxModify mask center by dx relative to the default center nx/2
dyModify mask center by dy relative to the default center ny/2
dzModify mask center by dz relative to the default center nz/2

Definition at line 2477 of file processor.h.


Constructor & Destructor Documentation

EMAN::CircularMaskProcessor::CircularMaskProcessor ( ) [inline]

Definition at line 2480 of file processor.h.

                                       :inner_radius(0), outer_radius(0), inner_radius_square(0),
                        outer_radius_square(0), dx(0), dy(0), dz(0), xc(0), yc(0), zc(0)
                {
                }

Member Function Documentation

void CircularMaskProcessor::calc_locals ( EMData image) [protected, virtual]
string EMAN::CircularMaskProcessor::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.

Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskSoftProcessor, EMAN::MaskEdgeMeanProcessor, EMAN::MaskNoiseProcessor, EMAN::MaskGaussProcessor, EMAN::MaskGaussInvProcessor, EMAN::MakeRadiusSquaredProcessor, and EMAN::MakeRadiusProcessor.

Definition at line 2512 of file processor.h.

                {
                        return "CircularMaskProcessor applies a circular mask to the data.This is the base class for specific circular mask processors.Its subclass must implement process_dist_pixel().";
                }
TypeDict EMAN::CircularMaskProcessor::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.

Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskSoftProcessor, EMAN::MaskEdgeMeanProcessor, EMAN::MaskGaussProcessor, and EMAN::MaskGaussInvProcessor.

Definition at line 2517 of file processor.h.

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

                {
                        TypeDict d;

                        d.put("inner_radius", EMObject::INT, "inner mask radius. optional");
                        d.put("outer_radius", EMObject::INT, "outer mask radius. Negative value -> box radius + outer_radius +1");

                        d.put("dx", EMObject::FLOAT,
                                  "Modify mask center by dx relative to the default center nx/2");
                        d.put("dy", EMObject::FLOAT,
                                  "Modify mask center by dy relative to the default center ny/2");
                        d.put("dz", EMObject::FLOAT,
                                  "Modify mask center by dz relative to the default center nz/2");

                        return d;
                }
bool EMAN::CircularMaskProcessor::is_valid ( ) const [inline, protected, virtual]

Reimplemented from EMAN::CoordinateProcessor.

Definition at line 2536 of file processor.h.

References EMAN::CoordinateProcessor::is_complex.

                {
                        return (!is_complex);
                }
virtual void EMAN::CircularMaskProcessor::process_dist_pixel ( float *  pixel,
float  dist 
) const [protected, pure virtual]
void EMAN::CircularMaskProcessor::process_pixel ( float *  pixel,
int  xi,
int  yi,
int  zi 
) const [inline, protected, virtual]

Implements EMAN::CoordinateProcessor.

Definition at line 2541 of file processor.h.

References dist(), process_dist_pixel(), xc, yc, and zc.

                {
                        float dist = (xi - xc) * (xi - xc) + (yi - yc) * (yi - yc) + (zi - zc) * (zi - zc);
                        process_dist_pixel(pixel, dist);
                }
void EMAN::CircularMaskProcessor::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.

Reimplemented in EMAN::MaskSharpProcessor, EMAN::MaskSoftProcessor, EMAN::MaskEdgeMeanProcessor, and EMAN::MaskGaussProcessor.

Definition at line 2485 of file processor.h.

References dx, dy, dz, EMAN::Dict::has_key(), inner_radius, inner_radius_square, outer_radius, outer_radius_square, and EMAN::Processor::params.

                {
                        params = new_params;

                        if (params.has_key("inner_radius")) {
                                inner_radius = params["inner_radius"];
                                inner_radius_square = inner_radius * inner_radius;
                        }
                        else {
                                inner_radius = -1;
                                inner_radius_square = -1;
                        }

                        if (params.has_key("outer_radius")) {
                                outer_radius = params["outer_radius"];
                                outer_radius_square = outer_radius * outer_radius;
                        }
                        else {
                                outer_radius = INT_MAX;
                                outer_radius_square = INT_MAX;
                        }

                        if (params.has_key("dx")) dx = params["dx"];
                        if (params.has_key("dy")) dy = params["dy"];
                        if (params.has_key("dz")) dz = params["dz"];
                }

Member Data Documentation


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