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

This will replace the image with a full-circle 2D fft amplitude rendering. More...

#include <processor.h>

Inheritance diagram for EMAN::RealToFFTProcessor:
Inheritance graph
[legend]
Collaboration diagram for EMAN::RealToFFTProcessor:
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...
 
- 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...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a 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 = "math.realtofft"
 

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

This will replace the image with a full-circle 2D fft amplitude rendering.

Definition at line 5362 of file processor.h.

Member Function Documentation

◆ get_desc()

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

5378 {
5379 return "This will replace the image with a full-circle 2D fft amplitude rendering. Note that this renders amplitude, when intensity is more common.";
5380 }

◆ get_name()

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

5368 {
5369 return NAME;
5370 }
static const string NAME
Definition: processor.h:5382

References NAME.

Referenced by process_inplace().

◆ NEW()

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

Definition at line 5372 of file processor.h.

5373 {
5374 return new RealToFFTProcessor();
5375 }
This will replace the image with a full-circle 2D fft amplitude rendering.
Definition: processor.h:5363

◆ process_inplace()

void RealToFFTProcessor::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 3987 of file processor.cpp.

3988{
3989 if (!image) {
3990 LOGWARN("NULL Image");
3991 return;
3992 }
3993
3994 //Note : real image only!
3995 if(image->is_complex()) {
3996 LOGERR("%s Processor only operates on real images", get_name().c_str());
3997 throw ImageFormatException("apply to real image only");
3998 }
3999
4000 // Note : 2D only!
4001 int nz = image->get_zsize();
4002 if (nz > 1) {
4003 LOGERR("%s Processor doesn't support 3D models", get_name().c_str());
4004 throw ImageDimensionException("3D model not supported");
4005 }
4006
4007 EMData *ff=image->do_fft();
4008 ff->ri2ap();
4009
4010 int nx=image->get_xsize();
4011 int ny=image->get_ysize();
4012
4013 int x,y;
4014 float norm=static_cast<float>(nx*ny);
4015
4016 for (y=0; y<ny; y++) image->set_value_at(0,y,0);
4017
4018 for (x=1; x<nx/2; x++) {
4019 for (y=0; y<ny; y++) {
4020 int y2;
4021 if (y<ny/2) y2=y+ny/2;
4022 else if (y==ny/2) y2=ny;
4023 else y2=y-ny/2;
4024 image->set_value_at(x,y,ff->get_value_at(nx-x*2,ny-y2)/norm);
4025 }
4026 }
4027
4028 for (x=nx/2; x<nx; x++) {
4029 for (y=0; y<ny; y++) {
4030 int y2;
4031 if (y<ny/2) y2=y+ny/2;
4032 else y2=y-ny/2;
4033 image->set_value_at(x,y,ff->get_value_at(x*2-nx,y2)/norm);
4034 }
4035 }
4036
4037 image->update();
4038 if( ff )
4039 {
4040 delete ff;
4041 ff = 0;
4042 }
4043}
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
string get_name() const
Get the processor's name.
Definition: processor.h:5367
#define ImageFormatException(desc)
Definition: exception.h:147
#define ImageDimensionException(desc)
Definition: exception.h:166
#define LOGWARN
Definition: log.h:53
#define LOGERR
Definition: log.h:51
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References get_name(), ImageDimensionException, ImageFormatException, LOGERR, LOGWARN, x, and y.

Member Data Documentation

◆ NAME

const string RealToFFTProcessor::NAME = "math.realtofft"
static

Definition at line 5382 of file processor.h.

Referenced by get_name().


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