MeVisLabToolboxReference
ml::ConvolutionFilter Class Reference

This class implements convolutions with fixed kernel sizes. More...

#include <mlConvolutionFilter.h>

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

List of all members.

Public Types

enum  ConvKernelTypes {
  AVERAGE_33_KERNEL = 0, AVERAGE_55_KERNEL, AVERAGE_77_KERNEL, AVERAGE_1010_KERNEL,
  AVERAGE_2525_KERNEL, GAUSS_33_KERNEL, GAUSS_55_KERNEL, LAPLACE_KERNEL,
  LAPLACE_2_KERNEL, SOBEL_1_KERNEL, SOBEL_2_KERNEL, SOBEL_3_KERNEL,
  SOBEL_4_KERNEL, ID_KERNEL, FROM_EXTERNAL_KERNEL, NUM_CONV_KERNEL_TYPES
}
 The ConvKernelTypes decide which kernel is used to filter the input image. More...

Public Member Functions

 ConvolutionFilter ()
 Constructor.
EnumFieldgetConvKernelFld () const
 Access to parameter field(s) See documentation of _convKernelFld.

Static Public Attributes

static const char *const ConvKernelNames []
 Strings for ConvKernelNames.

Protected Member Functions

virtual void handleNotification (Field *field)
 Called when a parameter field is changed.
virtual void _userKernelPostUpdate ()
 Update the kernel to the selected kernel state if no external kernel is connected.
virtual void calculateOutputImageProperties (int outIndex)
 Computes the output image properties from the input image properties and the _convKernelFld.
 CALC_ROW_H ()
 The implementation of the calculateOutputSubImage() method overloaded from Module is done in this macro.
template<typename DATATYPE >
void calcRow (MLsoffset *indexTab, size_t indexTabSize, MLsoffset srcVoxelOffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
 In this virtual template method the filtering of one row needs to be implemented.

Detailed Description

This class implements convolutions with fixed kernel sizes.

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 37 of file mlConvolutionFilter.h.


Member Enumeration Documentation

The ConvKernelTypes decide which kernel is used to filter the input image.

  • AVERAGE_33_KERNEL
    3 x 3 Kernel. All Elements of this kernel have normalized and equal coefficents:

1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9

  • AVERAGE_55_KERNEL
    5 x 5 Kernel. All Elements are normalized and have equal coefficents.
  • AVERAGE_77_KERNEL
    7 x 7 Kernel. All Elements are normalized and have equal coefficents.
  • AVERAGE_1010_KERNEL
    10 x 10 Kernel. All Elements are normalized and have equal coefficents.
  • AVERAGE_2525_KERNEL
    25 x 25 Kernel. All Elements are normalized and have equal coefficents.
  • GAUSS_33_KERNEL
    Apply a 3x3 - Gausskernel. Smooth image and emphasizes the inner voxels.

1/16 2/16 1/16 2/16 4/16 2/16 1/16 2/16 1/16

  • GAUSS_55_KERNEL
    Apply a 5 x 5 Gausskernel.
  • LAPLACE_KERNEL
    Apply a 3 x 3 Laplacekernel. Used for detection edges by taking the 2nd derivation into account.

0 1 0 1 -4 1 0 1 0

  • LAPLACE_2_KERNEL
    Apply a 3 x 3 Laplace2kernel.

1 2 1 2 -12 2 1 2 1

  • SOBEL_1_KERNEL
    Apply a 3 x 3 Sobel1kernel. Used for detecting edges in vertical direction and smoothing in horizontal direction.

1 0 -1 2 0 -2 1 0 -1

  • SOBEL_2_KERNEL
    Apply a 3 x 3 Sobel2kernel. Used for detecting edges in horizontal direction and smoothing in vertical direction.

1 2 1 0 0 0 -1 -2 -1

  • SOBEL_3_KERNEL
    Apply a 3 x 3 Sobel3kernel. Used for detecting edges in diagonal direction and smoothing in contrary direction.

0 -1 -2 1 0 -1 2 1 0

  • SOBEL_4_KERNEL
    Apply a 3 x 3 Sobel4kernel. Used for detecting edges in diagonal direction and smoothing in contrary direction.

-2 -1 0 -1 0 1 0 1 2

  • ID_KERNEL
    Do nothing.
  • FROM_EXTERNAL_KERNEL
    Kernel defined elsewhere and set via field connections in the _kernelInputFld.
Enumerator:
AVERAGE_33_KERNEL 
AVERAGE_55_KERNEL 
AVERAGE_77_KERNEL 
AVERAGE_1010_KERNEL 
AVERAGE_2525_KERNEL 
GAUSS_33_KERNEL 
GAUSS_55_KERNEL 
LAPLACE_KERNEL 
LAPLACE_2_KERNEL 
SOBEL_1_KERNEL 
SOBEL_2_KERNEL 
SOBEL_3_KERNEL 
SOBEL_4_KERNEL 
ID_KERNEL 
FROM_EXTERNAL_KERNEL 
NUM_CONV_KERNEL_TYPES 

Definition at line 128 of file mlConvolutionFilter.h.


Constructor & Destructor Documentation

ml::ConvolutionFilter::ConvolutionFilter ( )

Constructor.

Initializes the fields, the members and the field connections with the field container.

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::ConvolutionFilter::_userKernelPostUpdate ( ) [protected, virtual]

Update the kernel to the selected kernel state if no external kernel is connected.

Reimplemented from ml::KernelModule.

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

The implementation of the calculateOutputSubImage() method overloaded from Module is done in this macro.

It implements page border handling and a dispatcher to call the correct template version of calcRow() with the correct parameters. Note that CALC_ROW_CPP() also needs to be added in the .cpp file.

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

In this virtual 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::ConvolutionFilter::calculateOutputImageProperties ( int  outIndex) [protected, virtual]

Computes the output image properties from the input image properties and the _convKernelFld.

Reimplemented from ml::KernelModule.

EnumField* ml::ConvolutionFilter::getConvKernelFld ( ) const [inline]

Access to parameter field(s) See documentation of _convKernelFld.

Definition at line 171 of file mlConvolutionFilter.h.

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

Called when a parameter field is changed.

Reimplemented from ml::KernelModule.


Member Data Documentation

const char* const ml::ConvolutionFilter::ConvKernelNames[] [static]

Strings for ConvKernelNames.

Definition at line 149 of file mlConvolutionFilter.h.


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