#include <processor.h>
Inheritance diagram for EMAN::MaskGaussProcessor:
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 Processor * | NEW () |
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 |
Definition at line 2523 of file processor.h.
string EMAN::MaskGaussProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Reimplemented from EMAN::CircularMaskProcessor.
Definition at line 2551 of file processor.h.
02552 { 02553 return "a gaussian falloff to zero, radius is the 1/e of the width. If inner_radius>0, then \ 02554 outer radius specifies width of Gaussian starting at inner_radius rather than total radius."; 02555 }
string EMAN::MaskGaussProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 2526 of file processor.h.
References NAME.
02527 { 02528 return NAME; 02529 }
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.
Reimplemented from EMAN::CircularMaskProcessor.
Definition at line 2544 of file processor.h.
References EMAN::EMObject::FLOAT, EMAN::CircularMaskProcessor::get_param_types(), and EMAN::TypeDict::put().
02545 { 02546 TypeDict d = CircularMaskProcessor::get_param_types(); 02547 d.put("exponent", EMObject::FLOAT, "The exponent, f in e^-Bs^f. default 2.0, producing a Gaussian"); 02548 return d; 02549 }
static Processor* EMAN::MaskGaussProcessor::NEW | ( | ) | [inline, static] |
void EMAN::MaskGaussProcessor::process_dist_pixel | ( | float * | pixel, | |
float | dist | |||
) | const [inline, protected, virtual] |
Implements EMAN::CircularMaskProcessor.
Definition at line 2561 of file processor.h.
References exponent, EMAN::CircularMaskProcessor::inner_radius, EMAN::CircularMaskProcessor::inner_radius_square, EMAN::CircularMaskProcessor::outer_radius_square, and sqrt().
02562 { 02563 if (inner_radius_square>0) { 02564 if (dist>inner_radius_square) { 02565 if (exponent==2.0f) (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,2.0f) / outer_radius_square); 02566 else (*pixel) *= exp(-pow(sqrt(dist)-inner_radius,exponent) / pow((float)outer_radius_square,exponent/2.0f)); 02567 } 02568 } 02569 else { 02570 if (exponent==2.0f) (*pixel) *= exp(-dist / outer_radius_square); 02571 else (*pixel) *= exp(-pow(dist,exponent/2.0f) / pow((float)outer_radius_square,exponent/2.0f)); 02572 } 02573 }
void EMAN::MaskGaussProcessor::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::CircularMaskProcessor.
Definition at line 2535 of file processor.h.
References exponent, EMAN::Processor::params, and EMAN::CircularMaskProcessor::set_params().
02536 { 02537 CircularMaskProcessor::set_params(new_params); 02538 exponent = params["exponent"]; 02539 if (exponent <= 0.0) { 02540 exponent = 2.0; 02541 } 02542 }
float EMAN::MaskGaussProcessor::exponent [protected] |
const string MaskGaussProcessor::NAME = "mask.gaussian" [static] |