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>
27#include "itkConceptChecking.h"
28
29namespace itk
30{
95template <typename TInputImage, typename TOutputImage, typename TKernel>
96class ITK_TEMPLATE_EXPORT BinaryMorphologyImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
97{
98public:
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
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;
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
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
179protected:
181 ~BinaryMorphologyImageFilter() override = default;
182 void
183 PrintSelf(std::ostream & os, Indent indent) const override;
184
187 void
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
205 GetDifferenceSet(unsigned int code)
206 {
207 return m_KernelDifferenceSets[code];
208 }
209
212 ComponentVectorConstIterator
214 {
215 return m_KernelCCVector.begin();
216 }
217
220 ComponentVectorConstIterator
222 {
223 return m_KernelCCVector.end();
224 }
225
227
228private:
231
234
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
void PrintSelf(std::ostream &os, Indent indent) const override
ComponentVectorConstIterator KernelCCVectorEnd()
~BinaryMorphologyImageFilter() override=default
ComponentVectorConstIterator KernelCCVectorBegin()
KernelImageFilter< InputImageType, OutputImageType, KernelType > Superclass
void SetKernel(const KernelType &kernel) override
NeighborIndexContainer & GetDifferenceSet(unsigned int code)
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....