Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

ProcessorNEW ()

Static Public Attributes

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

05190                 {
05191                         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.";
05192                 }

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

05180                 {
05181                         return NAME;
05182                 }

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

References EMAN::TypeDict::put().

05195                 {
05196                         TypeDict d;
05197                         d.put("threshold", EMObject::FLOAT, "an isosurface threshold at which all desired features are visible");
05198                         d.put("radius", EMObject::FLOAT, "a normalization size similar to an lp= value");
05199                         d.put("apix", EMObject::FLOAT, "Angstrom per pixel ratio");
05200                         return d;
05201                 }

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

Definition at line 5184 of file processor.h.

05185                 {
05186                         return new LocalNormProcessor();
05187                 }

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

References EMAN::EMData::copy(), EMAN::EMData::div(), EMAN::EMData::get_ysize(), LOGWARN, EMAN::EMData::mult(), ny, and EMAN::EMData::process_inplace().

05799 {
05800         if (!image) {
05801                 LOGWARN("NULL Image");
05802                 return;
05803         }
05804         float apix = params["apix"];
05805         float threshold = params["threshold"];
05806         float radius = params["radius"];
05807 
05808         if (apix > 0) {
05809                 int ny = image->get_ysize();
05810                 radius = ny * apix / radius;
05811                 //printf("Norm filter radius=%1.1f\n", radius);
05812         }
05813 
05814         EMData *blur = image->copy();
05815         EMData *maskblur = image->copy();
05816 
05817         maskblur->process_inplace("threshold.binary", Dict("value", threshold));
05818         maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
05819 //      maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f));
05820         maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
05821 //      maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
05822 
05823 
05824         blur->process_inplace("threshold.belowtozero", Dict("minval", threshold));
05825         blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
05826 //      blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f));
05827 
05828         maskblur->div(*blur);
05829         image->mult(*maskblur);
05830 //      maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC);
05831 
05832         if( maskblur )
05833         {
05834                 delete maskblur;
05835                 maskblur = 0;
05836         }
05837 
05838         if( blur )
05839         {
05840                 delete blur;
05841                 blur = 0;
05842         }
05843 }


Member Data Documentation

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

Definition at line 174 of file processor.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Mar 7 18:21:12 2011 for EMAN2 by  doxygen 1.3.9.1