ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMorphologyImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 
21 #include "itkKernelImageFilter.h"
23 #include "itkNeighborhood.h"
24 #include "itkConstSliceIterator.h"
26 #include "itkImageRegionIterator.h"
27 
28 namespace itk
29 {
71 template< typename TInputImage, typename TOutputImage, typename TKernel >
72 class ITK_TEMPLATE_EXPORT MorphologyImageFilter:
73  public KernelImageFilter< TInputImage, TOutputImage, TKernel >
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_ASSIGN(MorphologyImageFilter);
77 
83 
86 
88  using InputImageType = TInputImage;
89  using OutputImageType = TOutputImage;
91  using SizeType = typename TInputImage::SizeType;
93  using PixelType = typename TInputImage::PixelType;
94  using OutputImageRegionType = typename Superclass::OutputImageRegionType;
95 
97  static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
98 
103 
106 
108  using KernelType = TKernel;
109 
111  using KernelIteratorType = typename KernelType::ConstIterator;
112 
115 
122  {
123  m_BoundaryCondition = i;
124  }
125 
128  {
129  m_BoundaryCondition = &m_DefaultBoundaryCondition;
130  }
131 
133  itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
134 
135 protected:
137  ~MorphologyImageFilter() override = default;
138  void PrintSelf(std::ostream & os, Indent indent) const override;
139 
141  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
142 
143 
146  virtual PixelType Evaluate(const NeighborhoodIteratorType & nit,
147  const KernelIteratorType kernelBegin,
148  const KernelIteratorType kernelEnd) = 0;
149 
150 private:
154 
157 }; // end of class
158 } // end namespace itk
159 
160 #ifndef ITK_MANUAL_INSTANTIATION
161 #include "itkMorphologyImageFilter.hxx"
162 #endif
163 
164 #endif
typename TInputImage::SizeType RadiusType
typename TInputImage::IndexType IndexType
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
typename TInputImage::RegionType RegionType
ImageBoundaryConditionPointerType m_BoundaryCondition
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
typename KernelType::ConstIterator KernelIteratorType
DefaultBoundaryConditionType m_DefaultBoundaryCondition
Base class for all process objects that output image data.
Base class for the morphological operations such as erosion and dialation.
typename OutputImageType::RegionType OutputImageRegionType
typename TInputImage::SizeType SizeType
typename TInputImage::PixelType PixelType
TOutputImage OutputImageType
A base class for all the filters working on an arbitrary shaped neighborhood.
Control indentation during Print() invocation.
Definition: itkIndent.h:49