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
19ML_START_NAMESPACE
20
27{
28public:
29
37
45
54
63
65
66protected:
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
88private:
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
170ML_END_NAMESPACE
KernelModule(int inputNum=1, int outputNum=1)
void handleNotification(Field *field) override
void calcRow(MLsoffset *indexTab, size_t indexTabSize, MLsoffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
void _userKernelPostUpdate() override
#define ML_MODULE_CLASS_HEADER(className)
#define MLKERNELEXPORT
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:561
MLint64 MLint
Definition mlTypeDefs.h:489
MLdouble KernelDataType
Define the standard data type for kernel elements to be used in this library.
Definition mlKernel.h:2180
TImageVector< MLint > ImageVector
Defines the standard ImageVector type that is used by the ML for indexing and coordinates.