EMAN::ComplexPixelProcessor Class Reference

The base class for fourier space processor working on individual pixels. More...

#include <processor.h>

Inheritance diagram for EMAN::ComplexPixelProcessor:

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

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 void process_pixel (float *x) const =0


Detailed Description

The base class for fourier space processor working on individual pixels.

ri2ap() is called before processing, so individual pixels will be A/P rather than R/I. The processor won't consider the pixel's coordinates and neighbors.

Definition at line 2567 of file processor.h.


Member Function Documentation

void ComplexPixelProcessor::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 1111 of file processor.cpp.

References EMAN::EMData::ap2ri(), data, EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::EMData::is_complex(), LOGWARN, process_pixel(), EMAN::EMData::ri2ap(), and EMAN::EMData::update().

01112 {
01113         if (!image) {
01114                 LOGWARN("NULL image");
01115                 return;
01116         }
01117         if (!image->is_complex()) {
01118                 LOGWARN("cannot apply complex processor on a real image. Nothing is done.");
01119                 return;
01120         }
01121 
01122         size_t size = (size_t)image->get_xsize() *
01123                           (size_t)image->get_ysize() *
01124                           (size_t)image->get_zsize();
01125         float *data = image->get_data();
01126 
01127         image->ri2ap();
01128 
01129         for (size_t i = 0; i < size; i += 2) {
01130                 process_pixel(data);
01131                 data += 2;
01132         }
01133 
01134         image->update();
01135         image->ap2ri();
01136 }

static string EMAN::ComplexPixelProcessor::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 2572 of file processor.h.

02573                 {
02574                         return "The base class for fourier space processor working on individual pixels. ri2ap() is called before processing, so individual pixels will be A/P rather than R/I. The processor won't consider the pixel's coordinates and neighbors.";
02575                 }

virtual void EMAN::ComplexPixelProcessor::process_pixel ( float *  x  )  const [protected, pure virtual]

Implemented in EMAN::ComplexNormPixel.

Referenced by process_inplace().


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

Generated on Sat Nov 21 02:20:28 2009 for EMAN2 by  doxygen 1.5.6