#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 5299 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 5314 of file processor.h.
05315 { 05316 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."; 05317 }
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 5304 of file processor.h.
References NAME.
05305 { 05306 return NAME; 05307 }
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 5319 of file processor.h.
References EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
05320 { 05321 TypeDict d; 05322 d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible"); 05323 d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value"); 05324 d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio"); 05325 return d; 05326 }
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 5914 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().
05915 { 05916 if (!image) { 05917 LOGWARN("NULL Image"); 05918 return; 05919 } 05920 float apix = params["apix"]; 05921 float threshold = params["threshold"]; 05922 float radius = params["radius"]; 05923 05924 if (apix > 0) { 05925 int ny = image->get_ysize(); 05926 radius = ny * apix / radius; 05927 //printf("Norm filter radius=%1.1f\n", radius); 05928 } 05929 05930 EMData *blur = image->copy(); 05931 EMData *maskblur = image->copy(); 05932 05933 maskblur->process_inplace("threshold.binary", Dict("value", threshold)); 05934 maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 05935 // maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f)); 05936 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05937 // maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f)); 05938 05939 05940 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold)); 05941 blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius)); 05942 // blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f)); 05943 05944 maskblur->div(*blur); 05945 image->mult(*maskblur); 05946 // maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC); 05947 05948 if( maskblur ) 05949 { 05950 delete maskblur; 05951 maskblur = 0; 05952 } 05953 05954 if( blur ) 05955 { 05956 delete blur; 05957 blur = 0; 05958 } 05959 }
const string LocalNormProcessor::NAME = "normalize.local" [static] |