MeVisLab Toolbox Reference
|
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. | |
~KernelLineApplicatorBase () override | |
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. | |
void | applyToLine (TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *, size_t) override |
Applies the kernel to a row of the input subimage. | |
Get the extents of the region around a voxel needed to filter the voxel. | |
ImageVector | getNegativeExtent () const override |
Returns the negative extent of a kernel used for filtering. | |
ImageVector | getPositiveExtent () const override |
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 |
Public Member Functions inherited from ml::LineApplicator< DATATYPE > | |
virtual | ~LineApplicator () |
Virtual destructor. Currently it does nothing. | |
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 63 of file mlKernelLineApplicatorBase.h.
|
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 74 of file mlKernelLineApplicatorBase.h.
ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase | ( | const KernelLineApplicatorBase< DATATYPE, KDATATYPE > & | kernLineAppBase | ) |
Copy constructor.
Definition at line 194 of file mlKernelLineApplicatorBase.h.
References mlrange_cast().
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 206 of file mlKernelLineApplicatorBase.h.
References mlrange_cast().
|
inlineoverride |
Destructor. Frees dynamic members.
Definition at line 90 of file mlKernelLineApplicatorBase.h.
|
protectedvirtual |
Removes the current _indexTab.
Definition at line 290 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::~KernelLineApplicator().
|
protectedvirtual |
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 270 of file mlKernelLineApplicatorBase.h.
References mlrange_cast().
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::applyToLine().
|
protected |
Initialization the current instance of mlKernelApplicatorBase. To be called by constructors.
Definition at line 219 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::_init(), ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator(), ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator(), and ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator().
|
inlineoverridevirtual |
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 >.
Definition at line 120 of file mlKernelLineApplicatorBase.h.
References mlrange_cast().
|
inline |
Definition at line 111 of file mlKernelLineApplicatorBase.h.
|
inlineoverridevirtual |
Returns the negative extent of a kernel used for filtering.
Reimplemented from ml::LineApplicator< DATATYPE >.
Definition at line 101 of file mlKernelLineApplicatorBase.h.
|
inlineoverridevirtual |
Returns the positive extent of a kernel used for filtering.
Reimplemented from ml::LineApplicator< DATATYPE >.
Definition at line 102 of file mlKernelLineApplicatorBase.h.
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 236 of file mlKernelLineApplicatorBase.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_kernel, ML_NO_MEMORY, ML_PRINT_FATAL_ERROR, and mlrange_cast().
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::operator=().
|
inline |
Definition at line 110 of file mlKernelLineApplicatorBase.h.
References mlrange_cast().
Referenced by ml::KernelLineApplicator< DATATYPE, KDATATYPE >::KernelLineApplicator().
|
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 167 of file mlKernelLineApplicatorBase.h.
|
protected |
Size of _indexTab. Default is 0.
Definition at line 170 of file mlKernelLineApplicatorBase.h.
Pointer to the kernel used to filter an input page.
Definition at line 157 of file mlKernelLineApplicatorBase.h.
Referenced by ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=().
|
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 174 of file mlKernelLineApplicatorBase.h.