EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
EMAN::FFTConeProcessor 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::FFTConeProcessor:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FFTConeProcessor:
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.cone"
 

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

Member Function Documentation

◆ get_desc()

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

5435 {
5436 return "Sets a cone to zero in Fourier space around the +-Z axis to (somewhat) emulate the missing cone in an RCT experiment. Angles are measured using X/Y/Z expressed as a fraction of Nyquist, for sensible results on non-cubic images";
5437 }

◆ get_name()

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

5426 {
5427 return NAME;
5428 }
static const string NAME
Definition: processor.h:5447

References NAME.

◆ get_param_types()

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

5440 {
5441 TypeDict d;
5442 d.put("angle", EMObject::FLOAT, "Angular range in degrees from the Z axis to zero. (default 15)");
5443 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)");
5444 return d;
5445 }
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::FFTConeProcessor::NEW ( )
inlinestatic

Definition at line 5429 of file processor.h.

5430 {
5431 return new FFTConeProcessor();
5432 }
Mask out (or in) peaks in Fourier space based on the average amplitude at each spatial frequency.
Definition: processor.h:5421

◆ process_inplace()

void FFTConeProcessor::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 997 of file processor.cpp.

998{
999 EMData *fft;
1000
1001 if (!image) throw InvalidParameterException("FFTConeProcessor: no image provided");
1002 if (!image->is_complex()) fft = image->do_fft();
1003 else fft = image;
1004
1005
1006 int nx=fft->get_xsize();
1007 int ny=fft->get_ysize();
1008 int nz=fft->get_zsize();
1009 if (nz==1) throw ImageDimensionException("FFTConeProcessor only works on 3-D images");
1010
1011 float angle = (float)params.set_default("angle",15.0f);
1012 float rmin = (float)params.set_default("rmin",1.0f);
1013
1014 for (int z=-nz/2; z<nz/2; z++) {
1015 for (int y=-ny/2; y<ny/2; y++) {
1016 for (int x=0; x<nx/2; x++) {
1017 float ang=0;
1018 if (x!=0 ||y!=0) ang=90.0-atan(fabs(float(z)/nz)/hypot(float(x)/nx,float(y)/ny))*180.0/M_PI;
1019 if (ang>angle || Util::hypot3(x,y,z)<rmin) continue;
1020 fft->set_complex_at(x,y,z,0.0f);
1021 }
1022 }
1023 }
1024
1025 if (fft!=image) {
1026 EMData *ift=fft->do_ift();
1027 memcpy(image->get_data(),ift->get_data(),(nx-2)*ny*nz*sizeof(float));
1028 delete fft;
1029 delete ift;
1030 }
1031 image->update();
1032
1033// image->update();
1034}
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 FFTConeProcessor::NAME = "mask.fft.cone"
static

Definition at line 5447 of file processor.h.

Referenced by get_name().


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