ITK  6.0.0
Insight Toolkit
itkErodeObjectMorphologyImageFilter.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 itkErodeObjectMorphologyImageFilter_h
19#define itkErodeObjectMorphologyImageFilter_h
20
22
23namespace itk
24{
46template <typename TInputImage, typename TOutputImage, typename TKernel>
47class ITK_TEMPLATE_EXPORT ErodeObjectMorphologyImageFilter
48 : public ObjectMorphologyImageFilter<TInputImage, TOutputImage, TKernel>
49{
50public:
51 ITK_DISALLOW_COPY_AND_MOVE(ErodeObjectMorphologyImageFilter);
52
58
60 itkNewMacro(Self);
61
63 itkOverrideGetNameOfClassMacro(ErodeObjectMorphologyImageFilter);
64
66 using typename Superclass::PixelType;
67
69 using KernelType = TKernel;
70
72 using KernelIteratorType = typename KernelType::ConstIterator;
73
75
77 using typename Superclass::DefaultBoundaryConditionType;
78
81 void
83 {
84 this->SetObjectValue(objectValue);
85 }
86
89 PixelType
91 {
92 return this->GetObjectValue();
93 }
94
96 itkSetMacro(BackgroundValue, PixelType);
97
99 itkGetConstMacro(BackgroundValue, PixelType);
100
102 using KernelPixelType = typename TKernel::PixelType;
103
104#ifdef ITK_USE_CONCEPT_CHECKING
105 // Begin concept checking
106 itkConceptMacro(KernelGreaterThanComparableCheck, (Concept::GreaterThanComparable<KernelPixelType>));
107 // End concept checking
108#endif
109
110protected:
113 void
114 PrintSelf(std::ostream & os, Indent indent) const override;
115
120 void
121 Evaluate(OutputNeighborhoodIteratorType & nit, const KernelType & kernel) override;
122
123private:
124 PixelType m_BackgroundValue{};
125
126 // Default boundary condition for erosion filter, defaults to
127 // NumericTraits<PixelType>::max()
128 DefaultBoundaryConditionType m_ErodeBoundaryCondition{};
129}; // end of class
130} // end namespace itk
131
132#ifndef ITK_MANUAL_INSTANTIATION
133# include "itkErodeObjectMorphologyImageFilter.hxx"
134#endif
135
136#endif
void Evaluate(OutputNeighborhoodIteratorType &nit, const KernelType &kernel) override
~ErodeObjectMorphologyImageFilter() override=default
typename KernelType::ConstIterator KernelIteratorType
void PrintSelf(std::ostream &os, Indent indent) const override
Base class for all process objects that output image data.
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.
typename TInputImage::PixelType PixelType
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....