EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes
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:
thresholdan isosurface threshold at which all desired features are visible
radiusa normalization size similar to an lp= value
apixAngstrom per pixel ratio

Definition at line 5756 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 5771 of file processor.h.

                {
                        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.";
                }
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 5761 of file processor.h.

References NAME.

                {
                        return NAME;
                }
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 5776 of file processor.h.

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

                {
                        TypeDict d;
                        d.put("threshold", EMObject::FLOAT, "Only values above the threshold will be used to compute the normalization. Generally a good isosurface value.");
                        d.put("radius", EMObject::FLOAT, "Fourier filter radius expressed in pixels in Fourier space. cutoff_pixels in filter.lowpass.gauss");
                        d.put("apix", EMObject::FLOAT, "Angstroms per pixel");
                        return d;
                }
static Processor* EMAN::LocalNormProcessor::NEW ( ) [inline, static]

Definition at line 5766 of file processor.h.

                {
                        return new LocalNormProcessor();
                }
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:
imageThe image to be processed.

Implements EMAN::Processor.

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

{
        if (!image) {
                LOGWARN("NULL Image");
                return;
        }
        float apix = params["apix"];
        float threshold = params["threshold"];
        float radius = params["radius"];

        if (apix > 0) {
                int ny = image->get_ysize();
                radius = ny * apix / radius;
                //printf("Norm filter radius=%1.1f\n", radius);
        }

        EMData *blur = image->copy();
        EMData *maskblur = image->copy();

        maskblur->process_inplace("threshold.binary", Dict("value", threshold));
        maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
//      maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f));
        maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
//      maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));


        blur->process_inplace("threshold.belowtozero", Dict("minval", threshold));
        blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
//      blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f));

        maskblur->div(*blur);
        image->mult(*maskblur);
//      maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC);

        if( maskblur )
        {
                delete maskblur;
                maskblur = 0;
        }

        if( blur )
        {
                delete blur;
                blur = 0;
        }
}

Member Data Documentation

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

Definition at line 5785 of file processor.h.

Referenced by get_name().


The documentation for this class was generated from the following files: