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
26
class
MLKERNELEXPORT
SurroundFilter
:
public
KernelModule
27
{
28
public
:
29
30
enum
DimensionSelect
31
{
32
USE2D = 0,
33
USE3D
,
34
35
NUM_DIMENSION_SELECTS
36
};
37
38
enum
Neighborhood2DSelect
39
{
40
USE4 = 0,
41
USE8
,
42
43
NUM_NEIGHBORHOOD_2D_SELECTS
44
};
45
46
enum
Neighborhood3DSelect
47
{
48
USE6 = 0,
49
USE18
,
50
USE26
,
51
52
NUM_NEIGHBORHOOD_3D_SELECTS
53
};
54
55
enum
BorderLocation
56
{
57
SET_INNER_BORDER = 0,
58
SET_OUTER_BORDER
,
59
SET_BOTH_BORDERS
,
60
61
NUM_BORDER_LOCATIONS
62
};
63
64
SurroundFilter
();
65
66
protected
:
67
68
CALC_ROW_H
();
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
167
ML_MODULE_CLASS_HEADER
(
SurroundFilter
);
168
};
169
170
ML_END_NAMESPACE
ml::BoolField
Field to encapsulate a boolean value.
Definition:
mlFields.h:62
ml::DoubleField
Field to encapsulate a double value.
Definition:
mlFields.h:806
ml::Field
Base class for all fields used in the ML.
Definition:
mlField.h:73
ml::KernelModule
The typically used convenience class to apply a kernel to an image.
Definition:
mlKernelModule.h:37
ml::PagedImage
Class which represents an image, which manages properties of an image and image data which is located...
Definition:
mlPagedImage.h:70
ml::SurroundFilter
Class to cover an object specified by a threshold with a voxel thick surface of selected values.
Definition:
mlSurroundFilter.h:27
ml::SurroundFilter::DimensionSelect
DimensionSelect
Definition:
mlSurroundFilter.h:31
ml::SurroundFilter::USE3D
@ USE3D
Definition:
mlSurroundFilter.h:33
ml::SurroundFilter::handleNotification
void handleNotification(Field *field) override
Called when any parameter field is changed.
ml::SurroundFilter::SurroundFilter
SurroundFilter()
ml::SurroundFilter::calcRow
void calcRow(MLsoffset *indexTab, size_t indexTabSize, MLsoffset, size_t numVox, DATATYPE *inCursor, DATATYPE *outCursor, const ImageVector &)
ml::SurroundFilter::BorderLocation
BorderLocation
Definition:
mlSurroundFilter.h:56
ml::SurroundFilter::SET_OUTER_BORDER
@ SET_OUTER_BORDER
Definition:
mlSurroundFilter.h:58
ml::SurroundFilter::SET_BOTH_BORDERS
@ SET_BOTH_BORDERS
Definition:
mlSurroundFilter.h:59
ml::SurroundFilter::Neighborhood2DSelect
Neighborhood2DSelect
Definition:
mlSurroundFilter.h:39
ml::SurroundFilter::USE8
@ USE8
Definition:
mlSurroundFilter.h:41
ml::SurroundFilter::calculateOutputImageProperties
void calculateOutputImageProperties(int outputIndex, PagedImage *outputImage) override
Computes the output image properties for output outIndex.
ml::SurroundFilter::_userKernelPostUpdate
void _userKernelPostUpdate() override
Typical method to be overloaded by derived modules to apply kernel changes.
ml::SurroundFilter::Neighborhood3DSelect
Neighborhood3DSelect
Definition:
mlSurroundFilter.h:47
ml::SurroundFilter::USE18
@ USE18
Definition:
mlSurroundFilter.h:49
ml::SurroundFilter::USE26
@ USE26
Definition:
mlSurroundFilter.h:50
ml::SurroundFilter::CALC_ROW_H
CALC_ROW_H()
ml::TImageVector< MLint >
ml::TypedEnumField< DimensionSelect >
ML_MODULE_CLASS_HEADER
#define ML_MODULE_CLASS_HEADER(className)
Like ML_CLASS_HEADER for the usage of derived classes from Module.
Definition:
mlRuntimeSubClass.h:245
mlInitSystemKernel.h
MLKERNELEXPORT
#define MLKERNELEXPORT
Includes files used in many parts of the dll, defined dll-specific macros and controls any system dep...
Definition:
mlInitSystemKernel.h:42
mlKernelModule.h
MLsoffset
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
MLint
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
ml::KernelDataType
MLdouble KernelDataType
Define the standard data type for kernel elements to be used in this library.
Definition:
mlKernel.h:2208
MeVisLab
Standard
Sources
ML
MLKernel
mlSurroundFilter.h
Generated by
1.9.1