#include <processor.h>
Inheritance diagram for EMAN::StripeXYProcessor:
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 | |
Processor * | NEW () |
Static Public Attributes | |
const string | NAME = "math.xystripefix" |
In theory this should be done by dark/gain correction, but in many cases, there are residual effects that this will help eliminate.
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.
|
Get the descrition of this specific processor. This function must be overwritten by a subclass.
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 }
|
|
Get the processor's name. Each processor is identified by a unique name.
Implements EMAN::Processor. Definition at line 5353 of file processor.h. 05354 {
05355 return NAME;
05356 }
|
|
Get processor parameter information in a dictionary. Each parameter has one record in the dictionary. Each record contains its name, data-type, and description.
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 }
|
|
Definition at line 5358 of file processor.h. 05359 { 05360 return new StripeXYProcessor(); 05361 }
|
|
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.
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 }
|
|
Definition at line 178 of file processor.cpp. |