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

EMAN::XYZProcessor Class Reference

XYZProcessor is a processor template for defining new processors. More...

#include <processor_template.h>

Inheritance diagram for EMAN::XYZProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

void process_inplace (EMData *image)
 define your Processor operation
string get_name () const
 Get the processor's name.
string get_desc () const
 Get the descrition of this specific processor.
TypeDict get_param_types () const
 Add your processor parameter names and types in get_param_types().

Static Public Member Functions

ProcessorNEW ()

Static Public Attributes

const string NAME = "xyz"

Detailed Description

XYZProcessor is a processor template for defining new processors.

Please add your own code at the proper place.

1) Replace all 'XYZ' with your new processor name. 2) Define the processor parameter names and types in get_param_types(). 3) Implement the processor in XYZProcessor::process_inplace().

Definition at line 48 of file processor_template.h.


Member Function Documentation

string EMAN::XYZProcessor::get_desc  )  const [inline, virtual]
 

Get the descrition of this specific processor.

This function must be overwritten by a subclass.

Returns:
The description of this processor.

Implements EMAN::Processor.

Definition at line 63 of file processor_template.h.

00064                 {
00065                         return "add your documentation here.";
00066                 }

string EMAN::XYZProcessor::get_name  )  const [inline, virtual]
 

Get the processor's name.

Each processor is identified by a unique name.

Returns:
The processor's name.

Implements EMAN::Processor.

Definition at line 53 of file processor_template.h.

00054                 {
00055                         return NAME;
00056                 }

TypeDict EMAN::XYZProcessor::get_param_types  )  const [inline, virtual]
 

Add your processor parameter names and types in get_param_types().

For available parameter types, please refer class EMObject.

As an example, XYZProcessor has 2 parameters: int value1; float value2;

Reimplemented from EMAN::Processor.

Definition at line 76 of file processor_template.h.

References EMAN::TypeDict::put().

00077                 {
00078                         TypeDict d;
00079                         d.put("value1", EMObject::INT);
00080                         d.put("value2", EMObject::FLOAT);
00081                         return d;
00082                 }

Processor* EMAN::XYZProcessor::NEW  )  [inline, static]
 

Definition at line 58 of file processor_template.h.

00059                 {
00060                         return new XYZProcessor();
00061                 }

void XYZProcessor::process_inplace EMData image  )  [virtual]
 

define your Processor operation

Implements EMAN::Processor.

Definition at line 41 of file processor_template.cpp.

References data, EMAN::EMData::get_data(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), and EMAN::EMData::get_zsize().

00042 {
00043         if (!image) {
00044                 return;
00045         }
00046 
00047 
00048         // The following are the sample code to get your parameters. Then
00049         // go through the image data pixel.
00050 #if 0
00051         int value1 = params["value1"];
00052         float value2 = params["value2"];
00053 
00054         float *data = image->get_data();
00055         int size = image->get_xsize() * image->get_ysize() * image->get_zsize();
00056         for (int i = 0; i < size; i++) {
00057                 if (data[i] <= value1 && data[i] >= value2) {
00058                         data[i] = 0;
00059                 }
00060         }
00061 #endif
00062 
00063 }


Member Data Documentation

const string XYZProcessor::NAME = "xyz" [static]
 

Definition at line 37 of file processor_template.cpp.


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