#include <processor.h>
Inheritance diagram for EMAN::LocalNormProcessor:
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 Processor * | NEW () |
Static Public Attributes | |
static const string | NAME = "normalize.local" |
threshold is an isosurface threshold at which all desired features are visible, radius is a normalization size similar to an lp= value.
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 5385 of file processor.h.
virtual string EMAN::LocalNormProcessor::get_desc | ( | ) | const [inline, virtual] |
Get the descrition of this specific processor.
This function must be overwritten by a subclass.
Implements EMAN::Processor.
Definition at line 5400 of file processor.h.
05401 { 05402 return "This processor attempts to perform a 'local normalization' so low density and high density features will be on a more even playing field in an isosurface display. threshold is an isosurface threshold at which all desired features are visible, radius is a feature size over which to equalize."; 05403 }
virtual string EMAN::LocalNormProcessor::get_name | ( | ) | const [inline, virtual] |
Get the processor's name.
Each processor is identified by a unique name.
Implements EMAN::Processor.
Definition at line 5390 of file processor.h.
References NAME.
05391 { 05392 return NAME; 05393 }
virtual TypeDict EMAN::LocalNormProcessor::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.
Reimplemented from EMAN::Processor.
Definition at line 5405 of file processor.h.
References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
05406 { 05407 TypeDict d; 05408 d.put("threshold", EMObject::FLOAT, "Only values above the threshold will be used to compute the normalization. Generally a good isosurface value."); 05409 d.put("radius", EMObject::FLOAT, "Fourier filter radius expressed in pixels in Fourier space. cutoff_pixels in filter.lowpass.gauss"); 05410 d.put("apix", EMObject::FLOAT, "Angstroms per pixel"); 05411 return d; 05412 }
static Processor* EMAN::LocalNormProcessor::NEW | ( | ) | [inline, static] |
void LocalNormProcessor::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.
image | The image to be processed. |
Implements EMAN::Processor.
Definition at line 6055 of file processor.cpp.
References EMAN::EMData::copy(), EMAN::EMData::div(), EMAN::EMData::get_ysize(), LOGWARN, EMAN::EMData::mult(), EMAN::Processor::params, and EMAN::EMData::process_inplace().
06056 { 06057 if (!image) { 06058 LOGWARN("NULL Image"); 06059 return; 06060 } 06061 float apix = params["apix"]; 06062 float threshold = params["threshold"]; 06063 float radius = params["radius"]; 06064 06065 if (apix > 0) { 06066 int ny = image->get_ysize(); 06067 radius = ny * apix / radius; 06068 //printf("Norm filter radius=%1.1f\n", radius); 06069 } 06070 06071 EMData *blur = image->copy(); 06072 EMData *maskblur = image->copy(); 06073 06074 maskblur->process_inplace("threshold.binary", Dict("value", threshold)); 06075 maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 06076 // maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f)); 06077 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 06078 // maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 06079 06080 06081 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold)); 06082 blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 06083 // blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f)); 06084 06085 maskblur->div(*blur); 06086 image->mult(*maskblur); 06087 // maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC); 06088 06089 if( maskblur ) 06090 { 06091 delete maskblur; 06092 maskblur = 0; 06093 } 06094 06095 if( blur ) 06096 { 06097 delete blur; 06098 blur = 0; 06099 } 06100 }
const string LocalNormProcessor::NAME = "normalize.local" [static] |