MeVisLab Toolbox Reference
mlSurroundFilter.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 #pragma once
14 
15 
16 #include "mlInitSystemKernel.h"
17 #include "mlKernelModule.h"
18 
19 ML_START_NAMESPACE
20 
27 {
28 public:
29 
31  {
32  USE2D = 0,
34 
35  NUM_DIMENSION_SELECTS
36  };
37 
39  {
40  USE4 = 0,
42 
43  NUM_NEIGHBORHOOD_2D_SELECTS
44  };
45 
47  {
48  USE6 = 0,
51 
52  NUM_NEIGHBORHOOD_3D_SELECTS
53  };
54 
56  {
57  SET_INNER_BORDER = 0,
60 
61  NUM_BORDER_LOCATIONS
62  };
63 
65 
66 protected:
67 
69 
70  template <typename DATATYPE>
71  void calcRow(MLsoffset *indexTab,
72  size_t indexTabSize,
73  MLsoffset /*srcVoxelOffset*/,
74  size_t numVox,
75  DATATYPE *inCursor,
76  DATATYPE *outCursor,
77  const ImageVector &/*rowStart*/);
78 
79  void handleNotification(Field* field) override;
80 
81  void calculateOutputImageProperties(int outputIndex, PagedImage* outputImage) override;
82 
83  // We overload this kernel update method to overwrite kernel settings resulting
84  // from inherited functionality.
85  void _userKernelPostUpdate() override;
86 
87 
88 private:
89 
92  TypedEnumField<DimensionSelect>* _dimensionSelectFld;
93 
95  TypedEnumField<Neighborhood2DSelect>* _neighborhood2DSelectFld;
96 
98  TypedEnumField<Neighborhood3DSelect>* _neighborhood3DSelectFld;
99 
101  TypedEnumField<BorderLocation>* _borderLocationFld;
102 
105  DoubleField* _outerBorderValueFld;
106 
109  DoubleField* _innerBorderValueFld;
110 
112  DoubleField* _lowerThresholdFld;
113 
115  DoubleField* _upperThresholdFld;
116 
119  BoolField* _onlyBorderFld;
120 
123  BoolField* _takeMaxFld;
124 
127  BoolField* _takeMiddleFld;
128 
131  BoolField* _twoDimFld;
132 
134  double _lowerThresholdClamped;
136  double _upperThresholdClamped;
137 
139  MLint _voxelIndex;
140 
142  KernelDataType _values2D[9];
143 
145  KernelDataType _values3D[27];
146 
149  static bool _mask2Duse4[9];
150 
153  static bool _mask2Duse8[9];
154 
157  static bool _mask3Duse6[27];
158 
161  static bool _mask3Duse18[27];
162 
165  static bool _mask3Duse26[27];
166 
168 };
169 
170 ML_END_NAMESPACE
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Field to encapsulate a double value.
Definition: mlFields.h:806
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
Class to cover an object specified by a threshold with a voxel thick surface of selected values.
void handleNotification(Field *field) override
Called when any parameter field is changed.
void calcRow(MLsoffset *indexTab, size_t indexTabSize, MLsoffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Computes the output image properties for output outIndex.
void _userKernelPostUpdate() override
Typical method to be overloaded by derived modules to apply kernel changes.
#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
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
MLdouble KernelDataType
Define the standard data type for kernel elements to be used in this library.
Definition: mlKernel.h:2208