EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all 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]

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. More...
 
virtual string get_name () const
 Get the processor's name. More...
 
virtual string get_desc () const
 Get the descrition of this specific processor. More...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
- Public Member Functions inherited from EMAN::Processor
virtual ~Processor ()
 
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place. More...
 
virtual void process_list_inplace (vector< EMData * > &images)
 To process multiple images using the same algorithm. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- Static Public Member Functions inherited from EMAN::Processor
static string get_group_desc ()
 Get the description of this group of processors. More...
 
static void EMFourierFilterInPlace (EMData *fimage, Dict params)
 Compute a Fourier-filter processed image in place. More...
 
static EMDataEMFourierFilter (EMData *fimage, Dict params)
 Compute a Fourier-processor processed image without altering the original image. More...
 

Static Public Attributes

static const string NAME = "math.xystripefix"
 

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
  TOP_HAT_LOW_PASS , TOP_HAT_HIGH_PASS , TOP_HAT_BAND_PASS , TOP_HOMOMORPHIC ,
  GAUSS_LOW_PASS , GAUSS_HIGH_PASS , GAUSS_BAND_PASS , GAUSS_INVERSE ,
  GAUSS_HOMOMORPHIC , BUTTERWORTH_LOW_PASS , BUTTERWORTH_HIGH_PASS , BUTTERWORTH_HOMOMORPHIC ,
  KAISER_I0 , KAISER_SINH , KAISER_I0_INVERSE , KAISER_SINH_INVERSE ,
  SHIFT , TANH_LOW_PASS , TANH_HIGH_PASS , TANH_HOMOMORPHIC ,
  TANH_BAND_PASS , RADIAL_TABLE , CTF_
}
 Fourier filter Processor type enum. More...
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

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

Member Function Documentation

◆ get_desc()

virtual string EMAN::StripeXYProcessor::get_desc ( ) const
inlinevirtual

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

7449 {
7450 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";
7451 }

◆ get_name()

virtual string EMAN::StripeXYProcessor::get_name ( ) const
inlinevirtual

Get the processor's name.

Each processor is identified by a unique name.

Returns
The processor's name.

Implements EMAN::Processor.

Definition at line 7438 of file processor.h.

7439 {
7440 return NAME;
7441 }
static const string NAME
Definition: processor.h:7461

References NAME.

◆ get_param_types()

virtual TypeDict EMAN::StripeXYProcessor::get_param_types ( ) const
inlinevirtual

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

7454 {
7455 TypeDict d;
7456 d.put("xlen", EMObject::INT, "Integration 1/2 length on x axis in pixels. Default=10");
7457 d.put("ylen", EMObject::INT, "Integration 1/2 length on y axis in pixels. Default=10");
7458 return d;
7459 }
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330

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

◆ NEW()

static Processor * EMAN::StripeXYProcessor::NEW ( )
inlinestatic

Definition at line 7443 of file processor.h.

7444 {
7445 return new StripeXYProcessor();
7446 }
This processor will remove localized 'striping' along the x/y axes, caused by issues with CCD/CMOS re...
Definition: processor.h:7434

◆ process_inplace()

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 7899 of file processor.cpp.

7900{
7901 if (!image) {
7902 LOGWARN("NULL Image");
7903 return;
7904 }
7905 int xlen = params.set_default("xlen",10);
7906 int ylen = params.set_default("ylen",10);
7907
7908 int nx=image->get_attr("nx");
7909 int ny=image->get_attr("ny");
7910 EMData *tmp=new EMData(nx,ny,1);
7911
7912 // we do this in real-space, since the integration size is small, and we don't want Fourier edge effects
7913 // we use a 'moving window' to avoid summing the same points multiple times
7914 // start with y
7915 if (ylen>0) {
7916 for (int x=0; x<nx; x++) {
7917 float sum=0.0;
7918 float sumn=0.0;
7919 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
7920 // now loop over each final pixel
7921 for (int y=0; y<ny; y++) {
7922 if (y+ylen<ny) { sum+=image->get_value_at(x,y+ylen); sumn+=1.0; }
7923 if (y-ylen-1>=0) { sum-=image->get_value_at(x,y-ylen-1); sumn-=1.0; }
7924 tmp->set_value_at_fast(x,y,sum/sumn);
7925 }
7926 }
7927 tmp->write_image("tmp.hdf",0);
7928 image->sub(*tmp);
7929 }
7930
7931 // now x
7932 if (xlen>0) {
7933 for (int y=0; y<ny; y++) {
7934 float sum=0.0;
7935 float sumn=0.0;
7936 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
7937 // now loop over each final pixel
7938 for (int x=0; x<nx; x++) {
7939 if (x+xlen<nx) { sum+=image->get_value_at(x+xlen,y); sumn+=1.0; }
7940 if (x-xlen-1>=0) { sum-=image->get_value_at(x-xlen-1,y); sumn-=1.0; }
7941 tmp->set_value_at_fast(x,y,sum/sumn);
7942 }
7943 }
7944 tmp->write_image("tmp.hdf",1);
7945 image->sub(*tmp);
7946 }
7947
7948 delete tmp;
7949}
type set_default(const string &key, type val)
Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there wa...
Definition: emobject.h:569
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
#define LOGWARN
Definition: log.h:53
#define y(i, j)
Definition: projector.cpp:1516
#define x(i)
Definition: projector.cpp:1517

References LOGWARN, EMAN::Processor::params, EMAN::Dict::set_default(), x, and y.

Member Data Documentation

◆ NAME

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

Definition at line 7461 of file processor.h.

Referenced by get_name().


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