EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
EMAN::Axis0FourierProcessor Class Reference

Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0) More...

#include <processor.h>

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

List of all members.

Public Member Functions

string get_name () const
 Get the processor's name.
void process_inplace (EMData *image)
 To process an image in-place.
void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.
string get_desc () const
 Get the descrition of this specific processor.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "filter.xyaxes0"

Detailed Description

Zeroes the values on the X=0 and y=0 Fourier axes (except x=y=0)

Definition at line 468 of file processor.h.


Member Function Documentation

string EMAN::Axis0FourierProcessor::get_desc ( ) const [inline, virtual]

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

                {
                        return "Sets values along X/Y Fourier axes to 0, except origin";
                }
string EMAN::Axis0FourierProcessor::get_name ( ) const [inline, virtual]

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 471 of file processor.h.

References NAME.

                {
                        return NAME;
                }
TypeDict EMAN::Axis0FourierProcessor::get_param_types ( ) const [inline, virtual]

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

References EMAN::EMObject::INT, and EMAN::TypeDict::put().

                {
                        TypeDict d;
                        d.put("x", EMObject::INT, "If set, zeroes along X axis. Default True.");
                        d.put("y", EMObject::INT, "If set, zeroes along X axis. Default True.");
                        return d;
                }
static Processor* EMAN::Axis0FourierProcessor::NEW ( ) [inline, static]

Definition at line 491 of file processor.h.

                {
                        return new Axis0FourierProcessor();
                }
void Axis0FourierProcessor::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 753 of file processor.cpp.

References EMAN::EMData::do_fft(), EMAN::EMData::do_ift(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::is_complex(), LOGWARN, nx, ny, EMAN::Processor::params, EMAN::Dict::set_default(), EMAN::EMData::update(), x, and y.

{
        EMData *fft;
        float *fftd;
        int f=0;
//      static float sum1=0,sum1a=0;
//      static double sum2=0,sum2a=0;

        if (!image) {
                LOGWARN("NULL Image");
                return;
        }

        if (!image->is_complex()) {
                fft = image->do_fft();
                fftd = fft->get_data();
                f=1;
        }
        else {
                fft=image;
                fftd=image->get_data();
        }

        int nx=fft->get_xsize();
        int ny=fft->get_ysize();
        if (params.set_default("x",1)) {
                for (int x=2; x<nx; x++) fftd[x]=0;
        }
        if (params.set_default("y",1)) {
                for (int y=1; y<ny; y++) { fftd[y*nx]=0; fftd[y*nx+1]=0; }
        }

        if (f) {
                fft->update();
                EMData *ift=fft->do_ift();
                memcpy(image->get_data(),ift->get_data(),(nx-2)*ny*sizeof(float));
                delete fft;
                delete ift;
        }

        image->update();

}
void EMAN::Axis0FourierProcessor::set_params ( const Dict new_params) [inline, virtual]

Set the processor parameters using a key/value dictionary.

Parameters:
new_paramsA dictionary containing the new parameters.

Reimplemented from EMAN::Processor.

Definition at line 478 of file processor.h.

References EMAN::Processor::params.

                {
                        params = new_params;
                }

Member Data Documentation

const string Axis0FourierProcessor::NAME = "filter.xyaxes0" [static]

Definition at line 501 of file processor.h.

Referenced by get_name().


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