MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
mlKernelBaseModule.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13
15
16#if !defined(__mlKernelBaseModule_H)
17#define __mlKernelBaseModule_H
18
19// ML-includes
20#include "mlInitSystemKernel.h"
21#include "mlKernel.h"
22#include "mlKernelTools.h"
23#include "mlKernelMacros.h"
24
26
27//---------------------------------------------------------
226//---------------------------------------------------------
228{
229
230 friend class KernelBaseOpCalculateOutputImageHandler;
231
232protected:
240
241public:
245 {
246 return _kernel;
247 }
248
250 inline const Kernel& getConstKernel() const
251 {
252 return _kernel;
253 }
255
256
263 {
264 return _borderHandlingFld;
265 }
266
271 {
272 return _fillValueFld;
273 }
274
275 // The field value describes the number of filtering iterations to be applied
276 // each page of the output image; the default is 1. Values < 1 are handled as 1.
277 // Still untested.
278 // inline IntField *getNumIterationsFld() const { return _numIterationsFld; }
279
306
311 {
312 return *_referenceExtentFld;
313 }
315
316protected:
335
339
351
357
365
372
386
391
392
393protected:
396 virtual void
398 int outIndex,
400 int numInSubImgs,
402 size_t indexTabSize,
404 size_t loopIdx,
405 size_t iteration,
406 const ImageVector& ov1,
407 const ImageVector& ov2,
408 const ImageVector& pOf,
409 size_t numVox) = 0;
410
411private:
419
420 using Module::calculateOutputSubImage;
421
424
428 virtual UserThreadData* createUserThreadData(PagedImage* outImg);
429
443 static SubImageBox expandBox(const SubImageBox& inBox, const ImageVector& negFilterExt,
444 const ImageVector& posFilterExt, bool isSeparable, MLint numIterations);
445
446private:
449
453 EnumField* _borderHandlingFld;
454
458 DoubleField* _fillValueFld;
459
460 // Specifies the number of iterations of the algorithm
461 // onto the page; default is 1.
462 // Still not tested.
463 // IntField *_numIterationsFld;
464
468 EnumField* _referenceExtentFld;
470
472 Kernel _kernel;
473
476 ImageVector _calculatedReferenceInputExt;
477
482 ImageVector _calcReferenceInputExt() const;
483
489};
490
492
493#endif // of __mlKernelBaseModule_H
Base class for the calculation of pages of an output image (PagedImage) of a Module.
Field to encapsulate a double value.
Definition mlFields.h:567
Field to encapsulate an enumerated value.
Definition mlFields.h:185
Base class for all fields used in the ML.
Definition mlField.h:73
The module base class to apply kernels to an image.
virtual SubImageBox calculateValidDestArea(const SubImageBox &validDestArea, const SubImageBox &outSubImageBox)
Function called after the Kernel Framework calculated the valid area in the global destination image.
EnumField & getReferenceExtentModeFld() const
Returns how the reference extent for input images is calculated; valid values are InputImageRefExtent...
virtual void _connectToAllOutputs(Field *field)
Helper function to connect a field field to all output fields.
SubImageBox calculateInputSubImageBox(int inIndex, const SubImageBox &outSubImgBox, int outIndex) override
Calculates the region of the input image needed for the calculation of the output image region define...
EnumField * getBorderHandlingFld() const
virtual void _calcKernelPage(SubImage *outSubImg, int outIndex, SubImage *inSubImgs, int numInSubImgs, MLsoffset *indexTab, size_t indexTabSize, MLsoffset srcVoxelOffset, size_t loopIdx, size_t iteration, const ImageVector &ov1, const ImageVector &ov2, const ImageVector &pOf, size_t numVox)=0
This method is not intended to be overloaded directly, because it is subject to change.
virtual void calcOutSubImagePostProcessing(SubImage *outSubImg, int outIndex, SubImage *inSubImgs)
Called to postProcess the output image outSubImg with the index outIndex from the input subimage inSu...
virtual ImageVector _getCalculatedReferenceInputExt() const
Return the reference extent of input image dependent on the current value of _referenceExtentFld.
virtual void _setCorrectCorrelationMinMax(bool imageIntervalUsed=false, MLdouble intervalMin=0, MLdouble intervalMax=0, MLint inIdx=0, MLint outIdx=0)
This method calculates and sets the possible min/max values for output image outIdx if a correlation ...
InputImageRefExtent
Enumerator specifying the calculation mode for the extent of the reference extent of the input image.
@ Input0_ExtWithFill
Input 0 defines the reference extent of the input image, filling undefined input areas with fill valu...
@ MaxExtentsWithFill
Maximum component wise extent of all inputs, filling undefined input areas with fill value.
@ Input0_ExtWithoutFill
Input 0 defines the reference extent of the input image, leaving undefined input areas undefined.
@ MaxExtentsWithoutFill
Maximum component wise extent of all inputs, leaving undefined input areas undefined.
virtual void calcInSubImagePreparation(int outIndex, SubImage *inSubImgs)
Does some preprocessing on input subimages if we have more than one.
virtual ImageVector calculateOutInCoordShift(const ImageVector shift, const SubImageBox &outSubImageBox)
Function called after the Kernel Framework calculated the shift vector between input and output.
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Set properties of output image outputImage with output index outputIndex.
const Kernel & getConstKernel() const
Method to access the kernel as constant object. See also getKernel().
DoubleField * getFillValueFld() const
The field value is value written in input or output image borders where a border handling requires fi...
KernelBaseModule(int inputNum=1, int outputNum=1)
Constructor.
virtual SubImageBox calculateAreaToBeCalculated(const SubImageBox &areaToBeCalculated, const SubImageBox &outSubImageBox)
Function called after the Kernel Framework calculated which box needs to be calculated for the curren...
Base class for an image processing module of the ML.
Definition mlModule.h:150
virtual CalculateOutputImageHandler * createCalculateOutputImageHandler(PagedImage *outputImage)
Creates the CalculateOutputImageHandler for the given output image outputImage.
virtual void calculateOutputSubImage(SubImage *outputSubImage, int outputIndex, SubImage *inputSubImages)
Calculates page outputSubImage of output image with index outputIndex given the input image tiles in ...
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
This class manages/represents a rectangular 6D image region that is organized linearly in memory.
Definition mlSubImage.h:75
Base class for thread local data that is passed to CalculateOutputImageHandler::calculateOutputSubIma...
#define ML_ABSTRACT_MODULE_CLASS_HEADER(className)
Similar to 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.
MLint MLsoffset
Signed ML offset type that is a 32-bit signed integer on 32-bit platforms and a 64-bit integer on 64-...
Definition mlTypeDefs.h:559
double MLdouble
Definition mlTypeDefs.h:217
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition mlTypeDefs.h:489