Orfeo Toolbox  3.16
itkInPlaceImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkInPlaceImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-05-04 14:42:59 $
7  Version: $Revision: 1.8 $
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 __itkInPlaceImageFilter_h
21 #define __itkInPlaceImageFilter_h
22 
23 #include "itkImageToImageFilter.h"
24 
25 namespace itk
26 {
27 
61 template <class TInputImage, class TOutputImage=TInputImage>
62 class ITK_EXPORT InPlaceImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
63 {
64 public:
70 
71 
74 
76  typedef typename Superclass::OutputImageType OutputImageType;
77  typedef typename Superclass::OutputImagePointer OutputImagePointer;
78  typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
79  typedef typename Superclass::OutputImagePixelType OutputImagePixelType;
80 
82  typedef TInputImage InputImageType;
83  typedef typename InputImageType::Pointer InputImagePointer;
84  typedef typename InputImageType::ConstPointer InputImageConstPointer;
85  typedef typename InputImageType::RegionType InputImageRegionType;
86  typedef typename InputImageType::PixelType InputImagePixelType;
87 
89  itkStaticConstMacro(InputImageDimension, unsigned int,
90  TInputImage::ImageDimension);
91  itkStaticConstMacro(OutputImageDimension, unsigned int,
92  TOutputImage::ImageDimension);
93 
99  itkSetMacro(InPlace, bool);
100  itkGetConstMacro(InPlace, bool);
101  itkBooleanMacro(InPlace);
102 
111  virtual bool CanRunInPlace() const
112  {
113  return (typeid(TInputImage) == typeid(TOutputImage));
114  }
115 
116 protected:
119 
120  virtual void PrintSelf(std::ostream& os, Indent indent) const;
121 
134  virtual void AllocateOutputs();
135 
145  virtual void ReleaseInputs();
146 
147 private:
148  InPlaceImageFilter(const Self&); //purposely not implemented
149  void operator=(const Self&); //purposely not implemented
150 
151  bool m_InPlace;
152 
153 };
154 
155 } // end namespace itk
156 
157 // Define instantiation macro for this template.
158 #define ITK_TEMPLATE_InPlaceImageFilter(_, EXPORT, x, y) namespace itk { \
159  _(2(class EXPORT InPlaceImageFilter< ITK_TEMPLATE_2 x >)) \
160  namespace Templates { typedef InPlaceImageFilter< ITK_TEMPLATE_2 x > InPlaceImageFilter##y; } \
161  }
162 
163 #if ITK_TEMPLATE_EXPLICIT
164 # include "Templates/itkInPlaceImageFilter+-.h"
165 #endif
166 
167 #if ITK_TEMPLATE_TXX
168 # include "itkInPlaceImageFilter.txx"
169 #endif
170 
171 #endif

Generated at Sat May 18 2013 23:46:48 for Orfeo Toolbox with doxygen 1.8.3.1