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

EMAN::TestImageLineWave Class Reference

Treats the pixels as though they are 1D (even if the image is 2D or 3D), inserting a sine wave of pixel period extracted from the parameters (default is 10). More...

#include <processor.h>

Inheritance diagram for EMAN::TestImageLineWave:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void process_inplace (EMData *image)
 To process an image in-place.
virtual string get_name () const
 Get the processor's name.
virtual string get_desc () const
 Get the descrition of this specific processor.
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary.

Static Public Member Functions

static ProcessorNEW ()

Static Public Attributes

static const string NAME = "testimage.linewave"

Detailed Description

Treats the pixels as though they are 1D (even if the image is 2D or 3D), inserting a sine wave of pixel period extracted from the parameters (default is 10).

Parameters:
period the period of the sine wave

Definition at line 5970 of file processor.h.


Member Function Documentation

virtual string EMAN::TestImageLineWave::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 5980 of file processor.h.

05981                         {
05982                                 return "Insert an oscillating sine wave into the pixel data";
05983                         }

virtual string EMAN::TestImageLineWave::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 5975 of file processor.h.

References NAME.

05976                         {
05977                                 return NAME;
05978                         }

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

Get processor parameter information in a dictionary.

Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 5990 of file processor.h.

References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().

05991                         {
05992                                 TypeDict d;
05993                                 d.put("period", EMObject::FLOAT, "The period of the oscillating sine wave. Default 10.");
05994                                 return d;
05995                         }

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

Definition at line 5985 of file processor.h.

05986                         {
05987                                 return new TestImageLineWave();
05988                         }

void TestImageLineWave::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 7015 of file processor.cpp.

References EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), EMAN::EMData::get_zsize(), EMAN::Processor::params, EMAN::EMConsts::pi, EMAN::TestImageProcessor::preprocess(), EMAN::Dict::set_default(), EMAN::EMData::set_value_at_fast(), and x.

07016 {
07017         preprocess(image);
07018 
07019         float period = params.set_default("period",10.0f);
07020         int n = image->get_xsize()*image->get_ysize()*image->get_zsize();
07021 
07022         for(int i = 0; i < n; ++i) {
07023                 float x = fmod((float)i,period);
07024                 x /= period;
07025                 x = (float)sin(x*EMConsts::pi*2.0);
07026                 image->set_value_at_fast(i,x);
07027         }
07028 }


Member Data Documentation

const string TestImageLineWave::NAME = "testimage.linewave" [static]
 

Definition at line 5997 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Mon Jul 19 13:07:21 2010 for EMAN2 by  doxygen 1.4.4