MeVisLab Toolbox Reference
mlSobel3DFilter.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(__mlSobel3DFilter_H)
17 #define __mlSobel3DFilter_H
18 
19 // ML-includes
20 #include "mlInitSystemKernel.h"
21 #include "mlKernel.h"
22 #include "mlKernelModule.h"
23 
24 ML_START_NAMESPACE
25 
26  //--------------------------------------------------------------------------------
34  //--------------------------------------------------------------------------------
36 
37  public:
38 
39  //-------------------------------------------------------------------
54  //-------------------------------------------------------------------
56 
57  //-------------------------------------------------------------------
60  //-------------------------------------------------------------------
61  inline FloatField* getEdgeThresholdMinimumValueFld() const { return _edgeThresholdMinimumValueFld; }
62  inline FloatField* getEdgeThresholdMaximumValueFld() const { return _edgeThresholdMaximumValueFld; }
63  inline FloatField* getDetectedEdgeValueFld () const { return _detectedEdgeValueFld ; }
64  inline FloatField* getDetectedNonEdgeValueFld () const { return _detectedNonEdgeValueFld ; }
65  inline EnumField* getFilterModeFld () const { return _filterModeFld ; }
66  inline BoolField* getVoxelSizeFld () const { return _useVoxelSizeFld ; }
67 
69 
72  GRAD_STRENGTH = 0,
73  EDGE_DETECTION = 1,
74  GRAD_ESTIMATION = 2,
75  GRAD_ESTIMATION_AND_STRENGTH_PACKED = 3
76  };
77 
78  protected:
79 
86 
89  template <typename DATATYPE>
90  void calcRow(MLsoffset *indexTab,
91  size_t indexTabSize,
92  MLsoffset /*srcVoxelOffset*/,
93  size_t numVox,
96  const ImageVector &/*rowStart*/);
97 
99  void handleNotification(Field* field) override;
100 
102  void calculateOutputImageProperties(int outputIndex, PagedImage* outputImage) override;
103 
104 private:
105 
107  FloatField* _edgeThresholdMinimumValueFld;
108 
110  FloatField* _edgeThresholdMaximumValueFld;
111 
113  FloatField* _detectedEdgeValueFld;
114 
116  FloatField* _detectedNonEdgeValueFld;
117 
119  TypedEnumField<Sobel3DModeType>* _filterModeFld;
120 
122  BoolField* _useVoxelSizeFld;
123 
125  Kernel _sobelKernX;
126 
128  Kernel _sobelKernY;
129 
131  Kernel _sobelKernZ;
132 
134  static KernelDataType _sKernX[27];
135 
137  static KernelDataType _sKernY[27];
138 
140  static KernelDataType _sKernZ[27];
141 
143  static KernelDataType _dKern[27];
144 
147  MLdouble _scaleFac;
148 
154  };
155 
156 ML_END_NAMESPACE
157 
158 #endif //of __mlSobel3DFilter_H
159 
160 
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
Base class for all fields used in the ML.
Definition: mlField.h:73
Field to encapsulate a float value.
Definition: mlFields.h:627
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
Applies a Sobel edge detection or a Sobel gradient estimation in 3D to a volume image.
BoolField * getVoxelSizeFld() const
CALC_ROW_H()
Macro which needs to be added to the implementation of a class derived from KernelModule or KernelBas...
void calcRow(MLsoffset *indexTab, size_t indexTabSize, MLsoffset, size_t numVox, TSubImageWithCursor< DATATYPE > &inSubImg, TSubImageWithCursor< DATATYPE > &outSubImg, const ImageVector &)
In this 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.
EnumField * getFilterModeFld() const
Sobel3DModeType
enum field for filterModes
void handleNotification(Field *field) override
Called when a parameter field is changed.
FloatField * getEdgeThresholdMaximumValueFld() const
FloatField * getDetectedEdgeValueFld() const
Sobel3DFilter()
Constructor.
FloatField * getEdgeThresholdMinimumValueFld() const
FloatField * getDetectedNonEdgeValueFld() const
A class that offers a TSubImage with a TSubImageCursor.
Definition: mlTSubImage.h:1277
#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
double MLdouble
Definition: mlTypeDefs.h:223
MLdouble KernelDataType
Define the standard data type for kernel elements to be used in this library.
Definition: mlKernel.h:2208