ITK
6.0.0
Insight Toolkit
Loading...
Searching...
No Matches
itkBinaryMorphologyImageFilter.h
Go to the documentation of this file.
1
/*=========================================================================
2
*
3
* Copyright NumFOCUS
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* https://www.apache.org/licenses/LICENSE-2.0.txt
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*=========================================================================*/
18
#ifndef itkBinaryMorphologyImageFilter_h
19
#define itkBinaryMorphologyImageFilter_h
20
21
#include <vector>
22
#include <queue>
23
#include "
itkKernelImageFilter.h
"
24
#include "
itkNeighborhoodIterator.h
"
25
#include "
itkImageBoundaryCondition.h
"
26
#include "
itkImageRegionIterator.h
"
27
#include "
itkConceptChecking.h
"
28
29
namespace
itk
30
{
95
template
<
typename
TInputImage,
typename
TOutputImage,
typename
TKernel>
96
class
ITK_TEMPLATE_EXPORT
BinaryMorphologyImageFilter
:
public
KernelImageFilter
<TInputImage, TOutputImage, TKernel>
97
{
98
public
:
99
ITK_DISALLOW_COPY_AND_MOVE(
BinaryMorphologyImageFilter
);
101
103
static
constexpr
unsigned
int
InputImageDimension
= TInputImage::ImageDimension;
104
static
constexpr
unsigned
int
OutputImageDimension
= TOutputImage::ImageDimension;
105
107
static
constexpr
unsigned
int
KernelDimension
= TKernel::NeighborhoodDimension;
108
110
using
InputImageType
= TInputImage;
111
using
OutputImageType
= TOutputImage;
112
114
using
Self
=
BinaryMorphologyImageFilter
;
115
using
Superclass
=
KernelImageFilter<InputImageType, OutputImageType, TKernel>
;
116
using
Pointer
=
SmartPointer<Self>
;
117
using
ConstPointer
=
SmartPointer<const Self>
;
118
120
itkNewMacro(
Self
);
121
123
itkOverrideGetNameOfClassMacro(
BinaryMorphologyImageFilter
);
124
126
using
KernelType
= TKernel;
127
129
using
KernelIteratorType
=
typename
KernelType::ConstIterator;
130
132
using
InputPixelType
=
typename
InputImageType::PixelType;
133
using
OutputPixelType
=
typename
OutputImageType::PixelType;
134
using
InputRealType
=
typename
NumericTraits<InputPixelType>::RealType
;
135
using
OffsetType
=
typename
InputImageType::OffsetType;
136
using
IndexType
=
typename
InputImageType::IndexType;
137
using
IndexValueType
=
typename
InputImageType::IndexValueType;
138
139
using
InputImageRegionType
=
typename
InputImageType::RegionType;
140
using
OutputImageRegionType
=
typename
OutputImageType::RegionType;
141
using
InputSizeType
=
typename
InputImageType::SizeType;
142
using
InputSizeValueType
=
typename
InputImageType::SizeValueType;
143
145
itkConceptMacro
(ImageDimensionCheck, (
Concept::SameDimension<Self::InputImageDimension, Self::OutputImageDimension>
));
146
150
itkSetMacro(ForegroundValue,
InputPixelType
);
151
154
itkGetConstMacro(ForegroundValue,
InputPixelType
);
155
160
itkSetMacro(BackgroundValue,
OutputPixelType
);
161
166
itkGetConstMacro(BackgroundValue,
OutputPixelType
);
167
170
itkSetMacro(BoundaryToForeground,
bool
);
171
itkGetConstReferenceMacro(BoundaryToForeground,
bool
);
172
itkBooleanMacro(BoundaryToForeground);
174
176
void
177
SetKernel
(
const
KernelType
& kernel)
override
;
178
179
protected
:
180
BinaryMorphologyImageFilter
();
181
~BinaryMorphologyImageFilter
()
override
=
default
;
182
void
183
PrintSelf
(std::ostream & os,
Indent
indent)
const override
;
184
187
void
188
AnalyzeKernel
();
189
191
using
NeighborIndexContainer
= std::vector<OffsetType>;
192
194
using
NeighborIndexContainerContainer
= std::vector<NeighborIndexContainer>;
195
197
using
ComponentVectorType
= std::vector<OffsetType>;
198
200
using
ComponentVectorConstIterator
=
typename
ComponentVectorType::const_iterator;
201
204
NeighborIndexContainer
&
205
GetDifferenceSet
(
unsigned
int
code)
206
{
207
return
m_KernelDifferenceSets
[code];
208
}
209
212
ComponentVectorConstIterator
213
KernelCCVectorBegin
()
214
{
215
return
m_KernelCCVector
.begin();
216
}
217
220
ComponentVectorConstIterator
221
KernelCCVectorEnd
()
222
{
223
return
m_KernelCCVector
.end();
224
}
225
226
bool
m_BoundaryToForeground
{};
227
228
private
:
230
InputPixelType
m_ForegroundValue
{};
231
233
OutputPixelType
m_BackgroundValue
{};
234
236
NeighborIndexContainerContainer
m_KernelDifferenceSets
{};
237
241
std::vector<OffsetType>
m_KernelCCVector
{};
242
};
243
}
// end namespace itk
244
245
#ifndef ITK_MANUAL_INSTANTIATION
246
# include "itkBinaryMorphologyImageFilter.hxx"
247
#endif
248
249
#endif
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputPixelType
typename InputImageType::PixelType InputPixelType
Definition
itkBinaryMorphologyImageFilter.h:132
itk::BinaryMorphologyImageFilter::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::ConstPointer
SmartPointer< const Self > ConstPointer
Definition
itkBinaryMorphologyImageFilter.h:117
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputSizeType
typename InputImageType::SizeType InputSizeType
Definition
itkBinaryMorphologyImageFilter.h:141
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::OutputImageType
OutputImageType OutputImageType
Definition
itkBinaryMorphologyImageFilter.h:111
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::KernelType
KernelType KernelType
Definition
itkBinaryMorphologyImageFilter.h:126
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::KernelIteratorType
typename KernelType::ConstIterator KernelIteratorType
Definition
itkBinaryMorphologyImageFilter.h:129
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::Pointer
SmartPointer< Self > Pointer
Definition
itkBinaryMorphologyImageFilter.h:116
itk::BinaryMorphologyImageFilter::KernelCCVectorEnd
ComponentVectorConstIterator KernelCCVectorEnd()
Definition
itkBinaryMorphologyImageFilter.h:221
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputSizeValueType
typename InputImageType::SizeValueType InputSizeValueType
Definition
itkBinaryMorphologyImageFilter.h:142
itk::BinaryMorphologyImageFilter::~BinaryMorphologyImageFilter
~BinaryMorphologyImageFilter() override=default
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::OutputImageDimension
static constexpr unsigned int OutputImageDimension
Definition
itkBinaryMorphologyImageFilter.h:104
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::m_BoundaryToForeground
bool m_BoundaryToForeground
Definition
itkBinaryMorphologyImageFilter.h:226
itk::BinaryMorphologyImageFilter::KernelCCVectorBegin
ComponentVectorConstIterator KernelCCVectorBegin()
Definition
itkBinaryMorphologyImageFilter.h:213
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputImageDimension
static constexpr unsigned int InputImageDimension
Definition
itkBinaryMorphologyImageFilter.h:103
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::ComponentVectorConstIterator
typename ComponentVectorType::const_iterator ComponentVectorConstIterator
Definition
itkBinaryMorphologyImageFilter.h:200
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::NeighborIndexContainerContainer
std::vector< NeighborIndexContainer > NeighborIndexContainerContainer
Definition
itkBinaryMorphologyImageFilter.h:194
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputRealType
typename NumericTraits< InputPixelType >::RealType InputRealType
Definition
itkBinaryMorphologyImageFilter.h:134
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::Superclass
KernelImageFilter< InputImageType, OutputImageType, KernelType > Superclass
Definition
itkBinaryMorphologyImageFilter.h:115
itk::BinaryMorphologyImageFilter::BinaryMorphologyImageFilter
BinaryMorphologyImageFilter()
itk::BinaryMorphologyImageFilter::SetKernel
void SetKernel(const KernelType &kernel) override
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputImageType
InputImageType InputImageType
Definition
itkBinaryMorphologyImageFilter.h:110
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::OffsetType
typename InputImageType::OffsetType OffsetType
Definition
itkBinaryMorphologyImageFilter.h:135
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::ComponentVectorType
std::vector< OffsetType > ComponentVectorType
Definition
itkBinaryMorphologyImageFilter.h:197
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::KernelDimension
static constexpr unsigned int KernelDimension
Definition
itkBinaryMorphologyImageFilter.h:107
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::InputImageRegionType
typename InputImageType::RegionType InputImageRegionType
Definition
itkBinaryMorphologyImageFilter.h:139
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::IndexType
typename InputImageType::IndexType IndexType
Definition
itkBinaryMorphologyImageFilter.h:136
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::m_ForegroundValue
InputPixelType m_ForegroundValue
Definition
itkBinaryMorphologyImageFilter.h:230
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::OutputPixelType
typename OutputImageType::PixelType OutputPixelType
Definition
itkBinaryMorphologyImageFilter.h:133
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::m_KernelCCVector
std::vector< OffsetType > m_KernelCCVector
Definition
itkBinaryMorphologyImageFilter.h:241
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::OutputImageRegionType
typename OutputImageType::RegionType OutputImageRegionType
Definition
itkBinaryMorphologyImageFilter.h:140
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::m_BackgroundValue
OutputPixelType m_BackgroundValue
Definition
itkBinaryMorphologyImageFilter.h:233
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::m_KernelDifferenceSets
NeighborIndexContainerContainer m_KernelDifferenceSets
Definition
itkBinaryMorphologyImageFilter.h:236
itk::BinaryMorphologyImageFilter::AnalyzeKernel
void AnalyzeKernel()
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::IndexValueType
typename InputImageType::IndexValueType IndexValueType
Definition
itkBinaryMorphologyImageFilter.h:137
itk::BinaryMorphologyImageFilter::GetDifferenceSet
NeighborIndexContainer & GetDifferenceSet(unsigned int code)
Definition
itkBinaryMorphologyImageFilter.h:205
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::NeighborIndexContainer
std::vector< OffsetType > NeighborIndexContainer
Definition
itkBinaryMorphologyImageFilter.h:191
itk::BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType >::Self
BinaryMorphologyImageFilter Self
Definition
itkBinaryMorphologyImageFilter.h:114
itk::Indent
Control indentation during Print() invocation.
Definition
itkIndent.h:50
itk::KernelImageFilter::KernelImageFilter
KernelImageFilter()
itk::NumericTraits::RealType
double RealType
Definition
itkNumericTraits.h:86
itk::SmartPointer
Implements transparent reference counting.
Definition
itkSmartPointer.h:52
itkConceptChecking.h
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition
itkConceptChecking.h:65
itkImageBoundaryCondition.h
itkImageRegionIterator.h
itkKernelImageFilter.h
itkNeighborhoodIterator.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition
itkAnatomicalOrientation.h:30
itk::Concept::SameDimension
Definition
itkConceptChecking.h:698
ITK
Modules
Filtering
BinaryMathematicalMorphology
include
itkBinaryMorphologyImageFilter.h
Generated on
unknown
for ITK by
1.13.2
Tarballs of release and nightly generated Doxygen documentation are available in the
InsightSoftwareConsortium/ITKDoxygen
GitHub Releases
.