ITK  5.4.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 
23 namespace itk
24 {
46 template <typename TInputImage, typename TOutputImage, typename TKernel>
47 class ITK_TEMPLATE_EXPORT ErodeObjectMorphologyImageFilter
48  : public ObjectMorphologyImageFilter<TInputImage, TOutputImage, TKernel>
49 {
50 public:
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
82  SetErodeValue(PixelType objectValue)
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 
110 protected:
112  ~ErodeObjectMorphologyImageFilter() override = default;
113  void
114  PrintSelf(std::ostream & os, Indent indent) const override;
115 
120  void
121  Evaluate(OutputNeighborhoodIteratorType & nit, const KernelType & kernel) override;
122 
123 private:
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
itk::ErodeObjectMorphologyImageFilter::KernelIteratorType
typename KernelType::ConstIterator KernelIteratorType
Definition: itkErodeObjectMorphologyImageFilter.h:72
itk::ErodeObjectMorphologyImageFilter::KernelType
TKernel KernelType
Definition: itkErodeObjectMorphologyImageFilter.h:69
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:284
itkObjectMorphologyImageFilter.h
itk::ErodeObjectMorphologyImageFilter
Erosion of an object in an image.
Definition: itkErodeObjectMorphologyImageFilter.h:47
itk::ErodeObjectMorphologyImageFilter::GetErodeValue
PixelType GetErodeValue()
Definition: itkErodeObjectMorphologyImageFilter.h:90
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ErodeObjectMorphologyImageFilter::SetErodeValue
void SetErodeValue(PixelType objectValue)
Definition: itkErodeObjectMorphologyImageFilter.h:82
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::ErodeObjectMorphologyImageFilter::KernelPixelType
typename TKernel::PixelType KernelPixelType
Definition: itkErodeObjectMorphologyImageFilter.h:102
itk::NeighborhoodIterator
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Definition: itkNeighborhoodIterator.h:212
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::ObjectMorphologyImageFilter
Base class for the morphological operations being applied to isolated objects in an image.
Definition: itkObjectMorphologyImageFilter.h:74