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

Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency. More...

#include <processor.h>

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

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. More...
 
string get_name () const
 Get the processor's name. 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::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...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- 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.fft.wedge"
 

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...
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

Detailed Description

Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.

Definition at line 5452 of file processor.h.

Member Function Documentation

◆ get_desc()

string EMAN::FFTWedgeProcessor::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 5466 of file processor.h.

5467 {
5468 return "Sets a wedge to zero in Fourier space around the +-Z axis along X as a tilt axis to (somewhat) emulate the missing wedge in a tomography experiment. For example, anglemin=-30, anglemax=30 to roughly emulate at -60 to +60 tilt series";
5469 }

◆ get_name()

string EMAN::FFTWedgeProcessor::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 5457 of file processor.h.

5458 {
5459 return NAME;
5460 }
static const string NAME
Definition: processor.h:5480

References NAME.

◆ get_param_types()

TypeDict EMAN::FFTWedgeProcessor::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 5471 of file processor.h.

5472 {
5473 TypeDict d;
5474 d.put("anglemin", EMObject::FLOAT, "Minimum angle (degrees) in Y-Z plane to zero (default -30)");
5475 d.put("anglemax", EMObject::FLOAT, "Maximum angle (degrees) in Y-Z plane to zero (default 30)");
5476 d.put("rmin", EMObject::FLOAT, "Radius in Fourier pixels at which to start zeroing. This permits some very low resolution to be preserved. (default 1)");
5477 return d;
5478 }
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().

◆ NEW()

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

Definition at line 5461 of file processor.h.

5462 {
5463 return new FFTWedgeProcessor();
5464 }
Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.
Definition: processor.h:5453

◆ process_inplace()

void FFTWedgeProcessor::process_inplace ( EMData image)
virtual

To process an image in-place.

For those processors which can only be processed out-of-place, override this function to just print out some error message to remind user call the out-of-place version.

Parameters
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 1036 of file processor.cpp.

1037{
1038 EMData *fft;
1039
1040 if (!image) throw InvalidParameterException("FFTWedgeProcessor: no image provided");
1041 if (!image->is_complex()) fft = image->do_fft();
1042 else fft = image;
1043
1044
1045 int nx=fft->get_xsize();
1046 int ny=fft->get_ysize();
1047 int nz=fft->get_zsize();
1048 if (nz==1) throw ImageDimensionException("FFTWedgeProcessor only works on 3-D images");
1049
1050 float anglemin = (float)params.set_default("anglemin",-30.0f);
1051 float anglemax = (float)params.set_default("anglemax",30.0f);
1052 float rmin = (float)params.set_default("rmin",1.0f);
1053
1054 for (int z=-nz/2; z<nz/2; z++) {
1055 for (int y=-ny/2; y<ny/2; y++) {
1056 for (int x=0; x<nx/2; x++) {
1057 float ang=90.0f;
1058 if (z!=0) ang=atan((float(y)/ny)/fabs(float(z)/nz))*180.0/M_PI;
1059 if (ang<anglemin||ang>anglemax || Util::hypot3(x,y,z)<rmin) continue;
1060 fft->set_complex_at(x,y,z,0.0f);
1061 }
1062 }
1063 }
1064
1065 if (fft!=image) {
1066 EMData *ift=fft->do_ift();
1067 memcpy(image->get_data(),ift->get_data(),(nx-2)*ny*nz*sizeof(float));
1068 delete fft;
1069 delete ift;
1070 }
1071 image->update();
1072
1073// image->update();
1074}
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
static float hypot3(int x, int y, int z)
Euclidean distance function in 3D: f(x,y,z) = sqrt(x*x + y*y + z*z);.
Definition: util.h:827
#define InvalidParameterException(desc)
Definition: exception.h:361
#define ImageDimensionException(desc)
Definition: exception.h:166
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References EMAN::Util::hypot3(), ImageDimensionException, InvalidParameterException, EMAN::Processor::params, EMAN::Dict::set_default(), x, and y.

Member Data Documentation

◆ NAME

const string FFTWedgeProcessor::NAME = "mask.fft.wedge"
static

Definition at line 5480 of file processor.h.

Referenced by get_name().


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