EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EMAN::PolyMaskProcessor Class Reference

#include <processor.h>

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

Public Member Functions

 PolyMaskProcessor ()
 
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 
TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
string get_name () const
 Get the processor's name. More...
 
string get_desc () const
 Get the descrition of this specific processor. More...
 
- Public Member Functions inherited from EMAN::CoordinateProcessor
 CoordinateProcessor ()
 
void process_inplace (EMData *image)
 To process an image in-place. More...
 
- Public Member Functions inherited from EMAN::Processor
virtual ~Processor ()
 
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place. More...
 
virtual void process_list_inplace (vector< EMData * > &images)
 To process multiple images using the same algorithm. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- Static Public Member Functions inherited from EMAN::CoordinateProcessor
static string get_group_desc ()
 
- Static Public Member Functions inherited from EMAN::Processor
static string get_group_desc ()
 Get the description of this group of processors. More...
 
static void EMFourierFilterInPlace (EMData *fimage, Dict params)
 Compute a Fourier-filter processed image in place. More...
 
static EMDataEMFourierFilter (EMData *fimage, Dict params)
 Compute a Fourier-processor processed image without altering the original image. More...
 

Static Public Attributes

static const string NAME = "mask.poly"
 

Protected Member Functions

void process_pixel (float *pixel, int xi, int yi, int zi) const
 
- Protected Member Functions inherited from EMAN::CoordinateProcessor
virtual void calc_locals (EMData *)
 
virtual bool is_valid () const
 

Protected Attributes

float k0
 
float k1
 
float k2
 
float k3
 
float k4
 
- Protected Attributes inherited from EMAN::CoordinateProcessor
int nx
 
int ny
 
int nz
 
float mean
 
float sigma
 
float maxval
 
bool is_complex
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
  TOP_HAT_LOW_PASS , TOP_HAT_HIGH_PASS , TOP_HAT_BAND_PASS , TOP_HOMOMORPHIC ,
  GAUSS_LOW_PASS , GAUSS_HIGH_PASS , GAUSS_BAND_PASS , GAUSS_INVERSE ,
  GAUSS_HOMOMORPHIC , BUTTERWORTH_LOW_PASS , BUTTERWORTH_HIGH_PASS , BUTTERWORTH_HOMOMORPHIC ,
  KAISER_I0 , KAISER_SINH , KAISER_I0_INVERSE , KAISER_SINH_INVERSE ,
  SHIFT , TANH_LOW_PASS , TANH_HIGH_PASS , TANH_HOMOMORPHIC ,
  TANH_BAND_PASS , RADIAL_TABLE , CTF_
}
 Fourier filter Processor type enum. More...
 

Detailed Description

Definition at line 9789 of file processor.h.

Constructor & Destructor Documentation

◆ PolyMaskProcessor()

EMAN::PolyMaskProcessor::PolyMaskProcessor ( )
inline

Definition at line 9792 of file processor.h.

9792 :k0(0), k1(0), k2(0), k3(0), k4(0)
9793 {
9794 }

Referenced by NEW().

Member Function Documentation

◆ get_desc()

string EMAN::PolyMaskProcessor::get_desc ( ) const
inlinevirtual

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 9831 of file processor.h.

9832 {
9833 return "Mask with polynomial falloff. k4 x^4 + k3 x^3 + k2 x^2 + k1 x + k0, where x is distance to center divided by nx/2.";
9834 }

◆ get_name()

string EMAN::PolyMaskProcessor::get_name ( ) const
inlinevirtual

Get the processor's name.

Each processor is identified by a unique name.

Returns
The processor's name.

Implements EMAN::Processor.

Definition at line 9822 of file processor.h.

9823 {
9824 return NAME;
9825 }
static const string NAME
Definition: processor.h:9836

References NAME.

◆ get_param_types()

TypeDict EMAN::PolyMaskProcessor::get_param_types ( ) const
inlinevirtual

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 9808 of file processor.h.

9809 {
9810 TypeDict d;
9811
9812 d.put("k0", EMObject::FLOAT, "constant term");
9813 d.put("k1", EMObject::FLOAT, "k x term");
9814 d.put("k2", EMObject::FLOAT, "k x^2 term");
9815 d.put("k3", EMObject::FLOAT, "k x^3 term");
9816 d.put("k4", EMObject::FLOAT, "k x^4 term");
9817 d.put("2d", EMObject::BOOL, "apply mask in 2D");
9818
9819 return d;
9820 }
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330

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

◆ NEW()

static Processor * EMAN::PolyMaskProcessor::NEW ( )
inlinestatic

Definition at line 9826 of file processor.h.

9827 {
9828 return new PolyMaskProcessor();
9829 }

References PolyMaskProcessor().

◆ process_pixel()

void EMAN::PolyMaskProcessor::process_pixel ( float *  pixel,
int  xi,
int  yi,
int  zi 
) const
inlineprotectedvirtual

Implements EMAN::CoordinateProcessor.

Definition at line 9839 of file processor.h.

9840 {
9841 float x=0.0f;
9842 if (params["2d"]){
9843 x = sqrt( pow((xi - nx/2),2.0f) + pow((yi - ny/2),2.0f) ) / (nx/2);
9844 }
9845 else{
9846 x = sqrt( pow((xi - nx/2),2.0f) + pow((yi - ny/2),2.0f) + pow((zi - nz/2),2.0f)) / (nx/2);
9847 }
9848
9849 (*pixel)*= k4*pow(x, 4.0f) + k3*pow(x, 3.0f) + k2*pow(x, 2.0f) + k1*x + k0;
9850 }
EMData * sqrt() const
return square root of current image
#define x(i)
Definition: projector.cpp:1517

References k0, k1, k2, k3, k4, EMAN::CoordinateProcessor::nx, EMAN::CoordinateProcessor::ny, EMAN::CoordinateProcessor::nz, EMAN::Processor::params, sqrt(), and x.

◆ set_params()

void EMAN::PolyMaskProcessor::set_params ( const Dict new_params)
inlinevirtual

Set the processor parameters using a key/value dictionary.

Parameters
new_paramsA dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Definition at line 9796 of file processor.h.

9797 {
9798 params = new_params;
9799
9800 if (params.has_key("k0")) k0 = params["k0"];
9801 if (params.has_key("k1")) k1 = params["k1"];
9802 if (params.has_key("k2")) k2 = params["k2"];
9803 if (params.has_key("k3")) k3 = params["k3"];
9804 if (params.has_key("k4")) k4 = params["k4"];
9805
9806 }
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511

References EMAN::Dict::has_key(), k0, k1, k2, k3, k4, and EMAN::Processor::params.

Member Data Documentation

◆ k0

float EMAN::PolyMaskProcessor::k0
protected

Definition at line 9852 of file processor.h.

Referenced by process_pixel(), and set_params().

◆ k1

float EMAN::PolyMaskProcessor::k1
protected

Definition at line 9852 of file processor.h.

Referenced by process_pixel(), and set_params().

◆ k2

float EMAN::PolyMaskProcessor::k2
protected

Definition at line 9852 of file processor.h.

Referenced by process_pixel(), and set_params().

◆ k3

float EMAN::PolyMaskProcessor::k3
protected

Definition at line 9852 of file processor.h.

Referenced by process_pixel(), and set_params().

◆ k4

float EMAN::PolyMaskProcessor::k4
protected

Definition at line 9852 of file processor.h.

Referenced by process_pixel(), and set_params().

◆ NAME

const string PolyMaskProcessor::NAME = "mask.poly"
static

Definition at line 9836 of file processor.h.

Referenced by get_name().


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