#include <processor.h>
Inheritance diagram for EMAN::MaskGaussNonuniformProcessor:
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 Processor * | NEW () |
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 |
radius_x | x-axis radius | |
radius_y | y-axis radius | |
radius_z | z-axis radius | |
gauss_width | Gaussian falloff width, relative to each radius, default 0.05 |
Definition at line 2578 of file processor.h.
EMAN::MaskGaussNonuniformProcessor::MaskGaussNonuniformProcessor | ( | ) | [inline] |
Definition at line 2581 of file processor.h.
Referenced by NEW().
02581 :radius_x(0), radius_y(0), radius_z(0), gauss_width(0) 02582 { 02583 }
string EMAN::MaskGaussNonuniformProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 2623 of file processor.h.
02624 { 02625 return "A Gaussian falloff to zero. Nonisotropic, specify inner radius for x,y,z and Gaussian falloff width. Falloff \ 02626 width is also nonisotropic and relative to the radii, with 1 being equal to the radius on that axis."; 02627 }
string EMAN::MaskGaussNonuniformProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 2614 of file processor.h.
References NAME.
02615 { 02616 return NAME; 02617 }
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.
Reimplemented from EMAN::Processor.
Definition at line 2602 of file processor.h.
References EMAN::EMObject::FLOAT, EMAN::EMObject::INT, and EMAN::TypeDict::put().
02603 { 02604 TypeDict d; 02605 02606 d.put("radius_x", EMObject::INT, "x-axis radius"); 02607 d.put("radius_y", EMObject::INT, "y-axis radius"); 02608 d.put("radius_z", EMObject::INT, "z-axis radius"); 02609 d.put("gauss_width", EMObject::FLOAT, "Gaussian falloff width, relative to each radius, default 0.05"); 02610 02611 return d; 02612 }
static Processor* EMAN::MaskGaussNonuniformProcessor::NEW | ( | ) | [inline, static] |
Definition at line 2618 of file processor.h.
References MaskGaussNonuniformProcessor().
02619 { 02620 return new MaskGaussNonuniformProcessor(); 02621 }
void EMAN::MaskGaussNonuniformProcessor::process_pixel | ( | float * | pixel, | |
int | xi, | |||
int | yi, | |||
int | zi | |||
) | const [inline, protected, virtual] |
Implements EMAN::CoordinateProcessor.
Definition at line 2632 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().
02633 { 02634 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); 02635 if (dist>1.0) (*pixel)*=exp(-pow((sqrt(dist)-1.0f)/gauss_width,2.0f)); 02636 }
void EMAN::MaskGaussNonuniformProcessor::set_params | ( | const Dict & | new_params | ) | [inline, virtual] |
Set the processor parameters using a key/value dictionary.
new_params | A dictionary containing the new parameters. |
Reimplemented from EMAN::Processor.
Definition at line 2585 of file processor.h.
References gauss_width, EMAN::Dict::has_key(), EMAN::Processor::params, radius_x, radius_y, and radius_z.
02586 { 02587 params = new_params; 02588 02589 if (params.has_key("radius_x")) radius_x=params["radius_x"]; 02590 else radius_x=5.0; 02591 02592 if (params.has_key("radius_y")) radius_y=params["radius_y"]; 02593 else radius_y=5.0; 02594 02595 if (params.has_key("radius_z")) radius_z=params["radius_z"]; 02596 else radius_z=5.0; 02597 02598 if (params.has_key("gauss_width")) gauss_width=params["gauss_width"]; 02599 else gauss_width=0.05f; 02600 }
float EMAN::MaskGaussNonuniformProcessor::gauss_width [protected] |
const string MaskGaussNonuniformProcessor::NAME = "mask.gaussian.nonuniform" [static] |
float EMAN::MaskGaussNonuniformProcessor::radius_x [protected] |
float EMAN::MaskGaussNonuniformProcessor::radius_y [protected] |
float EMAN::MaskGaussNonuniformProcessor::radius_z [protected] |