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

EMAN::RotationalSubstractProcessor Class Reference

subtracts circularly symmetric part of an image. More...

#include <processor.h>

Inheritance diagram for EMAN::RotationalSubstractProcessor:

[legend]
Collaboration diagram for EMAN::RotationalSubstractProcessor:
[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.

Static Public Member Functions

ProcessorNEW ()

Static Public Attributes

const string NAME = "math.rotationalsubtract"

Detailed Description

subtracts circularly symmetric part of an image.

Definition at line 4427 of file processor.h.


Member Function Documentation

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

04443                 {
04444                         return "subtracts circularly/spherically symmetric part of an image.";
04445                 }

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

04433                 {
04434                         return NAME;
04435                 }

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

Definition at line 4437 of file processor.h.

04438                 {
04439                         return new RotationalSubstractProcessor();
04440                 }

void RotationalSubstractProcessor::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 4144 of file processor.cpp.

References EMAN::EMData::calc_radial_dist(), dist(), EMAN::EMData::get_data(), EMAN::EMData::get_ndim(), EMAN::EMData::get_xsize(), EMAN::EMData::get_ysize(), ImageDimensionException, EMAN::EMData::is_complex(), LOGWARN, nx, ny, rdata, EMAN::EMData::update(), x, and y.

04145 {
04146         if (!image || image->is_complex()) {
04147                 LOGWARN("only works on real image. do nothing.");
04148                 return;
04149         }
04150 
04151         if (image->get_ndim() != 2) throw ImageDimensionException("This processor works only for 2D images");
04152 
04153         float *rdata = image->get_data();
04154         int nx = image->get_xsize();
04155         int ny = image->get_ysize();
04156 
04157         vector < float >dist = image->calc_radial_dist(nx / 2, 0, 1,0);
04158 
04159         int c = 0;
04160         for (int y = 0; y < ny; y++) {
04161                 for (int x = 0; x < nx; x++, c++) {
04162 #ifdef  _WIN32
04163                         float r = (float) _hypot(x - nx / 2, y - ny / 2);
04164 #else
04165                         float r = (float) hypot(x - nx / 2, y - ny / 2);
04166 #endif
04167                         int i = (int) floor(r);
04168                         r -= i;
04169                         if (i >= 0 && i < nx / 2 - 1) {
04170                                 rdata[c] -= dist[i] * (1.0f - r) + dist[i + 1] * r;
04171                         }
04172                         else {
04173                                 rdata[c] = 0;
04174                         }
04175                 }
04176         }
04177 
04178         image->update();
04179 }


Member Data Documentation

const string RotationalSubstractProcessor::NAME = "math.rotationalsubtract" [static]
 

Definition at line 155 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Fri Apr 30 15:39:25 2010 for EMAN2 by  doxygen 1.3.9.1