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:

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

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.

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

04525                 {
04526                         return "subtracts circularly/spherically symmetric part of an image.";
04527                 }

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

04515                 {
04516                         return NAME;
04517                 }

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

Definition at line 4519 of file processor.h.

04520                 {
04521                         return new RotationalSubstractProcessor();
04522                 }

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 4322 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.

04323 {
04324         if (!image || image->is_complex()) {
04325                 LOGWARN("only works on real image. do nothing.");
04326                 return;
04327         }
04328 
04329         if (image->get_ndim() != 2) throw ImageDimensionException("This processor works only for 2D images");
04330 
04331         float *rdata = image->get_data();
04332         int nx = image->get_xsize();
04333         int ny = image->get_ysize();
04334 
04335         vector < float >dist = image->calc_radial_dist(nx / 2, 0, 1,0);
04336 
04337         int c = 0;
04338         for (int y = 0; y < ny; y++) {
04339                 for (int x = 0; x < nx; x++, c++) {
04340 #ifdef  _WIN32
04341                         float r = (float) _hypot(x - nx / 2, y - ny / 2);
04342 #else
04343                         float r = (float) hypot(x - nx / 2, y - ny / 2);
04344 #endif
04345                         int i = (int) floor(r);
04346                         r -= i;
04347                         if (i >= 0 && i < nx / 2 - 1) {
04348                                 rdata[c] -= dist[i] * (1.0f - r) + dist[i + 1] * r;
04349                         }
04350                         else {
04351                                 rdata[c] = 0;
04352                         }
04353                 }
04354         }
04355 
04356         image->update();
04357 }


Member Data Documentation

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

Definition at line 156 of file processor.cpp.


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