|
MeVisLab Toolbox Reference
|
#include <mlKernelLineApplicator.h>
Public Types | |
| enum | ApplyMode { APPLY_COPY = 0 , APPLY_NORMALLY , APPLY_USER_FILTER , APPLY_IMAGE_INTERVAL_FILTER , APPLY_KERNEL_INTERVAL_FILTER , APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER , NUM_APPLY_MODES } |
Public Member Functions | |
| KernelLineApplicator () | |
| KernelLineApplicator (const KernelLineApplicator &kernLineApp) | |
| Copy constructor. | |
| KernelLineApplicator (const TKernel< KDATATYPE > &kernel, ApplyMode applyMode, MLdouble iIntMin=-DBL_MIN, MLdouble iIntMax=DBL_MAX, MLdouble kIntMin=-DBL_MIN, MLdouble kIntMax=DBL_MAX) | |
| virtual | ~KernelLineApplicator () |
| Destructor. Frees dynamic members. | |
| const KernelLineApplicator & | operator= (const KernelLineApplicator &kernLineApp) |
| Assignment operator. Assures that dynamic and normal members are copied correctly. | |
| void | setImageInterval (MLdouble min=-DBL_MAX, MLdouble max=DBL_MAX) |
| void | setKernelInterval (MLdouble min=-DBL_MAX, MLdouble max=DBL_MAX) |
| bool | isInImageInterval (DATATYPE v) const |
| bool | isInKernelInterval (DATATYPE v) const |
| void | applyToLine (TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *outSubImg, size_t numVox) |
| virtual void | applyUserFilterToLine (TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *outSubImg, long numVox) const |
Set/Get the mode how the kernel is applied to the image. | |
| void | setApplyMode (ApplyMode mode) |
| ApplyMode | getApplyMode () const |
Return the interval limits for image and kernel interval. | |
| DATATYPE | getImageIntervalMin () const |
| DATATYPE | getImageIntervalMax () const |
| DATATYPE | getKernelIntervalMin () const |
| DATATYPE | getKernelIntervalMax () const |
| Public Member Functions inherited from ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE > | |
| KernelLineApplicatorBase () | |
| KernelLineApplicatorBase (const KernelLineApplicatorBase< DATATYPE, KDATATYPE > &kernLineAppBase) | |
| Copy constructor. | |
| KernelLineApplicatorBase (const TKernel< KDATATYPE > &kernel) | |
| ~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 |
| 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. | |
| 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. | |
Static Public Attributes | |
| static const char *const | ApplyModeNames [] |
| Strings for ApplyMode names. See mlKernalLineApplicator.cpp for the names. | |
Protected Member Functions | |
| void | _init () |
| Initialization the current instance of mlKernelApplicator. To be called by constructors. | |
| Protected Member Functions inherited from ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE > | |
| void | _init () |
| Initialization the current instance of mlKernelApplicatorBase. To be called by constructors. | |
| virtual void | _defineIndices (const SubImage &inSubImg) |
| virtual void | _clearIndices () |
| Removes the current _indexTab. | |
Protected Attributes | |
| ApplyMode | _applyMode |
| The mode how the kernel is applied to the image. | |
| bool | _normOrigI |
| _normOrigI==true indicates that the interval is used exclusively. | |
| bool | _normKernI |
| _normKernI==true indicates that the interval is used exclusively. | |
Minimum/Maximum limits of interval limiting the input image voxels to be filtered. | |
| MLdouble | _origIMin |
| MLdouble | _origIMax |
| DATATYPE | _origIMinDT |
| DATATYPE | _origIMaxDT |
Minimum/Maximum limits of interval limiting the input image voxels used for filtering. | |
| MLdouble | _kernIMin |
| MLdouble | _kernIMax |
| DATATYPE | _kernIMinDT |
| DATATYPE | _kernIMaxDT |
| Protected Attributes inherited from ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE > | |
| const TKernel< KDATATYPE > * | _kernel |
| Pointer to the kernel used to filter an input page. | |
| MLsoffset * | _indexTab |
| size_t | _indexTabSize |
| Size of _indexTab. Default is 0. | |
| MLsoffset | _srcVoxOffset |
The KernelLineApplicator class takes a Kernel instance and filters one line of an mlSubImage and writes it to an output also given by another mlSubImage.
This class is derived from the KernelLineApplicatorBase where it needs to overload the central method
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 applyFiltering functions from the KernelTools class. So usually there is no need to use this class explicitly if it's not overloaded.
There are some modes how the kernel can be applied to inSubImg and the user can implement its own mode by overloading the method
applyUserFilterToLine(TSubImageWithCursor<DATATYPE> *inSubImg,
TSubImageWithCursor<DATATYPE> *outSubImg,
int numVox)
Then pass an instance of your KernelLineApplicator to an applyFiltering functions from the KernelTools class which filters an entire subimage with 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 67 of file mlKernelLineApplicator.h.
| enum ml::KernelLineApplicator::ApplyMode |
The ApplyModes decide about the way how the kernel is used to filter the input image and which parts of it.
-APPLY_COPY Copy those row voxels from input subimage which correspond to the row to be modified in the output image.
-APPLY_NORMALLY Filter a row with the current kernel.
-APPLY_USER_FILTER Filter a row with the current kernel with a user defined algorithm.
-APPLY_IMAGE_INTERVAL_FILTER Filter a row with the current kernel. Apply kernel only to voxels which fulfil the image interval.
-APPLY_KERNEL_INTERVAL_FILTER Filter a voxel with the current kernel. All input image voxels under kernel elements which are not in the kernel interval are not multiplied with kernel element values and are not added to result value.
-APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER Filter a voxel with the current kernel. All input image voxels under kernel elements which are not in the kernel interval are not multiplied with kernel element values and are not added to result value. Only input image voxels are filtered which fulfil the image interval.
| Enumerator | |
|---|---|
| APPLY_COPY | |
| APPLY_NORMALLY | |
| APPLY_USER_FILTER | |
| APPLY_IMAGE_INTERVAL_FILTER | |
| APPLY_KERNEL_INTERVAL_FILTER | |
| APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER | |
| NUM_APPLY_MODES | |
Definition at line 101 of file mlKernelLineApplicator.h.
|
inline |
Default constructor. Default settings are an invalid kernel, empty index tables, unlimited image and filter intervals and _srcVoxOffset=0. _applyMode is ApplyNormally.
Definition at line 121 of file mlKernelLineApplicator.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_init(), and ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase().
Referenced by KernelLineApplicator(), and operator=().
|
inline |
Copy constructor.
Definition at line 129 of file mlKernelLineApplicator.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_init(), KernelLineApplicator(), and ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase().
|
inline |
Convenience constructor to create a complete line applicator with all important parameters set. An instance of an mlKernelApplicator and the kernel application mode must be passed. Image and kernel interval are optional and default to unlimited intervals.
Definition at line 142 of file mlKernelLineApplicator.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_init(), ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::KernelLineApplicatorBase(), setApplyMode(), setImageInterval(), ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::setKernel(), and setKernelInterval().
|
inlinevirtual |
Destructor. Frees dynamic members.
Definition at line 165 of file mlKernelLineApplicator.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_clearIndices().
|
inlineprotected |
Initialization the current instance of mlKernelApplicator. To be called by constructors.
Definition at line 398 of file mlKernelLineApplicator.h.
References _applyMode, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_init(), APPLY_NORMALLY, setImageInterval(), and setKernelInterval().
|
inlinevirtual |
Selects the correct line filter mode and filters a row with the currently specified kernel. Cursors must have been set in input and output subimage. Define the index table before using this method. On empty index tables the voxel of the input image is copied to the output.
Reimplemented from ml::LineApplicator< DATATYPE >.
Definition at line 299 of file mlKernelLineApplicator.h.
References _applyMode, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_defineIndices(), ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTab, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_indexTabSize, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_kernel, _kernIMax, _kernIMin, _origIMax, _origIMin, ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_srcVoxOffset, APPLY_COPY, APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER, APPLY_IMAGE_INTERVAL_FILTER, APPLY_KERNEL_INTERVAL_FILTER, APPLY_NORMALLY, APPLY_USER_FILTER, applyUserFilterToLine(), ml::KernelTools::copyLine(), ml::KernelTools::correlateLine(), ml::KernelTools::correlateLineWithImageAndKernelInterval(), ml::KernelTools::correlateLineWithImageInterval(), and ml::KernelTools::correlateLineWithKernelInterval().
|
inlinevirtual |
Filter a row with the current kernel with a user defined algorithm. Cursors in input and output subimage and index table must be up to date. Overload this method to implement you own algorithm to apply the kernel to the image.
Definition at line 382 of file mlKernelLineApplicator.h.
References ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::_srcVoxOffset, and ml::KernelTools::copyLine().
Referenced by applyToLine().
|
inline |
Definition at line 199 of file mlKernelLineApplicator.h.
References _applyMode.
|
inline |
Definition at line 208 of file mlKernelLineApplicator.h.
References _origIMaxDT.
|
inline |
Definition at line 207 of file mlKernelLineApplicator.h.
References _origIMinDT.
|
inline |
Definition at line 210 of file mlKernelLineApplicator.h.
References _kernIMaxDT.
|
inline |
Definition at line 209 of file mlKernelLineApplicator.h.
References _kernIMinDT.
|
inline |
Test whether the value v is within image interval. Note that the interval is considered exclusively if maximum is smaller than minimum, i.e. all values between maximum and minimum are excluded and all others are included. Default is false.
Definition at line 252 of file mlKernelLineApplicator.h.
References _normOrigI, _origIMax, _origIMaxDT, _origIMin, _origIMinDT, and ml::TypeTraits< T >::isScalarType.
|
inline |
Test whether the value v is within kernel interval. Note that the interval is considered exclusively if maximum is smaller than minimum, i.e. all values between maximum and minimum are excluded and all other are included. Default is false.
Definition at line 277 of file mlKernelLineApplicator.h.
References _kernIMax, _kernIMaxDT, _kernIMin, _kernIMinDT, _normKernI, and ml::TypeTraits< T >::isScalarType.
|
inline |
Assignment operator. Assures that dynamic and normal members are copied correctly.
Definition at line 173 of file mlKernelLineApplicator.h.
References _applyMode, _kernIMax, _kernIMin, _origIMax, _origIMin, KernelLineApplicator(), ml::KernelLineApplicatorBase< DATATYPE, KDATATYPE >::operator=(), setApplyMode(), setImageInterval(), and setKernelInterval().
|
inline |
Definition at line 198 of file mlKernelLineApplicator.h.
References _applyMode.
Referenced by KernelLineApplicator(), and operator=().
|
inline |
Correlations can be applied to a subset of voxels by setting a threshold interval which includes the convoluted voxels. If used then only voxels >= min and <=max are modified by correlations. Default is (-DBL_MAX, DBL_MAX).
Definition at line 219 of file mlKernelLineApplicator.h.
References _normOrigI, _origIMax, _origIMaxDT, _origIMin, and _origIMinDT.
Referenced by _init(), KernelLineApplicator(), and operator=().
|
inline |
When filtering an image then voxels covered by the kernel elements outside a certain grey level interval can be excluded. If used then only voxels >= min and <=max are multiplied with kernel values. Otherwise these products are not added to the resulting output image voxel. Default is (-DBL_MAX, DBL_MAX).
Definition at line 236 of file mlKernelLineApplicator.h.
References _kernIMax, _kernIMaxDT, _kernIMin, _kernIMinDT, and _normKernI.
Referenced by _init(), KernelLineApplicator(), and operator=().
|
protected |
The mode how the kernel is applied to the image.
Definition at line 420 of file mlKernelLineApplicator.h.
Referenced by _init(), applyToLine(), getApplyMode(), operator=(), and setApplyMode().
|
protected |
Definition at line 441 of file mlKernelLineApplicator.h.
Referenced by applyToLine(), isInKernelInterval(), operator=(), and setKernelInterval().
|
protected |
Definition at line 443 of file mlKernelLineApplicator.h.
Referenced by getKernelIntervalMax(), isInKernelInterval(), and setKernelInterval().
|
protected |
Definition at line 440 of file mlKernelLineApplicator.h.
Referenced by applyToLine(), isInKernelInterval(), operator=(), and setKernelInterval().
|
protected |
Definition at line 442 of file mlKernelLineApplicator.h.
Referenced by getKernelIntervalMin(), isInKernelInterval(), and setKernelInterval().
|
protected |
_normKernI==true indicates that the interval is used exclusively.
Definition at line 447 of file mlKernelLineApplicator.h.
Referenced by isInKernelInterval(), and setKernelInterval().
|
protected |
_normOrigI==true indicates that the interval is used exclusively.
Definition at line 434 of file mlKernelLineApplicator.h.
Referenced by isInImageInterval(), and setImageInterval().
|
protected |
Definition at line 428 of file mlKernelLineApplicator.h.
Referenced by applyToLine(), isInImageInterval(), operator=(), and setImageInterval().
|
protected |
Definition at line 430 of file mlKernelLineApplicator.h.
Referenced by getImageIntervalMax(), isInImageInterval(), and setImageInterval().
|
protected |
Definition at line 427 of file mlKernelLineApplicator.h.
Referenced by applyToLine(), isInImageInterval(), operator=(), and setImageInterval().
|
protected |
Definition at line 429 of file mlKernelLineApplicator.h.
Referenced by getImageIntervalMin(), isInImageInterval(), and setImageInterval().
|
static |
Strings for ApplyMode names. See mlKernalLineApplicator.cpp for the names.
Definition at line 115 of file mlKernelLineApplicator.h.