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

EMAN::TestImageScurve Class Reference

Replace a source image with a lumpy S-curve used for alignment testing. More...

#include <processor.h>

Inheritance diagram for EMAN::TestImageScurve:

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

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

ProcessorNEW ()

Static Public Attributes

const string NAME = "testimage.scurve"

Detailed Description

Replace a source image with a lumpy S-curve used for alignment testing.

Definition at line 5946 of file processor.h.


Member Function Documentation

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

05957                 {
05958                         return "Replace a source image with a lumpy S-curve used for alignment testing";
05959                 }

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

05952                 {
05953                         return NAME;
05954                 }

virtual TypeDict EMAN::TestImageScurve::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 5966 of file processor.h.

05967                 {
05968                         TypeDict d;
05969                         return d;
05970                 }

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

Definition at line 5961 of file processor.h.

05962                 {
05963                         return new TestImageScurve();
05964                 }

void TestImageScurve::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 7108 of file processor.cpp.

References EMAN::EMData::get_ndim(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), ImageDimensionException, nx, ny, EMAN::TestImageProcessor::preprocess(), EMAN::EMData::to_zero(), EMAN::EMData::update(), x, and y.

07109 {
07110         preprocess(image);
07111 
07112         int dim_size = image->get_ndim();
07113         if( 2 != dim_size ) {
07114                 throw ImageDimensionException("works for 2D images only");
07115         }
07116 
07117         int nx = image->get_xsize();
07118         int ny = image->get_ysize();
07119         image->to_zero();
07120 
07121         for (int i=0; i<100; i++) {
07122                 int x=static_cast<int>( nx/2+nx/6.0*sin(i*2.0*3.14159/100.0) );
07123                 int y=ny/4+i*ny/200;
07124                 for (int xx=x-nx/10; xx<x+nx/10; xx++) {
07125                         for (int yy=y-ny/10; yy<y+ny/10; yy++) {
07126 #ifdef  _WIN32
07127                                 (*image)(xx,yy)+=exp(-pow(static_cast<float>(_hypot(xx-x,yy-y))*30.0f/nx,2.0f))*(sin(static_cast<float>((xx-x)*(yy-y)))+.5f);
07128 #else
07129                                 (*image)(xx,yy)+=exp(-pow(static_cast<float>(hypot(xx-x,yy-y))*30.0f/nx,2.0f))*(sin(static_cast<float>((xx-x)*(yy-y)))+.5f);
07130 #endif
07131                         }
07132                 }
07133         }
07134 
07135         image->update();
07136 }


Member Data Documentation

const string TestImageScurve::NAME = "testimage.scurve" [static]
 

Definition at line 194 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Thu Dec 9 13:48:22 2010 for EMAN2 by  doxygen 1.3.9.1