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

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

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 2304 of file processor.h.


Constructor & Destructor Documentation

EMAN::CoordinateProcessor::CoordinateProcessor  )  [inline]
 

Definition at line 2307 of file processor.h.

References is_complex(), nx, and ny.

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


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 2319 of file processor.h.

Referenced by process_inplace().

02320                 {
02321                 }

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 2312 of file processor.h.

02313                 {
02314                         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().";
02315                 }

virtual bool EMAN::CoordinateProcessor::is_valid  )  const [inline, protected, virtual]
 

Reimplemented in EMAN::CircularMaskProcessor.

Definition at line 2322 of file processor.h.

Referenced by process_inplace().

02323                 {
02324                         return true;
02325                 }

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

Implements EMAN::Processor.

Definition at line 1319 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.

01320 {
01321         if (!image) {
01322                 LOGWARN("NULL Image");
01323                 return;
01324         }
01325 
01326         maxval = image->get_attr("maximum");
01327         mean = image->get_attr("mean");
01328         sigma = image->get_attr("sigma");
01329         nx = image->get_xsize();
01330         ny = image->get_ysize();
01331         nz = image->get_zsize();
01332         is_complex = image->is_complex();
01333 
01334         calc_locals(image);
01335 
01336 
01337         if (!is_valid()) {
01338                 return;
01339         }
01340 
01341         float *data = image->get_data();
01342         size_t i = 0;
01343 
01344         for (int z = 0; z < nz; z++) {
01345                 for (int y = 0; y < ny; y++) {
01346                         for (int x = 0; x < nx; x++) {
01347                                 process_pixel(&data[i], x, y, z);
01348                                 ++i;
01349                         }
01350                 }
01351         }
01352         image->update();
01353 }

virtual void EMAN::CoordinateProcessor::process_pixel float *  pixel,
int  xi,
int  yi,
int  zi
const [protected, pure virtual]
 

Implemented in EMAN::CircularMaskProcessor, and EMAN::MaskGaussNonuniformProcessor.

Referenced by process_inplace().


Member Data Documentation

bool EMAN::CoordinateProcessor::is_complex [protected]
 

Definition at line 2334 of file processor.h.

Referenced by process_inplace().

float EMAN::CoordinateProcessor::maxval [protected]
 

Definition at line 2332 of file processor.h.

Referenced by process_inplace().

float EMAN::CoordinateProcessor::mean [protected]
 

Definition at line 2330 of file processor.h.

Referenced by process_inplace().

int EMAN::CoordinateProcessor::nx [protected]
 

Definition at line 2327 of file processor.h.

Referenced by process_inplace().

int EMAN::CoordinateProcessor::ny [protected]
 

Definition at line 2328 of file processor.h.

Referenced by process_inplace().

int EMAN::CoordinateProcessor::nz [protected]
 

Definition at line 2329 of file processor.h.

Referenced by process_inplace().

float EMAN::CoordinateProcessor::sigma [protected]
 

Definition at line 2331 of file processor.h.

Referenced by process_inplace().


The documentation for this class was generated from the following files:
Generated on Tue Jun 11 13:42:21 2013 for EMAN2 by  doxygen 1.3.9.1