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

EMAN::StripeXYProcessor Class Reference

This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS readout. More...

#include <processor.h>

Inheritance diagram for EMAN::StripeXYProcessor:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

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 = "math.xystripefix"

Detailed Description

This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS readout.

In theory this should be done by dark/gain correction, but in many cases, there are residual effects that this will help eliminate.

Parameters:
threshold an isosurface threshold at which all desired features are visible
radius a normalization size similar to an lp= value
apix Angstrom per pixel ratio

Definition at line 5348 of file processor.h.


Member Function Documentation

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

05364                 {
05365                         return "This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS readout. In theory this should be done by dark/gain correction, but in many cases, there are residual effects that this will help eliminate. This can produce high-pass filter-like effects, so generally large length values are suggested. Integration covers +-xlen/ylen. Y and X axes are corrected sequentially, not simultaneously, Y first";
05366                 }

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

05354                 {
05355                         return NAME;
05356                 }

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

References EMAN::TypeDict::put().

05369                 {
05370                         TypeDict d;
05371                         d.put("xlen", EMObject::INT, "Integration 1/2 length on x axis in pixels. Default=10");
05372                         d.put("ylen", EMObject::INT, "Integration 1/2 length on y axis in pixels. Default=10");
05373                         return d;
05374                 }

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

Definition at line 5358 of file processor.h.

05359                 {
05360                         return new StripeXYProcessor();
05361                 }

void StripeXYProcessor::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 6002 of file processor.cpp.

References EMAN::EMData::get_attr(), EMAN::EMData::get_value_at(), LOGWARN, nx, ny, EMAN::Dict::set_default(), EMAN::EMData::set_value_at_fast(), EMAN::EMData::sub(), EMAN::EMData::write_image(), x, and y.

06003 {
06004         if (!image) {
06005                 LOGWARN("NULL Image");
06006                 return;
06007         }
06008         int xlen = params.set_default("xlen",10);
06009         int ylen = params.set_default("ylen",10);
06010 
06011         int nx=image->get_attr("nx");
06012         int ny=image->get_attr("ny");
06013         EMData *tmp=new EMData(nx,ny,1);
06014         
06015         // we do this in real-space, since the integration size is small, and we don't want Fourier edge effects
06016         // we use a 'moving window' to avoid summing the same points multiple times 
06017         // start with y
06018         if (ylen>0) {
06019                 for (int x=0; x<nx; x++) {
06020                         float sum=0.0;
06021                         float sumn=0.0;
06022                         for (int y=0; y<(ylen<ny?ylen:ny); y++) { sum+=image->get_value_at(x,y); sumn+=1.0; } // we seed the process with a 1/2 stripe
06023                         // now loop over each final pixel
06024                         for (int y=0; y<ny; y++) {
06025                                 if (y+ylen<ny) { sum+=image->get_value_at(x,y+ylen); sumn+=1.0; }
06026                                 if (y-ylen-1>=0) { sum-=image->get_value_at(x,y-ylen-1); sumn-=1.0; }
06027                                 tmp->set_value_at_fast(x,y,sum/sumn);
06028                         }
06029                 }
06030                 tmp->write_image("tmp.hdf",0);
06031                 image->sub(*tmp);
06032         }
06033         
06034         // now x
06035         if (xlen>0) {
06036                 for (int y=0; y<ny; y++) {
06037                         float sum=0.0;
06038                         float sumn=0.0;
06039                         for (int x=0; x<(xlen<nx?xlen:nx); x++) { sum+=image->get_value_at(x,y); sumn+=1.0; } // we seed the process with a 1/2 stripe
06040                         // now loop over each final pixel
06041                         for (int x=0; x<nx; x++) {
06042                                 if (x+xlen<nx) { sum+=image->get_value_at(x+xlen,y); sumn+=1.0; }
06043                                 if (x-xlen-1>=0) { sum-=image->get_value_at(x-xlen-1,y); sumn-=1.0; }
06044                                 tmp->set_value_at_fast(x,y,sum/sumn);
06045                         }
06046                 }
06047                 tmp->write_image("tmp.hdf",1);
06048                 image->sub(*tmp);
06049         }
06050         
06051         delete tmp;
06052 }


Member Data Documentation

const string StripeXYProcessor::NAME = "math.xystripefix" [static]
 

Definition at line 178 of file processor.cpp.


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