EMAN2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
EMAN::CoordinateProcessor Class Reference

CoordinateProcessor applies processing based on a pixel's value and it coordinates. More...

#include <processor.h>

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

List of all members.

Public Member Functions

 CoordinateProcessor ()
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 *pixel, int xi, int yi, int zi) const =0
virtual void calc_locals (EMData *)
virtual bool is_valid () const

Protected Attributes

int nx
int ny
int nz
float mean
float sigma
float maxval
bool is_complex

Detailed Description

CoordinateProcessor applies processing based on a pixel's value and it coordinates.

This is the base class. Specific coordinate processor should implement process_pixel().

Definition at line 2437 of file processor.h.


Constructor & Destructor Documentation

EMAN::CoordinateProcessor::CoordinateProcessor ( ) [inline]

Definition at line 2440 of file processor.h.

                                     :nx(0), ny(0), nz(0), mean(0), sigma(0), maxval(0), is_complex(false)
                {
                }

Member Function Documentation

virtual void EMAN::CoordinateProcessor::calc_locals ( EMData ) [inline, protected, virtual]

Reimplemented in EMAN::CircularMaskProcessor, EMAN::MaskEdgeMeanProcessor, and EMAN::MaskGaussInvProcessor.

Definition at line 2452 of file processor.h.

Referenced by process_inplace().

                {
                }
static string EMAN::CoordinateProcessor::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 2445 of file processor.h.

                {
                        return "CoordinateProcessor applies processing based on a pixel's value and it coordinates. This is the base class. Specific coordinate processor should implement process_pixel().";
                }
virtual bool EMAN::CoordinateProcessor::is_valid ( ) const [inline, protected, virtual]

Reimplemented in EMAN::CircularMaskProcessor.

Definition at line 2455 of file processor.h.

Referenced by process_inplace().

                {
                        return true;
                }
void CoordinateProcessor::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 1480 of file processor.cpp.

References calc_locals(), data, EMAN::EMData::get_attr(), EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::EMData::is_complex(), is_complex, is_valid(), LOGWARN, maxval, mean, nx, ny, nz, process_pixel(), sigma, EMAN::EMData::update(), x, and y.

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

        maxval = image->get_attr("maximum");
        mean = image->get_attr("mean");
        sigma = image->get_attr("sigma");
        nx = image->get_xsize();
        ny = image->get_ysize();
        nz = image->get_zsize();
        is_complex = image->is_complex();

        calc_locals(image);


        if (!is_valid()) {
                return;
        }

        float *data = image->get_data();
        size_t i = 0;

        for (int z = 0; z < nz; z++) {
                for (int y = 0; y < ny; y++) {
                        for (int x = 0; x < nx; x++) {
                                process_pixel(&data[i], x, y, z);
                                ++i;
                        }
                }
        }
        image->update();
}
virtual void EMAN::CoordinateProcessor::process_pixel ( float *  pixel,
int  xi,
int  yi,
int  zi 
) const [protected, pure virtual]

Member Data Documentation

Definition at line 2467 of file processor.h.

Referenced by EMAN::CircularMaskProcessor::is_valid(), and process_inplace().

Definition at line 2465 of file processor.h.

Referenced by process_inplace().

Definition at line 2463 of file processor.h.

Referenced by EMAN::MaskNoiseProcessor::process_dist_pixel(), and process_inplace().

Definition at line 2464 of file processor.h.

Referenced by EMAN::MaskNoiseProcessor::process_dist_pixel(), and process_inplace().


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