EMAN2
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
EMAN::FourierAnlProcessor Class Referenceabstract

Same as FourierProcessor, except first computes the current image radial power spectrum and passes it to the processor (no radial oversampling, number of elements = radius) More...

#include <processor.h>

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

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. 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 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...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 
virtual string get_desc () const =0
 Get the descrition of this specific processor. More...
 

Static Public Member Functions

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...
 

Protected Member Functions

virtual void preprocess (EMData *)
 
virtual void create_radial_func (vector< float > &radial_mask, EMData *image) const =0
 

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

Same as FourierProcessor, except first computes the current image radial power spectrum and passes it to the processor (no radial oversampling, number of elements = radius)

Parameters
cutoff_absProcessor radius in terms of Nyquist (0-.5).
cutoff_pixelsWidth in Fourier pixels (0 - size()/2).
cutoff_freqResolution in 1/A (0 - 1 / size*apix).
apixOverride A/pix in the image header (changes x,y and z).

Definition at line 390 of file processor.h.

Member Function Documentation

◆ create_radial_func()

virtual void EMAN::FourierAnlProcessor::create_radial_func ( vector< float > &  radial_mask,
EMData image 
) const
protectedpure virtual

◆ get_group_desc()

static string EMAN::FourierAnlProcessor::get_group_desc ( )
inlinestatic

Definition at line 395 of file processor.h.

396 {
397 return "Fourier Filter processors are a group of processor in the frequency domain. Before using such processors on an image, the image must be transformed from real space to the fourier space. FourierProcessor class is the base class of fourier space processors. Each specific processor is either a lowpass filter processor, or a highpass filter processor, or neighter. The unit of lowpass and highpass parameters are in terms of Nyquist, valid range is [0,0.5]. ";
398 }

◆ get_param_types()

TypeDict EMAN::FourierAnlProcessor::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::LowpassAutoBProcessor, EMAN::MatchSFProcessor, and EMAN::SetSFProcessor.

Definition at line 400 of file processor.h.

401 {
402 TypeDict d;
403 d.put("cutoff_abs", EMObject::FLOAT, "Processor radius in terms of Nyquist (0-.5)");
404 d.put("cutoff_pixels", EMObject::FLOAT, " Width in Fourier pixels (0 - size()/2)");
405 d.put("cutoff_freq", EMObject::FLOAT, "1/Resolution in 1/A (0 - 1 / 2*apix). eg - a 20 A filter is cutoff_freq=0.05");
406 d.put("apix", EMObject::FLOAT, " Override A/pix in the image header (changes x,y and z)");
407 d.put("return_radial", EMObject::BOOL, "Return the radial filter function as an attribute (filter_curve)");
408 d.put("interpolate", EMObject::BOOL, "Whether or not to interpolate the radial scaling function. Default=false. Prb should be true.");
409 return d;
410 }
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().

Referenced by EMAN::LowpassAutoBProcessor::get_param_types().

◆ preprocess()

virtual void EMAN::FourierAnlProcessor::preprocess ( EMData )
inlineprotectedvirtual

Reimplemented in EMAN::LowpassAutoBProcessor, and EMAN::HighpassAutoPeakProcessor.

Definition at line 413 of file processor.h.

413{}

Referenced by process_inplace().

◆ process_inplace()

void FourierAnlProcessor::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 734 of file processor.cpp.

735{
736 if (!image) {
737 LOGWARN("NULL Image");
738 return;
739 }
740
741 preprocess(image);
742
743// int array_size = FFTRADIALOVERSAMPLE * image->get_ysize();
744// float step=0.5f/array_size;
745//
746// vector < float >yarray(array_size);
747
748 bool return_radial=(bool)params.set_default("return_radial",0);
749 bool interpolate=(bool)params.set_default("interpolate",1);
750
751 float cornerscale;
752 if (image->get_zsize()>1) cornerscale=sqrt(3.0);
753 else cornerscale=sqrt(2.0);
754
755 if (image->is_complex()) {
756 vector <float>yarray = image->calc_radial_dist(floor(image->get_ysize()*cornerscale/2),0,1.0,1);
757 create_radial_func(yarray,image);
758 image->apply_radial_func(0, 1.0f/image->get_ysize(), yarray,interpolate);
759 if (return_radial) image->set_attr("filter_curve",yarray);
760 }
761 else {
762 EMData *fft = image->do_fft();
763 vector <float>yarray = fft->calc_radial_dist((int)floor(fft->get_ysize()*cornerscale/2.0),0,1.0,1);
764 create_radial_func(yarray,fft);
765 // 4/30/10 stevel turned off interpolation to fix problem with matched filter
766 // 9/12/14 stevel, not sure why I turned off interp. Seems to cause rather than fix problems. Adding option to enable. Afraid to turn it on
767 fft->apply_radial_func(0, 1.0f/image->get_ysize(), yarray,interpolate);
768 EMData *ift = fft->do_ift();
769
770 memcpy(image->get_data(),ift->get_data(),ift->get_xsize()*ift->get_ysize()*ift->get_zsize()*sizeof(float));
771 if (return_radial) image->set_attr("filter_curve",yarray);
772
773// for (int i=0; i<yarray.size(); i++) printf("%d\t%f\n",i,yarray[i]);
774
775 //ift->update(); Unecessary
776
777 delete fft;
778 delete ift;
779
780 }
781
782 image->update();
783}
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
void apply_radial_func(float x0, float dx, vector< float >array, bool interp=true)
multiplies by a radial function in fourier space.
Definition: emdata.cpp:2677
vector< float > calc_radial_dist(int n, float x0, float dx, int inten)
calculates radial distribution.
Definition: emdata.cpp:2781
virtual void preprocess(EMData *)
Definition: processor.h:413
virtual void create_radial_func(vector< float > &radial_mask, EMData *image) const =0
EMData * sqrt() const
return square root of current image
#define LOGWARN
Definition: log.h:53

References EMAN::EMData::apply_radial_func(), EMAN::EMData::calc_radial_dist(), create_radial_func(), LOGWARN, EMAN::Processor::params, preprocess(), EMAN::Dict::set_default(), and sqrt().


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