17#if !defined(__mlKernelLineApplicator_H)
18#define __mlKernelLineApplicator_H
31#define ML_DEBUG_ENV_NAME "ML_KERNELLINEAPPLICATOR"
66 template <
typename DATATYPE,
typename KDATATYPE>
115 static const char*
const ApplyModeNames[];
224 _origIMinDT =
static_cast<DATATYPE>(min);
225 _origIMaxDT =
static_cast<DATATYPE>(max);
226 _normOrigI = _origIMin <= _origIMax;
241 _kernIMinDT =
static_cast<DATATYPE>(min);
242 _kernIMaxDT =
static_cast<DATATYPE>(max);
243 _normKernI = _kernIMin <= _kernIMax;
262 (( _normOrigI && ((
static_cast<MLdouble>(v) >=_origIMin) && (
static_cast<MLdouble>(v) <= _origIMax))) ||
263 (!_normOrigI && ((
static_cast<MLdouble>(v) < _origIMax) || (
static_cast<MLdouble>(v) > _origIMin))) ) :
266 (( _normOrigI && ((v >=_origIMinDT) && (v <= _origIMaxDT))) ||
267 (!_normOrigI && ((v < _origIMaxDT) || (v > _origIMinDT))) )
283 (( _normKernI && ((
static_cast<MLdouble>(v) >=_kernIMin) && (
static_cast<MLdouble>(v) <= _kernIMax))) ||
284 (!_normKernI && ((
static_cast<MLdouble>(v) < _kernIMax) || (
static_cast<MLdouble>(v) > _kernIMin))) ) :
287 (( _normKernI && ((v >=_kernIMinDT) && (v <= _kernIMaxDT))) ||
288 (!_normKernI && ((v < _kernIMaxDT) || (v > _kernIMinDT))) )
311 outSubImg->getCursorPos(),
321 outSubImg->getCursorPos(),
326 case APPLY_USER_FILTER:
338 case APPLY_IMAGE_INTERVAL_FILTER:
349 case APPLY_KERNEL_INTERVAL_FILTER:
360 case APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER:
388 outSubImg->getCursorPos(),
404 _applyMode = APPLY_NORMALLY;
453template <
typename DATATYPE,
typename KDATATYPE>
const char *
const
458 "ApplyImageIntervalFilter",
459 "ApplyKernelIntervalFilter",
460 "ApplyImageAndKernelInterval"
466#undef ML_DEBUG_ENV_NAME
The KernelLineApplicatorBase class is designed to implement new kernel based filters to be applied to...
const KernelLineApplicatorBase< DATATYPE, KDATATYPE > & operator=(const KernelLineApplicatorBase< DATATYPE, KDATATYPE > &kernLineAppBase)
Assignment operator. Assures that dynamic and normal members are copied correctly.
virtual void _clearIndices()
Removes the current _indexTab.
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 kern...
void setKernel(const TKernel< KDATATYPE > &kernel)
The KernelLineApplicator class takes a Kernel instance and filters one line of an mlSubImage and writ...
ApplyMode
The ApplyModes decide about the way how the kernel is used to filter the input image and which parts ...
@ APPLY_IMAGE_INTERVAL_FILTER
@ APPLY_IMAGE_AND_KERNEL_INTERVAL_FILTER
@ APPLY_KERNEL_INTERVAL_FILTER
ApplyMode _applyMode
The mode how the kernel is applied to the image.
KernelLineApplicator()
Default constructor.
KernelLineApplicator(const TKernel< KDATATYPE > &kernel, ApplyMode applyMode, MLdouble iIntMin=-DBL_MIN, MLdouble iIntMax=DBL_MAX, MLdouble kIntMin=-DBL_MIN, MLdouble kIntMax=DBL_MAX)
Convenience constructor to create a complete line applicator with all important parameters set.
DATATYPE getImageIntervalMin() const
void setApplyMode(ApplyMode mode)
bool _normOrigI
_normOrigI==true indicates that the interval is used exclusively.
void applyToLine(TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *outSubImg, size_t numVox)
Selects the correct line filter mode and filters a row with the currently specified kernel.
void setImageInterval(MLdouble min=-DBL_MAX, MLdouble max=DBL_MAX)
Correlations can be applied to a subset of voxels by setting a threshold interval which includes the ...
bool isInImageInterval(DATATYPE v) const
Test whether the value v is within image interval.
const KernelLineApplicator & operator=(const KernelLineApplicator &kernLineApp)
Assignment operator. Assures that dynamic and normal members are copied correctly.
bool isInKernelInterval(DATATYPE v) const
Test whether the value v is within kernel interval.
virtual void applyUserFilterToLine(TSubImageWithCursor< DATATYPE > *inSubImg, TSubImageWithCursor< DATATYPE > *outSubImg, long numVox) const
Filter a row with the current kernel with a user defined algorithm.
void _init()
Initialization the current instance of mlKernelApplicator. To be called by constructors.
KernelLineApplicator(const KernelLineApplicator &kernLineApp)
Copy constructor.
DATATYPE getKernelIntervalMin() const
DATATYPE getKernelIntervalMax() const
bool _normKernI
_normKernI==true indicates that the interval is used exclusively.
void setKernelInterval(MLdouble min=-DBL_MAX, MLdouble max=DBL_MAX)
When filtering an image then voxels covered by the kernel elements outside a certain grey level inter...
ApplyMode getApplyMode() const
virtual ~KernelLineApplicator()
Destructor. Frees dynamic members.
DATATYPE getImageIntervalMax() const
Class to manage a filtering kernel for images.
A class that offers a TSubImage with a TSubImageCursor.
#define MLKERNELEXPORT
Includes files used in many parts of the dll, defined dll-specific macros and controls any system dep...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
TypeTraits for scalar ML Datatypes.