Orfeo Toolbox  3.16
itkInPlaceLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkInPlaceLabelMapFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-07-10 14:15:40 $
7  Version: $Revision: 1.4 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  Portions of this code are covered under the VTK copyright.
13  See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
14 
15  This software is distributed WITHOUT ANY WARRANTY; without even
16  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
17  PURPOSE. See the above copyright notices for more information.
18 
19 =========================================================================*/
20 #ifndef __itkInPlaceLabelMapFilter_h
21 #define __itkInPlaceLabelMapFilter_h
22 
23 #include "itkLabelMapFilter.h"
24 
25 namespace itk
26 {
27 
66 template <class TInputImage>
67 class ITK_EXPORT InPlaceLabelMapFilter : public LabelMapFilter<TInputImage, TInputImage>
68 {
69 public:
75 
76 
79 
81  itkNewMacro(Self);
82 
84  typedef typename Superclass::OutputImageType OutputImageType;
85  typedef typename Superclass::OutputImagePointer OutputImagePointer;
86  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
87  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
88 
90  typedef TInputImage InputImageType;
91  typedef typename InputImageType::Pointer InputImagePointer;
92  typedef typename InputImageType::ConstPointer InputImageConstPointer;
93  typedef typename InputImageType::RegionType InputImageRegionType;
94  typedef typename InputImageType::PixelType InputImagePixelType;
95  typedef typename InputImageType::LabelObjectType LabelObjectType;
96 
97  typedef typename InputImageType::PixelType PixelType;
98  typedef typename InputImageType::IndexType IndexType;
99  typedef typename InputImageType::RegionType RegionType;
100 
101  typedef TInputImage TOutputImage;
102 
104  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
105  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
106 
109  itkSetMacro(InPlace, bool);
110  itkGetMacro(InPlace, bool);
111  itkBooleanMacro(InPlace);
112 
119  bool CanRunInPlace() const
120  {
121  return (typeid(TInputImage) == typeid(TOutputImage));
122  };
123 
124 protected:
127 
128  virtual void PrintSelf(std::ostream& os, Indent indent) const;
129 
142  virtual void AllocateOutputs();
143 
153  virtual void ReleaseInputs();
154 
155 
160  virtual InputImageType * GetLabelMap()
161  {
162  return this->GetOutput();
163  }
164 
165  typedef typename Superclass::LabelObjectContainerType LabelObjectContainerType;
166  typedef typename Superclass::LabelObjectContainerConstIterator LabelObjectContainerConstIterator;
167 
168 private:
169  InPlaceLabelMapFilter(const Self&); //purposely not implemented
170  void operator=(const Self&); //purposely not implemented
171 
172  bool m_InPlace;
173 
174 };
175 
176 } // end namespace itk
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
180 #endif
181 
182 #endif

Generated at Sat Feb 2 2013 23:46:02 for Orfeo Toolbox with doxygen 1.8.1.1