EMAN::LocalNormProcessor Class Reference

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. More...

#include <processor.h>

Inheritance diagram for EMAN::LocalNormProcessor:

Inheritance graph
[legend]
Collaboration diagram for EMAN::LocalNormProcessor:

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 = "normalize.local"

Detailed Description

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 normalization size similar to an lp= value.

Parameters:
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 5344 of file processor.h.


Member Function Documentation

virtual string EMAN::LocalNormProcessor::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 5359 of file processor.h.

05360                 {
05361                         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.";
05362                 }

virtual string EMAN::LocalNormProcessor::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 5349 of file processor.h.

References NAME.

05350                 {
05351                         return NAME;
05352                 }

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.

Returns:
A dictionary containing the parameter info.

Reimplemented from EMAN::Processor.

Definition at line 5364 of file processor.h.

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

05365                 {
05366                         TypeDict d;
05367                         d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible");
05368                         d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value");
05369                         d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio");
05370                         return d;
05371                 }

static Processor* EMAN::LocalNormProcessor::NEW (  )  [inline, static]

Definition at line 5354 of file processor.h.

05355                 {
05356                         return new LocalNormProcessor();
05357                 }

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.

Parameters:
image The image to be processed.

Implements EMAN::Processor.

Definition at line 5986 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().

05987 {
05988         if (!image) {
05989                 LOGWARN("NULL Image");
05990                 return;
05991         }
05992         float apix = params["apix"];
05993         float threshold = params["threshold"];
05994         float radius = params["radius"];
05995 
05996         if (apix > 0) {
05997                 int ny = image->get_ysize();
05998                 radius = ny * apix / radius;
05999                 //printf("Norm filter radius=%1.1f\n", radius);
06000         }
06001 
06002         EMData *blur = image->copy();
06003         EMData *maskblur = image->copy();
06004 
06005         maskblur->process_inplace("threshold.binary", Dict("value", threshold));
06006         maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
06007 //      maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f));
06008         maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
06009 //      maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
06010 
06011 
06012         blur->process_inplace("threshold.belowtozero", Dict("minval", threshold));
06013         blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
06014 //      blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f));
06015 
06016         maskblur->div(*blur);
06017         image->mult(*maskblur);
06018 //      maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC);
06019 
06020         if( maskblur )
06021         {
06022                 delete maskblur;
06023                 maskblur = 0;
06024         }
06025 
06026         if( blur )
06027         {
06028                 delete blur;
06029                 blur = 0;
06030         }
06031 }


Member Data Documentation

const string LocalNormProcessor::NAME = "normalize.local" [static]

Definition at line 5373 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files:
Generated on Thu May 3 10:10:40 2012 for EMAN2 by  doxygen 1.4.7