Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

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

Protected Member Functions

virtual EMDatacreate_processor_image () const =0

Member Function Documentation

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

Referenced by process_inplace().

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.

00322                 {
00323                         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(). ";
00324                 }

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:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 485 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().

00486 {
00487         if (!image) {
00488                 LOGWARN("NULL image");
00489                 return;
00490         }
00491 
00492         EMData *processor_image = create_processor_image();
00493 
00494         if (image->is_complex()) {
00495                 (*image) *= *processor_image;
00496         }
00497         else {
00498                 EMData *fft = image->do_fft();
00499                 (*fft) *= (*processor_image);
00500                 EMData *ift = fft->do_ift();
00501 
00502                 float *data = image->get_data();
00503                 float *t = data;
00504                 float *ift_data = ift->get_data();
00505 
00506                 data = ift_data;
00507                 ift_data = t;
00508 
00509                 ift->update();
00510 
00511                 if( fft )
00512                 {
00513                         delete fft;
00514                         fft = 0;
00515                 }
00516 
00517                 if( ift )
00518                 {
00519                         delete ift;
00520                         ift = 0;
00521                 }
00522         }
00523 
00524         image->update();
00525 }


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 13:47:36 2010 for EMAN2 by  doxygen 1.3.9.1