MeVisLabToolboxReference
|
The KernelLineApplicatorBase
class is designed to implement new kernel based filters to be applied to a line of an mlSubImage
and and to write the filtered line to an output mlSubImage
.
More...
#include <mlKernelLineApplicatorBase.h>
Public Member Functions | |
KernelLineApplicatorBase () | |
Default constructor. | |
KernelLineApplicatorBase (const KernelLineApplicatorBase< DATATYPE, KDATATYPE > &kernLineAppBase) | |
Copy constructor. | |
KernelLineApplicatorBase (const TKernel< KDATATYPE > &kernel) | |
Convenience constructor to create a complete line applicator with all important parameters set. | |
virtual | ~KernelLineApplicatorBase () |
Destructor. Frees dynamic members. | |
const KernelLineApplicatorBase < DATATYPE, KDATATYPE > & | operator= (const KernelLineApplicatorBase< DATATYPE, KDATATYPE > &kernLineAppBase) |
Assignment operator. Assures that dynamic and normal members are copied correctly. | |
virtual void | applyToLine (TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *, size_t) |
Applies the kernel to a row of the input subimage. | |
Get the extents of the region around a voxel needed to filter the voxel. | |
virtual ImageVector | getNegativeExtent () const |
Returns the negative extent of a kernel used for filtering. | |
virtual ImageVector | getPositiveExtent () const |
Returns the positive extent of a kernel used for filtering. | |
Set/Get the kernel needed to filter a line. | |
void | setKernel (const TKernel< KDATATYPE > &kernel) |
const TKernel< KDATATYPE > & | getKernel () const |
Protected Member Functions | |
void | _init () |
Initialization the current instance of mlKernelApplicatorBase. To be called by constructors. | |
virtual void | _defineIndices (const SubImage &inSubImg) |
Create the table of offsets from the voxel (0,0,0,0,0,0) of the kernel to any other voxel of the kernel in an inSubImg. | |
virtual void | _clearIndices () |
Removes the current _indexTab. | |
Protected Attributes | |
const TKernel< KDATATYPE > * | _kernel |
Pointer to the kernel used to filter an input page. | |
Members for inner kernel indexing. | |
MLsoffset * | _indexTab |
Table and variables defined temporarily while filtering a page. | |
size_t | _indexTabSize |
Size of _indexTab. Default is 0. | |
MLsoffset | _srcVoxOffset |
Offset from origin of kernel in input image to the voxel under the replaced voxel in output image. |
The KernelLineApplicatorBase
class is designed to implement new kernel based filters to be applied to a line of an mlSubImage
and and to write the filtered line to an output mlSubImage
.
This class is derived from the LineApplicator
which is the minimum class which has to be passed to a applyFiltering
function from the KernelTools
class to filter a page. The methods applyToLine
, getNegativeExtent
and getPositiveExtent
were be overloaded in class LineApplicator
.
The central method is
which applies the currently set kernel to a line of numVox
voxels in the inSubImg
and writes the result to outSubImg
. Before doing that in both subimages the cursor position must be set adequately. This is usually done by an applyFiltering
function from the KernelTools
class. So usually there is no need to use this class explicitly if it's not overloaded.
So - if you want to implement a new kernel filter then just overload the virtual method applyToLine
and implement your new filter in it.
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 66 of file mlKernelLineApplicatorBase.h.
ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase | ( | ) | [inline] |
Default constructor.
Default settings are an invalid kernel, empty index tables, unlimited image and filter intervals and _srcVoxOffset=0. _applyMode is APPLY_NORMALLY.
Definition at line 77 of file mlKernelLineApplicatorBase.h.
ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase | ( | const KernelLineApplicatorBase< DATATYPE, KDATATYPE > & | kernLineAppBase | ) |
Copy constructor.
Definition at line 197 of file mlKernelLineApplicatorBase.h.
ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase | ( | const TKernel< KDATATYPE > & | kernel | ) |
Convenience constructor to create a complete line applicator with all important parameters set.
A kernel must be passed to initialize all.
Definition at line 209 of file mlKernelLineApplicatorBase.h.
virtual ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::~KernelLineApplicatorBase | ( | ) | [inline, virtual] |
Destructor. Frees dynamic members.
Definition at line 93 of file mlKernelLineApplicatorBase.h.
void ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_clearIndices | ( | ) | [protected, virtual] |
Removes the current _indexTab.
Definition at line 302 of file mlKernelLineApplicatorBase.h.
void ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_defineIndices | ( | const SubImage & | inSubImg | ) | [protected, virtual] |
Create the table of offsets from the voxel (0,0,0,0,0,0) of the kernel to any other voxel of the kernel in an inSubImg.
Pass the subimage page to make correct calculations. It's the same like multiplying the coordinates of the kernel elements with inSubImg strides. This method also initializes the member _srcVoxOffset
.
Definition at line 282 of file mlKernelLineApplicatorBase.h.
References ml::SubImage::getStride().
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::applyToLine().
void ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_init | ( | ) | [protected] |
Initialization the current instance of mlKernelApplicatorBase. To be called by constructors.
Reimplemented in ml::KernelLineApplicator< DATATYPE, KDATATYPE >.
Definition at line 226 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator().
virtual void ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::applyToLine | ( | TSubImageWithCursor< DATATYPE > * | inSubImg, |
TSubImageWithCursor< DATATYPE > * | , | ||
size_t | |||
) | [inline, virtual] |
Applies the kernel to a row of the input subimage.
Cursors must have been set in input and output subimage. Define the index table in this method when requiring access to image voxels covered by kernel elements.
Reimplemented from ml::LineApplicator< DATATYPE >.
Reimplemented in ml::KernelLineApplicator< DATATYPE, KDATATYPE >.
Definition at line 123 of file mlKernelLineApplicatorBase.h.
const TKernel<KDATATYPE>& ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::getKernel | ( | ) | const [inline] |
Definition at line 114 of file mlKernelLineApplicatorBase.h.
virtual ImageVector ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::getNegativeExtent | ( | ) | const [inline, virtual] |
Returns the negative extent of a kernel used for filtering.
Reimplemented from ml::LineApplicator< DATATYPE >.
Definition at line 104 of file mlKernelLineApplicatorBase.h.
References ml::ImageVector.
virtual ImageVector ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::getPositiveExtent | ( | ) | const [inline, virtual] |
Returns the positive extent of a kernel used for filtering.
Reimplemented from ml::LineApplicator< DATATYPE >.
Definition at line 105 of file mlKernelLineApplicatorBase.h.
References ml::ImageVector.
const KernelLineApplicatorBase< DATATYPE, KDATATYPE > & ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator= | ( | const KernelLineApplicatorBase< DATATYPE, KDATATYPE > & | kernLineAppBase | ) |
Assignment operator. Assures that dynamic and normal members are copied correctly.
Definition at line 244 of file mlKernelLineApplicatorBase.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTab, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTabSize, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_kernel, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_srcVoxOffset, ML_NO_MEMORY, and ML_PRINT_FATAL_ERROR.
void ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::setKernel | ( | const TKernel< KDATATYPE > & | kernel | ) | [inline] |
Definition at line 113 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator().
MLsoffset* ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTab [protected] |
Table and variables defined temporarily while filtering a page.
The table contains the offsets from kernel voxel (0,0,0,0,0,0) to all other kernel voxels in the input page. So all input SubImage voxels can be addressed within a page by indexing the base voxel of the kernel in the input subImg. Default is NULL.
Definition at line 170 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=().
size_t ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTabSize [protected] |
Size of _indexTab. Default is 0.
Definition at line 173 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=().
const TKernel<KDATATYPE>* ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_kernel [protected] |
Pointer to the kernel used to filter an input page.
Definition at line 160 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=().
MLsoffset ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_srcVoxOffset [protected] |
Offset from origin of kernel in input image to the voxel under the replaced voxel in output image.
Default is 0.
Definition at line 177 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=().