21#if !defined(__mlKernelModule_H)
22#define __mlKernelModule_H
816 bool _autoMinMaxValid;
822 bool _normImageInterval;
825 bool _normKernelInterval;
Field to encapsulate a boolean value.
Field to encapsulate a double value.
Base class for all fields used in the ML.
Field to encapsulate an integer value.
The module base class to apply kernels to an image.
The typically used convenience class to apply a kernel to an image.
virtual void _createExternalKernelFields(bool createUseToggle=false, bool defaultVal=false)
Creates a kernel input field and an information field.
void calcOutSubImagePostProcessing(SubImage *outSubImg, int outIndex, SubImage *inSubImgs) override
Called to postProcess the output image outSubImg with the index outIndex from the input subimage inIm...
DoubleField * getOutputMinFld() const
StringField * getKernelOutputFld() const
A field containing the current kernel.
virtual void _updateKernel()
Convenience routine to call the typically used _updateKernel() functionality, e.g.
BoolField * getUseKernelIntervalFld() const
A field enabling the usage of the _kernelIntervalMinFld and _kernelIntervalMaxFld if true.
void handleNotification(Field *field) override
Called when any parameter field is changed.
DoubleField * getImageIntervalMinFld() const
DoubleField * getImageIntervalMaxFld() const
A field containing the maximum limit of an interval specifying the values of voxels to be filtered.
virtual void _createKernelElementsSumField()
Creates an information field which will contain the sum of all kernel elements.
BoolField * getNormalizeFld() const
IntField * getKernelUFld() const
U extent of kernel. The field name will be "kernelU". Field default is 1 if created.
virtual void _userKernelPostUpdate()
Typical method to be overloaded by derived modules to apply kernel changes.
virtual void _createKernelInfoField()
Creates an information field about the current kernel and its creation process.
virtual void _createKernelOutputField()
Creates a kernel output field.
BoolField * getUseExternalKernelFld() const
A field enabling the usage of the _externalKernelFld if true.
IntField * getKernelZFld() const
Z extent of kernel. The field name will be "kernelZ". Field default is 1 if created.
NotifyField * getSetAutoMinMaxFld() const
Field which assigns the current settings of automatically determined minimum/maximum values of alread...
void _setKernelInterval(MLdouble minVal=-DBL_MAX, MLdouble maxVal=DBL_MAX)
Update private test members for fast kernel testings.
bool _isInImageInterval(MLdouble v) const
Test whether the value v is within image interval.
virtual void _createMinMaxFields(MLdouble minVal=0, MLdouble maxVal=0, bool defaultValue=false)
Creates a minimum and a maximum field containing minimum/maximum values for the output image.
BoolField * getUseImageIntervalFld() const
A field enabling the usage of the _imageIntervalMinFld and _imageIntervalMaxFld if true.
virtual void _createNormalizeField(bool defaultVal=false)
Creates a bool field which enables/disables the automatic normalization of the kernel after each chan...
KernelModule(int inputNum=1, int outputNum=1)
Constructor.
void _setImageInterval(MLdouble minVal=-DBL_MAX, MLdouble maxVal=DBL_MAX)
Update private test members for fast image interval testings.
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Computes the output image properties for output outIndex.
BoolField * getAutoCalcMinMaxFld() const
StringField * getKernelInfoFld() const
DoubleField * getOutputMaxFld() const
The maximum value used for the output image if _useAutoMinMax is on.
virtual void _createMakeSphericalField(bool defaultVal=false)
Creates a bool field which enables/disables the usage of a connected kernel.
virtual void _createNumKernelElementsField()
Creates an information field which will contain the number of kernel elements.
virtual void _validateKernelExtents()
Checks all existing kernel extent fields and corrects all to values >= 0 if necessary.
IntField * getKernelYFld() const
Y extent of kernel. The field name will be "kernelY". Field default is 3 if created.
void activateAttachments() override
Called when field loading or module cloning has finished.
IntField * getKernelCFld() const
C extent of kernel. The field name will be "kernelC". Field default is 1 if created.
virtual void _createKernelExtentFields(int numDim=6, const ImageVector &defaultExt=ImageVector(3, 3, 1, 1, 1, 1))
Creates the fields _kernelXFld, ... _kernelUFld and initializes them with the values 3,...
DoubleField * getKernelElementsSumFld() const
If created this methods returns the pointer to the field containing the sum of all kernel elements,...
DoubleField * getKernelIntervalMinFld() const
virtual void _createImageIntervalFields(MLdouble min=0, MLdouble max=1024, bool createToggle=false, bool useIt=false)
Creates two limit fields to specify an interval and - if createToggle is passed as true - a toggle to...
StringField * getExternalKernelFld() const
virtual void _updateKernel(bool permitExtentChanges)
This is the method to update the kernel, it should be called if the kernel requires an update,...
DoubleField * getKernelIntervalMaxFld() const
A field containing the maximum limit of an interval specifying the values of voxels under kernel elem...
IntField * getKernelXFld() const
X extent of kernel. The field name will be "kernelX". Field default is 3 if created.
BoolField * getUseMinMaxFld() const
If enabled then contents of _outputMinFld and _outputMaxFld will be used as minimum and maximum value...
virtual void _updateKernelOutputField()
Updates the kernel output to the value of the kernel if the _kernelOutputFld is defined.
virtual void _userKernelPreUpdate()
Typical method to be overloaded by derived modules to apply kernel changes.
virtual std::string _composeKernelInfo(bool valid=true) const
Create a string containing all important kernel information.
IntField * getKernelTFld() const
T extent of kernel. The field name will be "kernelT". Field default is 1 if created.
IntField * getNumKernelElementsFld() const
If created this field contains the number of voxels in the kernel.
BoolField * getMakeSphericalFld() const
Controls whether kernel is circular or rectangular (in 6D).
virtual void _createKernelIntervalFields(MLdouble min=0, MLdouble max=1024, bool createToggle=false, bool useIt=false)
Creates two limit fields to specify an interval and - if createToggle is passed as true - a toggle to...
virtual void _createMinMaxCalcFields(bool defaultValue=false, bool createSetOutputMinMax=false)
Creates a toggle field which enables the scan of calculated output pages for min/max values if enable...
bool _isInKernelInterval(MLdouble v) const
Test whether the value v is within kernel interval.
Field without value for notifications.
Class which represents an image, which manages properties of an image and image data which is located...
Field to encapsulate a string value.
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
#define ML_ABSTRACT_MODULE_CLASS_HEADER(className)
Like ML_ABSTRACT_CLASS_HEADER for the usage of derived classes from Module.
#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.
TImageVector< MLint > ImageVector
Defines the standard ImageVector type which is used by the ML for indexing and coordinates.