ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkObjectMorphologyImageFilter.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 itkObjectMorphologyImageFilter_h
19 #define itkObjectMorphologyImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkConstSliceIterator.h"
25 #include "itkImageRegionIterator.h"
26 
27 namespace itk
28 {
72 template< typename TInputImage, typename TOutputImage, typename TKernel >
74  public ImageToImageFilter< TInputImage, TOutputImage >
75 {
76 public:
82 
85 
87  typedef TInputImage InputImageType;
88  typedef TOutputImage OutputImageType;
89  typedef typename TInputImage::RegionType RegionType;
90  typedef typename TInputImage::SizeType SizeType;
91  typedef typename TInputImage::IndexType IndexType;
92  typedef typename TInputImage::PixelType PixelType;
93 
95 
102 
104  itkStaticConstMacro(ImageDimension, unsigned int,
105  TInputImage::ImageDimension);
106  itkStaticConstMacro(OutputImageDimension, unsigned int,
107  TOutputImage::ImageDimension);
108  itkStaticConstMacro(KernelDimension, unsigned int,
109  TKernel::NeighborhoodDimension);
111 
117 
119  typedef TKernel KernelType;
120 
122  typedef typename KernelType::ConstIterator KernelIteratorType;
123 
125  typedef typename KernelType::SizeType RadiusType;
126 
128  itkSetMacro(Kernel, KernelType);
129 
131  itkGetConstReferenceMacro(Kernel, KernelType);
132 
134  itkGetConstMacro(ObjectValue, PixelType);
135 
137  itkSetMacro(ObjectValue, PixelType);
138 
144  void GenerateInputRequestedRegion() ITK_OVERRIDE;
145 
153  { m_BoundaryCondition = i; }
154 
158 
160  itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
161 
166  itkSetMacro(UseBoundaryCondition, bool);
167 
172  itkGetConstMacro(UseBoundaryCondition, bool);
173 
174 #ifdef ITK_USE_CONCEPT_CHECKING
175  // Begin concept checking
176  itkConceptMacro( SameDimensionCheck1,
178  itkConceptMacro( SameDimensionCheck2,
180  itkConceptMacro( OutputInputEqualityComparableCheck,
181  ( Concept::EqualityComparable< typename TOutputImage::PixelType,
182  PixelType > ) );
183  itkConceptMacro( InputConvertibleToOutputCheck,
185  itkConceptMacro( IntConvertibleToOutputCheck,
187  itkConceptMacro( InputEqualityComparable,
189  itkConceptMacro( InputOStreamWritableCheck,
191  // End concept checking
192 #endif
193 
194 protected:
197  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
198 
201  outputRegionForThread,
202  ThreadIdType threadId) ITK_OVERRIDE;
203 
206  virtual void Evaluate(OutputNeighborhoodIteratorType & nit,
207  const KernelType & kernel) = 0;
208 
213 
217 
220 
223 
226 
229 
230  void BeforeThreadedGenerateData() ITK_OVERRIDE;
231 
232 private:
233  ObjectMorphologyImageFilter(const Self &) ITK_DELETE_FUNCTION;
234  void operator=(const Self &) ITK_DELETE_FUNCTION;
235 }; // end of class
236 } // end namespace itk
237 
238 #ifndef ITK_MANUAL_INSTANTIATION
239 #include "itkObjectMorphologyImageFilter.hxx"
240 #endif
241 
242 #endif
void PrintSelf(std::ostream &os, Indent indent) const override
Superclass::OutputImageRegionType OutputImageRegionType
ConstantBoundaryCondition< InputImageType > DefaultBoundaryConditionType
ImageBoundaryCondition< InputImageType > const * ImageBoundaryConditionConstPointerType
DefaultBoundaryConditionType m_DefaultBoundaryCondition
void GenerateInputRequestedRegion() override
NeighborhoodIterator< TOutputImage > OutputNeighborhoodIteratorType
void BeforeThreadedGenerateData() override
Base class for all process objects that output image data.
ImageToImageFilter< TInputImage, TOutputImage > Superclass
virtual void Evaluate(OutputNeighborhoodIteratorType &nit, const KernelType &kernel)=0
void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
ImageBoundaryCondition< InputImageType > * ImageBoundaryConditionPointerType
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
ConstNeighborhoodIterator< TInputImage > InputNeighborhoodIteratorType
bool IsObjectPixelOnBoundary(const InputNeighborhoodIteratorType &nit)
ImageBoundaryConditionPointerType m_BoundaryCondition
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Superclass::OutputImageRegionType OutputImageRegionType
#define itkConceptMacro(name, concept)
Base class for the morphological operations being applied to isolated objects in an image...
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.