MeVisLab Toolbox Reference
mlConvolutionFilter.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 
16 
17 #if !defined (__mlConvolutionFilter_H)
18 #define __mlConvolutionFilter_H
19 
20 // ML-includes
21 #include "mlInitSystemKernel.h"
22 #include "mlKernel.h"
23 #include "mlKernelModule.h"
24 
25 ML_START_NAMESPACE
26 
27  //--------------------------------------------------
35  //--------------------------------------------------
37 
38  public:
39 
40  //--------------------------------------------------------------------------------------------------------
126  //--------------------------------------------------------------------------------------------------------
128  AVERAGE_33_KERNEL = 0,
143 
144  NUM_CONV_KERNEL_TYPES
145  };
146 
148  static const char* const ConvKernelNames[];
149 
150  //-------------------------------------------------------------------
166  //-------------------------------------------------------------------
168 
170  EnumField *getConvKernelFld() const { return _convKernelFld; }
171 
172  protected:
174  void handleNotification(Field* field) override;
175 
178  void _userKernelPostUpdate() override;
179 
182  void calculateOutputImageProperties(int outputIndex, PagedImage* outputImage) override;
183 
190 
193  template <typename DATATYPE>
194  void calcRow(MLsoffset *indexTab,
195  size_t indexTabSize,
196  MLsoffset srcVoxelOffset,
197  size_t numVox,
198  DATATYPE *inCursor,
199  DATATYPE *outCursor,
200  const ImageVector &/*rowStart*/);
201 
202  private:
204  EnumField *_convKernelFld;
205 
211  };
212 
213 ML_END_NAMESPACE
214 
215 #endif //of __mlConvolutionFilter_H
216 
217 
This class implements convolutions with fixed kernel sizes.
void _userKernelPostUpdate() override
Update the kernel to the selected kernel state if no external kernel is connected.
void calcRow(MLsoffset *indexTab, size_t indexTabSize, MLsoffset srcVoxelOffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
In this virtual template method the filtering of one row needs to be implemented.
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Computes the output image properties from the input image properties and the _convKernelFld.
ConvolutionFilter()
Constructor.
void handleNotification(Field *field) override
Called when a parameter field is changed.
ConvKernelTypes
The ConvKernelTypes decide which kernel is used to filter the input image.
EnumField * getConvKernelFld() const
Access to parameter field(s) See documentation of _convKernelFld.
CALC_ROW_H()
The implementation of the calculateOutputSubImage() method overloaded from Module is done in this mac...
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
Base class for all fields used in the ML.
Definition: mlField.h:73
The typically used convenience class to apply a kernel to an image.
Class which represents an image, which manages properties of an image and image data which is located...
Definition: mlPagedImage.h:70
#define ML_MODULE_CLASS_HEADER(className)
Like ML_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...
MLint MLsoffset
Signed ML offset type which is a 32 bit signed integer on 32 bit platforms and a 64 bit integer on 64...
Definition: mlTypeDefs.h:650