MeVisLabToolboxReference
|
This class implements convolutions with fixed kernel sizes. More...
#include <mlConvolutionFilter.h>
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. | |
EnumField * | getConvKernelFld () 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. |
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.
The ConvKernelTypes
decide which kernel is used to filter the input image.
AVERAGE_33_KERNEL
1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9
AVERAGE_55_KERNEL
AVERAGE_77_KERNEL
AVERAGE_1010_KERNEL
AVERAGE_2525_KERNEL
GAUSS_33_KERNEL
1/16 2/16 1/16 2/16 4/16 2/16 1/16 2/16 1/16
GAUSS_55_KERNEL
LAPLACE_KERNEL
0 1 0 1 -4 1 0 1 0
LAPLACE_2_KERNEL
1 2 1 2 -12 2 1 2 1
SOBEL_1_KERNEL
1 0 -1 2 0 -2 1 0 -1
SOBEL_2_KERNEL
1 2 1 0 0 0 -1 -2 -1
SOBEL_3_KERNEL
0 -1 -2 1 0 -1 2 1 0
SOBEL_4_KERNEL
-2 -1 0 -1 0 1 0 1 2
ID_KERNEL
FROM_EXTERNAL_KERNEL
Definition at line 128 of file mlConvolutionFilter.h.
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:
_createImageIntervalFields
(0, 1024, true, false);_createExternalKernelFields
(false, false);_createKernelInfoField()
;_createKernelOutputField()
;Also available are the fields access methods from KernelBaseModule:
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.
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.
const char* const ml::ConvolutionFilter::ConvKernelNames[] [static] |
Strings for ConvKernelNames.
Definition at line 149 of file mlConvolutionFilter.h.