ITK  4.13.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:
81 
84 
86  typedef TInputImage InputImageType;
87  typedef TOutputImage OutputImageType;
88  typedef typename TInputImage::RegionType RegionType;
89  typedef typename TInputImage::SizeType SizeType;
91  typedef typename TInputImage::PixelType PixelType;
92  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
93 
95  itkStaticConstMacro(ImageDimension, unsigned int,
96  TInputImage::ImageDimension);
97 
102 
105 
107  typedef TKernel KernelType;
108 
110  typedef typename KernelType::ConstIterator KernelIteratorType;
111 
114 
121  {
122  m_BoundaryCondition = i;
123  }
124 
127  {
128  m_BoundaryCondition = &m_DefaultBoundaryCondition;
129  }
130 
132  itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
133 
134 protected:
136  ~MorphologyImageFilter() ITK_OVERRIDE {}
137  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
138 
140  void ThreadedGenerateData(const OutputImageRegionType &
141  outputRegionForThread,
142  ThreadIdType threadId) ITK_OVERRIDE;
143 
146  virtual PixelType Evaluate(const NeighborhoodIteratorType & nit,
147  const KernelIteratorType kernelBegin,
148  const KernelIteratorType kernelEnd) = 0;
149 
150 private:
151  ITK_DISALLOW_COPY_AND_ASSIGN(MorphologyImageFilter);
152 
156 
159 }; // end of class
160 } // end namespace itk
161 
162 #ifndef ITK_MANUAL_INSTANTIATION
163 #include "itkMorphologyImageFilter.hxx"
164 #endif
165 
166 #endif
TInputImage::IndexType IndexType
SmartPointer< const Self > ConstPointer
ConstantBoundaryCondition< InputImageType > DefaultBoundaryConditionType
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
ImageBoundaryConditionPointerType m_BoundaryCondition
ImageBoundaryCondition< InputImageType > * ImageBoundaryConditionPointerType
DefaultBoundaryConditionType m_DefaultBoundaryCondition
Superclass::OutputImageRegionType OutputImageRegionType
KernelType::ConstIterator KernelIteratorType
Base class for the morphological operations such as erosion and dialation.
ConstNeighborhoodIterator< TInputImage > NeighborhoodIteratorType
TInputImage::RegionType RegionType
A base class for all the filters working on an arbitrary shaped neighborhood.
ImageBoundaryCondition< InputImageType > const * ImageBoundaryConditionConstPointerType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
KernelImageFilter< TInputImage, TOutputImage, TKernel > Superclass
TInputImage::PixelType PixelType
Control indentation during Print() invocation.
Definition: itkIndent.h:49