ITK  6.0.0
Insight Toolkit
itkMorphologyImageFilter.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 itkMorphologyImageFilter_h
19#define itkMorphologyImageFilter_h
20
23#include "itkNeighborhood.h"
27
28namespace itk
29{
71template <typename TInputImage, typename TOutputImage, typename TKernel>
72class ITK_TEMPLATE_EXPORT MorphologyImageFilter : public KernelImageFilter<TInputImage, TOutputImage, TKernel>
73{
74public:
75 ITK_DISALLOW_COPY_AND_MOVE(MorphologyImageFilter);
76
82
84 itkOverrideGetNameOfClassMacro(MorphologyImageFilter);
85
87 using InputImageType = TInputImage;
88 using OutputImageType = TOutputImage;
92 using PixelType = typename TInputImage::PixelType;
93 using typename Superclass::OutputImageRegionType;
94
96 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
97
102
105
107 using KernelType = TKernel;
108
110 using KernelIteratorType = typename KernelType::ConstIterator;
111
114
120 void
122 {
123 m_BoundaryCondition = i;
124 }
125
127 void
129 {
130 m_BoundaryCondition = &m_DefaultBoundaryCondition;
131 }
132
134 itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
135
136protected:
138 ~MorphologyImageFilter() override = default;
139 void
140 PrintSelf(std::ostream & os, Indent indent) const override;
141
143 void
144 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
145
146
149 virtual PixelType
151 const KernelIteratorType kernelBegin,
152 const KernelIteratorType kernelEnd) = 0;
153
154private:
158
160 DefaultBoundaryConditionType m_DefaultBoundaryCondition{};
161}; // end of class
162} // end namespace itk
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "itkMorphologyImageFilter.hxx"
166#endif
167
168#endif
typename TInputImage::RegionType RegionType
typename TInputImage::SizeType SizeType
typename TInputImage::SizeType RadiusType
typename TInputImage::IndexType IndexType
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
A base class for all the filters working on an arbitrary shaped neighborhood.
Base class for the morphological operations such as erosion and dilation.
typename KernelType::ConstIterator KernelIteratorType
~MorphologyImageFilter() override=default
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
virtual PixelType Evaluate(const NeighborhoodIteratorType &nit, const KernelIteratorType kernelBegin, const KernelIteratorType kernelEnd)=0
typename TInputImage::PixelType PixelType
void PrintSelf(std::ostream &os, Indent indent) const override
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....