EMAN2
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EMAN::CircularMaskProcessor Class Referenceabstract

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]

Public Member Functions

 CircularMaskProcessor ()
 
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 
string get_desc () const
 Get the descrition of this specific processor. More...
 
TypeDict get_param_types () const
 Get processor parameter information in a dictionary. 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 string get_name () const =0
 Get the processor's name. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 

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

float inner_radius
 
float outer_radius
 
float inner_radius_square
 
float outer_radius_square
 
float dx
 
float dy
 
float dz
 
float xc
 
float yc
 
float zc
 
- 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...
 
- 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...
 

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

Constructor & Destructor Documentation

◆ CircularMaskProcessor()

EMAN::CircularMaskProcessor::CircularMaskProcessor ( )
inline

Member Function Documentation

◆ calc_locals()

void CircularMaskProcessor::calc_locals ( EMData image)
protectedvirtual

Reimplemented from EMAN::CoordinateProcessor.

Reimplemented in EMAN::MaskGaussInvProcessor, and EMAN::MaskEdgeMeanProcessor.

Definition at line 2382 of file processor.cpp.

2383{
2384 xc = Util::fast_floor(nx/2.0f) + dx;
2385 yc = Util::fast_floor(ny/2.0f) + dy;
2386 zc = Util::fast_floor(nz/2.0f) + dz;
2387
2388 if (outer_radius < 0) {
2389 outer_radius = nx / 2 + outer_radius +1;
2391 }
2392
2393 if (inner_radius <= 0) {
2395 }
2396}
static int fast_floor(float x)
A fast way to calculate a floor, which is largest integral value not greater than argument.
Definition: util.h:874

References dx, dy, dz, EMAN::Util::fast_floor(), inner_radius, inner_radius_square, EMAN::CoordinateProcessor::nx, EMAN::CoordinateProcessor::ny, EMAN::CoordinateProcessor::nz, outer_radius, outer_radius_square, xc, yc, and zc.

◆ get_desc()

string EMAN::CircularMaskProcessor::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.

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

Definition at line 3755 of file processor.h.

3756 {
3757 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().";
3758 }

◆ get_param_types()

TypeDict EMAN::CircularMaskProcessor::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.

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

Definition at line 3760 of file processor.h.

3761 {
3762 TypeDict d;
3763
3764 d.put("inner_radius", EMObject::FLOAT, "inner mask radius. optional");
3765 d.put("outer_radius", EMObject::FLOAT, "outer mask radius. Negative value -> box radius + outer_radius +1");
3766
3767 d.put("dx", EMObject::FLOAT,
3768 "Modify mask center by dx relative to the default center nx/2");
3769 d.put("dy", EMObject::FLOAT,
3770 "Modify mask center by dy relative to the default center ny/2");
3771 d.put("dz", EMObject::FLOAT,
3772 "Modify mask center by dz relative to the default center nz/2");
3773
3774 return d;
3775 }
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::FLOAT, and EMAN::TypeDict::put().

Referenced by EMAN::MaskSharpProcessor::get_param_types(), EMAN::MaskSoftProcessor::get_param_types(), EMAN::MaskEdgeMeanProcessor::get_param_types(), and EMAN::MaskGaussProcessor::get_param_types().

◆ is_valid()

bool EMAN::CircularMaskProcessor::is_valid ( ) const
inlineprotectedvirtual

Reimplemented from EMAN::CoordinateProcessor.

Definition at line 3779 of file processor.h.

3780 {
3781 return (!is_complex);
3782 }

References EMAN::CoordinateProcessor::is_complex.

◆ process_dist_pixel()

virtual void EMAN::CircularMaskProcessor::process_dist_pixel ( float *  pixel,
float  dist 
) const
protectedpure virtual

◆ process_pixel()

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

Implements EMAN::CoordinateProcessor.

Definition at line 3784 of file processor.h.

3785 {
3786 float dist = (xi - xc) * (xi - xc) + (yi - yc) * (yi - yc) + (zi - zc) * (zi - zc);
3787 process_dist_pixel(pixel, dist);
3788 }
virtual void process_dist_pixel(float *pixel, float dist) const =0

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

◆ set_params()

void EMAN::CircularMaskProcessor::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.

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

Definition at line 3728 of file processor.h.

3729 {
3730 params = new_params;
3731
3732 if (params.has_key("inner_radius")) {
3733 inner_radius = params["inner_radius"];
3735 }
3736 else {
3737 inner_radius = -1;
3739 }
3740
3741 if (params.has_key("outer_radius")) {
3742 outer_radius = params["outer_radius"];
3744 }
3745 else {
3746 outer_radius = INT_MAX;
3747 outer_radius_square = INT_MAX;
3748 }
3749
3750 if (params.has_key("dx")) dx = params["dx"];
3751 if (params.has_key("dy")) dy = params["dy"];
3752 if (params.has_key("dz")) dz = params["dz"];
3753 }
bool has_key(const string &key) const
Ask the Dictionary if it as a particular key.
Definition: emobject.h:511

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

Referenced by EMAN::MaskSharpProcessor::set_params(), EMAN::MaskSoftProcessor::set_params(), EMAN::MaskEdgeMeanProcessor::set_params(), EMAN::MaskGaussProcessor::set_params(), and EMAN::RadialProcessor::set_params().

Member Data Documentation

◆ dx

float EMAN::CircularMaskProcessor::dx
protected

◆ dy

float EMAN::CircularMaskProcessor::dy
protected

◆ dz

float EMAN::CircularMaskProcessor::dz
protected

◆ inner_radius

float EMAN::CircularMaskProcessor::inner_radius
protected

◆ inner_radius_square

float EMAN::CircularMaskProcessor::inner_radius_square
protected

◆ outer_radius

float EMAN::CircularMaskProcessor::outer_radius
protected

◆ outer_radius_square

float EMAN::CircularMaskProcessor::outer_radius_square
protected

◆ xc

float EMAN::CircularMaskProcessor::xc
protected

◆ yc

float EMAN::CircularMaskProcessor::yc
protected

◆ zc

float EMAN::CircularMaskProcessor::zc
protected

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