MeVisLab Toolbox Reference
|
The basic implementation of a filter to filter an image row with kernel operations. More...
#include <mlKernelTools.h>
Public Member Functions | |
virtual void | operator() (TSubImageWithCursor< DATATYPE > *, TSubImageWithCursor< DATATYPE > *, size_t) const |
This operator does the work of a fctLineFilter . More... | |
virtual | ~fctLineFilter () |
Virtual destructor to avoid warnings. Currently it does nothing. More... | |
The basic implementation of a filter to filter an image row with kernel operations.
One applyFiltering function of the kernelTools
class uses a pointer to an object of type fctLineFilter
providing the calculation-algorithm of output-data from the input. To implement global static functions would be unattractive for several reasons. Therefor a mechanism is needed to pass the pointer on an internal function of an runtime-object. Following to struct's serve this purpose: The implementation of '.. operator() ..' is the legal c++ trick of choice. If the object is asked for a function pointer of type
void (*pFkt) (TSubImageWithCursor<DATATYPE> *, TSubImageWithCursor<DATATYPE> *, int) const
it will return the function implemented in
void operator () (TSubImageWithCursor<DATATYPE> *inSubImg, TSubImageWithCursor<DATATYPE> *outSubImg, int numVox) const {...;}
This concept of function-type object - sometimes called 'Functors' - is commonly used in template libraries to combine the flexible algorithm access via function pointer with the possible use of variables outliving single calls. The following class is an abstract LineFilter functor to enable easy integration of user defined filters. The virtual function 'operator()' defines the desired function type.
Definition at line 53 of file mlKernelTools.h.
|
inlinevirtual |
Virtual destructor to avoid warnings. Currently it does nothing.
Definition at line 62 of file mlKernelTools.h.
|
inlinevirtual |
This operator does the work of a fctLineFilter
.
So an object of type fctLineFilter
simply can be used as a function which gets two TSubImgs and an int as an argument. Derives classes then can overload this operator.
Reimplemented in ml::useObjectLineFilter< T, DATATYPE >.
Definition at line 59 of file mlKernelTools.h.