EMAN2
Public Member Functions | Static Public Member Functions | Protected Member Functions
EMAN::ImageProcessor Class Reference

#include <processor.h>

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

List of all members.

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place.

Static Public Member Functions

static string get_group_desc ()
 Get the description of this group of processors.

Protected Member Functions

virtual EMDatacreate_processor_image () const =0

Detailed Description

Definition at line 316 of file processor.h.


Member Function Documentation

virtual EMData* EMAN::ImageProcessor::create_processor_image ( ) const [protected, pure virtual]

Referenced by process_inplace().

static string EMAN::ImageProcessor::get_group_desc ( ) [inline, static]

Get the description of this group of processors.

This function is defined in a parent class. It gives a introduction to a group of processors.

Returns:
The description of this group of processors.

Reimplemented from EMAN::Processor.

Definition at line 321 of file processor.h.

                {
                        return "An Image Processor defines a way to create a processor image. The processor image is used to multiply the input-image in the fourier space. ImageFilter class is the base class. Each specific ImageFilter class must define function create_processor_image(). ";
                }
void ImageProcessor::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 527 of file processor.cpp.

References create_processor_image(), data, EMAN::EMData::do_fft(), EMAN::EMData::do_ift(), EMAN::EMData::get_data(), EMAN::EMData::is_complex(), LOGWARN, t, and EMAN::EMData::update().

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

        EMData *processor_image = create_processor_image();

        if (image->is_complex()) {
                (*image) *= *processor_image;
        }
        else {
                EMData *fft = image->do_fft();
                (*fft) *= (*processor_image);
                EMData *ift = fft->do_ift();

                float *data = image->get_data();
                float *t = data;
                float *ift_data = ift->get_data();

                data = ift_data;
                ift_data = t;

                ift->update();

                if( fft )
                {
                        delete fft;
                        fft = 0;
                }

                if( ift )
                {
                        delete ift;
                        ift = 0;
                }
        }

        image->update();
}

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