EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all 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]

Public Member Functions

void process_inplace (EMData *image)
 To process an image in-place. More...
 
virtual string get_name () const
 Get the processor's name. More...
 
virtual string get_desc () const
 Get the descrition of this specific processor. More...
 
virtual TypeDict get_param_types () const
 Get processor parameter information in a dictionary. More...
 
- Public Member Functions inherited from EMAN::Processor
virtual ~Processor ()
 
virtual EMDataprocess (const EMData *const image)
 To proccess an image out-of-place. More...
 
virtual void process_list_inplace (vector< EMData * > &images)
 To process multiple images using the same algorithm. More...
 
virtual Dict get_params () const
 Get the processor parameters in a key/value dictionary. More...
 
virtual void set_params (const Dict &new_params)
 Set the processor parameters using a key/value dictionary. More...
 

Static Public Member Functions

static ProcessorNEW ()
 
- Static Public Member Functions inherited from EMAN::Processor
static string get_group_desc ()
 Get the description of this group of processors. More...
 
static void EMFourierFilterInPlace (EMData *fimage, Dict params)
 Compute a Fourier-filter processed image in place. More...
 
static EMDataEMFourierFilter (EMData *fimage, Dict params)
 Compute a Fourier-processor processed image without altering the original image. More...
 

Static Public Attributes

static const string NAME = "normalize.local"
 

Additional Inherited Members

- Public Types inherited from EMAN::Processor
enum  fourier_filter_types {
  TOP_HAT_LOW_PASS , TOP_HAT_HIGH_PASS , TOP_HAT_BAND_PASS , TOP_HOMOMORPHIC ,
  GAUSS_LOW_PASS , GAUSS_HIGH_PASS , GAUSS_BAND_PASS , GAUSS_INVERSE ,
  GAUSS_HOMOMORPHIC , BUTTERWORTH_LOW_PASS , BUTTERWORTH_HIGH_PASS , BUTTERWORTH_HOMOMORPHIC ,
  KAISER_I0 , KAISER_SINH , KAISER_I0_INVERSE , KAISER_SINH_INVERSE ,
  SHIFT , TANH_LOW_PASS , TANH_HIGH_PASS , TANH_HOMOMORPHIC ,
  TANH_BAND_PASS , RADIAL_TABLE , CTF_
}
 Fourier filter Processor type enum. More...
 
- Protected Attributes inherited from EMAN::Processor
Dict params
 

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

Member Function Documentation

◆ get_desc()

virtual string EMAN::LocalNormProcessor::get_desc ( ) const
inlinevirtual

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

7486 {
7487 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.";
7488 }

◆ get_name()

virtual string EMAN::LocalNormProcessor::get_name ( ) const
inlinevirtual

Get the processor's name.

Each processor is identified by a unique name.

Returns
The processor's name.

Implements EMAN::Processor.

Definition at line 7475 of file processor.h.

7476 {
7477 return NAME;
7478 }
static const string NAME
Definition: processor.h:7499

References NAME.

◆ get_param_types()

virtual TypeDict EMAN::LocalNormProcessor::get_param_types ( ) const
inlinevirtual

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

7491 {
7492 TypeDict d;
7493 d.put("threshold", EMObject::FLOAT, "Only values above the threshold will be used to compute the normalization. Generally a good isosurface value.");
7494 d.put("radius", EMObject::FLOAT, "Fourier filter radius expressed in pixels in Fourier space. cutoff_pixels in filter.lowpass.gauss");
7495 d.put("apix", EMObject::FLOAT, "Angstroms per pixel");
7496 return d;
7497 }
TypeDict is a dictionary to store <string, EMObject::ObjectType> pair.
Definition: emobject.h:305
void put(const string &key, EMObject::ObjectType o, const string &desc="")
Definition: emobject.h:330

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

◆ NEW()

static Processor * EMAN::LocalNormProcessor::NEW ( )
inlinestatic

Definition at line 7480 of file processor.h.

7481 {
7482 return new LocalNormProcessor();
7483 }
This processor attempts to perform a 'local normalization' so low density and high density features w...
Definition: processor.h:7471

◆ process_inplace()

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

7953{
7954 if (!image) {
7955 LOGWARN("NULL Image");
7956 return;
7957 }
7958 float apix = params["apix"];
7959 float threshold = params["threshold"];
7960 float radius = params["radius"];
7961
7962 if (apix > 0) {
7963 int ny = image->get_ysize();
7964 radius = ny * apix / radius;
7965 //printf("Norm filter radius=%1.1f\n", radius);
7966 }
7967
7968 EMData *blur = image->copy();
7969 EMData *maskblur = image->copy();
7970
7971 maskblur->process_inplace("threshold.binary", Dict("value", threshold));
7972 maskblur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
7973// maskblur->process_inplace("filter.highpass.tanh", Dict("highpass", -10.0f));
7974 maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
7975// maskblur->process_inplace("threshold.belowtozero", Dict("minval", 0.001f));
7976
7977
7978 blur->process_inplace("threshold.belowtozero", Dict("minval", threshold));
7979 blur->process_inplace("filter.lowpass.gauss", Dict("cutoff_pixels", radius));
7980// blur->process_inplace("filter.highpass.tanh", Dict("cutoff_abs", -10.0f));
7981
7982 maskblur->div(*blur);
7983 image->mult(*maskblur);
7984// maskblur->write_image("norm.mrc", 0, EMUtil::IMAGE_MRC);
7985
7986 if( maskblur )
7987 {
7988 delete maskblur;
7989 maskblur = 0;
7990 }
7991
7992 if( blur )
7993 {
7994 delete blur;
7995 blur = 0;
7996 }
7997}
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
EMData stores an image's data and defines core image processing routines.
Definition: emdata.h:82
#define LOGWARN
Definition: log.h:53

References LOGWARN, and EMAN::Processor::params.

Member Data Documentation

◆ NAME

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

Definition at line 7499 of file processor.h.

Referenced by get_name().


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