EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
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

static ProcessorNEW ()

Static Public Attributes

static 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:
thresholdan isosurface threshold at which all desired features are visible
radiusa normalization size similar to an lp= value
apixAngstrom per pixel ratio

Definition at line 5719 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 5734 of file processor.h.

                {
                        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";
                }
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 5724 of file processor.h.

References NAME.

                {
                        return NAME;
                }
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 5739 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("xlen", EMObject::INT, "Integration 1/2 length on x axis in pixels. Default=10");
                        d.put("ylen", EMObject::INT, "Integration 1/2 length on y axis in pixels. Default=10");
                        return d;
                }
static Processor* EMAN::StripeXYProcessor::NEW ( ) [inline, static]

Definition at line 5729 of file processor.h.

                {
                        return new StripeXYProcessor();
                }
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:
imageThe image to be processed.

Implements EMAN::Processor.

Definition at line 6348 of file processor.cpp.

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

{
        if (!image) {
                LOGWARN("NULL Image");
                return;
        }
        int xlen = params.set_default("xlen",10);
        int ylen = params.set_default("ylen",10);

        int nx=image->get_attr("nx");
        int ny=image->get_attr("ny");
        EMData *tmp=new EMData(nx,ny,1);

        // we do this in real-space, since the integration size is small, and we don't want Fourier edge effects
        // we use a 'moving window' to avoid summing the same points multiple times
        // start with y
        if (ylen>0) {
                for (int x=0; x<nx; x++) {
                        float sum=0.0;
                        float sumn=0.0;
                        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
                        // now loop over each final pixel
                        for (int y=0; y<ny; y++) {
                                if (y+ylen<ny) { sum+=image->get_value_at(x,y+ylen); sumn+=1.0; }
                                if (y-ylen-1>=0) { sum-=image->get_value_at(x,y-ylen-1); sumn-=1.0; }
                                tmp->set_value_at_fast(x,y,sum/sumn);
                        }
                }
                tmp->write_image("tmp.hdf",0);
                image->sub(*tmp);
        }

        // now x
        if (xlen>0) {
                for (int y=0; y<ny; y++) {
                        float sum=0.0;
                        float sumn=0.0;
                        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
                        // now loop over each final pixel
                        for (int x=0; x<nx; x++) {
                                if (x+xlen<nx) { sum+=image->get_value_at(x+xlen,y); sumn+=1.0; }
                                if (x-xlen-1>=0) { sum-=image->get_value_at(x-xlen-1,y); sumn-=1.0; }
                                tmp->set_value_at_fast(x,y,sum/sumn);
                        }
                }
                tmp->write_image("tmp.hdf",1);
                image->sub(*tmp);
        }

        delete tmp;
}

Member Data Documentation

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

Definition at line 5747 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: