ITK  6.0.0
Insight Toolkit
itkObjectMorphologyImageFilter.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 itkObjectMorphologyImageFilter_h
19#define itkObjectMorphologyImageFilter_h
20
26
27namespace itk
28{
73template <typename TInputImage, typename TOutputImage, typename TKernel>
74class ITK_TEMPLATE_EXPORT ObjectMorphologyImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
75{
76public:
77 ITK_DISALLOW_COPY_AND_MOVE(ObjectMorphologyImageFilter);
85
87 itkOverrideGetNameOfClassMacro(ObjectMorphologyImageFilter);
88
90 using InputImageType = TInputImage;
91 using OutputImageType = TOutputImage;
95 using PixelType = typename TInputImage::PixelType;
96
97 using typename Superclass::OutputImageRegionType;
98
102
104 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
105 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
106 static constexpr unsigned int KernelDimension = TKernel::NeighborhoodDimension;
107
111
113 using KernelType = TKernel;
114
116 using KernelIteratorType = typename KernelType::ConstIterator;
117
120
122 itkSetMacro(Kernel, KernelType);
123
125 itkGetConstReferenceMacro(Kernel, KernelType);
126
128 itkGetConstMacro(ObjectValue, PixelType);
129
131 itkSetMacro(ObjectValue, PixelType);
132
138 void
140
147 void
149 {
150 m_BoundaryCondition = i;
151 }
152
154 void
156 {
157 m_BoundaryCondition = &m_DefaultBoundaryCondition;
158 }
159
161 itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
162
167 itkSetMacro(UseBoundaryCondition, bool);
168
173 itkGetConstMacro(UseBoundaryCondition, bool);
174
175#ifdef ITK_USE_CONCEPT_CHECKING
176 // Begin concept checking
179 itkConceptMacro(OutputInputEqualityComparableCheck,
184 itkConceptMacro(InputOStreamWritableCheck, (Concept::OStreamWritable<PixelType>));
185 // End concept checking
186#endif
187
188protected:
190 ~ObjectMorphologyImageFilter() override = default;
191 void
192 PrintSelf(std::ostream & os, Indent indent) const override;
193
195 void
197
200 virtual void
202
206 bool
208
212
214 DefaultBoundaryConditionType m_DefaultBoundaryCondition{};
215
217 bool m_UseBoundaryCondition{};
218
220 KernelType m_Kernel{};
221
223 PixelType m_ObjectValue{};
224
225 void
227}; // end of class
228} // end namespace itk
229
230#ifndef ITK_MANUAL_INSTANTIATION
231# include "itkObjectMorphologyImageFilter.hxx"
232#endif
233
234#endif
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Base class for the morphological operations being applied to isolated objects in an image.
~ObjectMorphologyImageFilter() override=default
virtual void Evaluate(OutputNeighborhoodIteratorType &nit, const KernelType &kernel)=0
typename TInputImage::RegionType RegionType
typename KernelType::ConstIterator KernelIteratorType
void GenerateInputRequestedRegion() override
void PrintSelf(std::ostream &os, Indent indent) const override
bool IsObjectPixelOnBoundary(const InputNeighborhoodIteratorType &iNIter)
void DynamicThreadedGenerateData(const OutputImageRegionType &) override
typename TInputImage::IndexType IndexType
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
typename TInputImage::PixelType PixelType
void BeforeThreadedGenerateData() override
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....