MeVisLabToolboxReference
ml::MorphologyFilter Class Reference

The class to apply morphology based kernel filters to images. More...

#include <mlMorphologyFilter.h>

Inheritance diagram for ml::MorphologyFilter:
ml::KernelModule ml::KernelBaseModule ml::Module ml::FieldContainer ml::Base

List of all members.

Public Types

enum  MorphologyFilters { ID = 0, DILATION, EROSION, NUM_MORPHOLOGY_FILTERS }
 The following morphology based filters are available to filter an image: More...

Public Member Functions

 MorphologyFilter ()
 Constructor.
EnumFieldgetMorphologyFilterFld () const
 Access method to the enum field making the morphological filtering algorithm selectable.

Static Public Attributes

static const char *const MorphologyFilterNames []
 String names for morphology based filters.

Protected Member Functions

virtual void _userKernelPostUpdate ()
 Overload the _userKernelPostUpdate() as subfunctionality of the updateKernel method to guarantee that kernel is reset to 0 in default settings since the morphological operations uses kernel element values to modify grey values under non 0 kernel elements.
virtual void handleNotification (Field *field)
 Called when a parameter field is changed.
virtual void calculateOutputImageProperties (int outIndex)
 Computes the output image properties (e.g.
 CALC_ROW_H ()
 Macro which needs to be added to the implementation of a class derived from KernelModule or KernelBaseModule.
template<typename DATATYPE >
void calcRow (MLsoffset *indexTab, size_t indexTabSize, MLsoffset srcVoxelOffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
 In this template method the filtering of one row needs to be implemented.

Detailed Description

The class to apply morphology based kernel filters to images.

This class implements some morphology filters.

For related code and more information see mlKernelExample.h, mlKernel.h, mlKernelBaseModule.h, mlKernelModule.h, mlKernelEditor.h, mlRankFilter.h, mlExtConvolutionFilter.h, mlKernelMacros, mlKernelTools.h and mlConvolutionFilter.h.

Definition at line 34 of file mlMorphologyFilter.h.


Member Enumeration Documentation

The following morphology based filters are available to filter an image:

  • ID
    Applies border handling with selected border handling but simply copies input image to output in defined ares. Useful to compare filter results with original data where only the filtered area changes.
  • DILATION
    The kernel element values are added to their corresponding image values. The maximum of these values is written to the output image.
  • EROSION
    The kernel element values are subtracted from the corresponding image values. The minimum of these values is written to the output image.

If no externel kernel is specified and external kernel usage is enabled then a kernel with the given extend is used and all kernel element values are set to 0 by default. In this case the dilation and erosion filters are simply minimum and maximum operations.

Enumerator:
ID 
DILATION 
EROSION 
NUM_MORPHOLOGY_FILTERS 

Definition at line 59 of file mlMorphologyFilter.h.


Constructor & Destructor Documentation

ml::MorphologyFilter::MorphologyFilter ( )

Constructor.

Initializes the fields, the members and the field connections with the image output.

Note that with the following method calls an additional field interface is created as described in KernelModule and KernelBaseModule:

Also available are the fields access methods from KernelBaseModule:


Member Function Documentation

virtual void ml::MorphologyFilter::_userKernelPostUpdate ( ) [protected, virtual]

Overload the _userKernelPostUpdate() as subfunctionality of the updateKernel method to guarantee that kernel is reset to 0 in default settings since the morphological operations uses kernel element values to modify grey values under non 0 kernel elements.

Reimplemented from ml::KernelModule.

ml::MorphologyFilter::CALC_ROW_H ( ) [protected]

Macro which needs to be added to the implementation of a class derived from KernelModule or KernelBaseModule.

It guarantees that the correct template functions are called for images with any data type. It also overloads calculateOutputSubImage() of the base class Module. Note that CALC_ROW_CPP() also needs to be added to the .cpp file.

template<typename DATATYPE >
void ml::MorphologyFilter::calcRow ( MLsoffset indexTab,
size_t  indexTabSize,
MLsoffset  srcVoxelOffset,
size_t  numVox,
DATATYPE *  inCursor,
DATATYPE *  outCursor,
const ImageVector  
) [protected]

In this template method the filtering of one row needs to be implemented.

It will be called by the CALC_ROW_H() / CALC_ROW_CPP() macro.

virtual void ml::MorphologyFilter::calculateOutputImageProperties ( int  outIndex) [protected, virtual]

Computes the output image properties (e.g.

the extents) for output outIndex. Many changes are already done in the KernelModule, some stuff we still have to do here.

Reimplemented from ml::KernelModule.

EnumField* ml::MorphologyFilter::getMorphologyFilterFld ( ) const [inline]

Access method to the enum field making the morphological filtering algorithm selectable.

Permitted field values are all MorphologyFilters without NUM_MORPHOLOGY_FILTERS. Default is DILATION.

Definition at line 99 of file mlMorphologyFilter.h.

virtual void ml::MorphologyFilter::handleNotification ( Field field) [protected, virtual]

Called when a parameter field is changed.

Reimplemented from ml::KernelModule.


Member Data Documentation

const char* const ml::MorphologyFilter::MorphologyFilterNames[] [static]

String names for morphology based filters.

Definition at line 70 of file mlMorphologyFilter.h.


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