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

This processor performs fast convolution in Fourier space. More...

#include <processor.h>

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

List of all members.

Public Member Functions

 ConvolutionProcessor ()
string get_name () const
 Get the processor's name.
void process_inplace (EMData *image)
 To process an image in-place.
string get_desc () const
 Get the descrition of this specific processor.
TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "math.convolution"

Detailed Description

This processor performs fast convolution in Fourier space.

Author:
David Woolford
Date:
2007/12/04
Parameters:
withThe image that will convolute the other image

Definition at line 559 of file processor.h.


Constructor & Destructor Documentation

EMAN::ConvolutionProcessor::ConvolutionProcessor ( ) [inline]

Definition at line 562 of file processor.h.

Referenced by NEW().

{}

Member Function Documentation

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

                        {
                                return "Performs Fourier space convolution. Maintains the space that the image is in - i.e. if image is real, the result is real and vice versa.";
                        }
string EMAN::ConvolutionProcessor::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 564 of file processor.h.

References NAME.

                        {
                                return NAME;
                        }
TypeDict EMAN::ConvolutionProcessor::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 581 of file processor.h.

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

                        {
                                TypeDict d;
                                d.put("with", EMObject::EMDATA, "The image that will convolute the other image");
                                return d;
                        }
static Processor* EMAN::ConvolutionProcessor::NEW ( ) [inline, static]

Definition at line 571 of file processor.h.

References ConvolutionProcessor().

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

References EMAN::CIRCULANT, EMAN::CONVOLUTION, EMAN::fourierproduct(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), InvalidParameterException, EMAN::Processor::params, EMAN::Dict::set_default(), and EMAN::EMData::update().

{
        //bool complexflag = false;
        EMData* null = 0;
        EMData* with = params.set_default("with", null);
        if ( with == NULL ) throw InvalidParameterException("Error - the image required for the convolution is null");

        EMData* newimage = fourierproduct(image, with, CIRCULANT, CONVOLUTION, false);

        float* orig = image->get_data();
        float* work = newimage->get_data();
        int nx  = image->get_xsize();
        int ny  = image->get_ysize();
        int nz  = image->get_zsize();
        memcpy(orig,work,nx*ny*nz*sizeof(float));
        image->update();

        delete newimage;
}

Member Data Documentation

const string ConvolutionProcessor::NAME = "math.convolution" [static]

Definition at line 588 of file processor.h.

Referenced by get_name().


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