Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkInPlaceImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkInPlaceImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-04 14:42:59 $
00007   Version:   $Revision: 1.8 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkInPlaceImageFilter_h
00021 #define __itkInPlaceImageFilter_h
00022 
00023 #include "itkImageToImageFilter.h"
00024 
00025 namespace itk
00026 {
00027   
00061 template <class TInputImage, class TOutputImage=TInputImage>
00062 class ITK_EXPORT InPlaceImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
00063 {
00064 public:
00066   typedef InPlaceImageFilter                             Self;
00067   typedef ImageToImageFilter<TInputImage, TOutputImage>  Superclass;
00068   typedef SmartPointer<Self>                             Pointer;
00069   typedef SmartPointer<const Self>                       ConstPointer;
00070 
00071   
00073   itkTypeMacro(InPlaceImageFilter,ImageToImageFilter);
00074 
00076   typedef typename Superclass::OutputImageType       OutputImageType;
00077   typedef typename Superclass::OutputImagePointer    OutputImagePointer;
00078   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00079   typedef typename Superclass::OutputImagePixelType  OutputImagePixelType;
00080 
00082   typedef TInputImage                             InputImageType;
00083   typedef typename InputImageType::Pointer        InputImagePointer;
00084   typedef typename InputImageType::ConstPointer   InputImageConstPointer;
00085   typedef typename InputImageType::RegionType     InputImageRegionType; 
00086   typedef typename InputImageType::PixelType      InputImagePixelType; 
00087 
00089   itkStaticConstMacro(InputImageDimension, unsigned int,
00090                       TInputImage::ImageDimension);
00091   itkStaticConstMacro(OutputImageDimension, unsigned int,
00092                       TOutputImage::ImageDimension);
00094 
00100   itkSetMacro(InPlace, bool);
00101   itkGetConstMacro(InPlace, bool);
00102   itkBooleanMacro(InPlace);
00104 
00113   virtual bool CanRunInPlace() const
00114     {
00115     return (typeid(TInputImage) == typeid(TOutputImage));
00116     }
00117 
00118 protected:
00119   InPlaceImageFilter();
00120   ~InPlaceImageFilter();
00121 
00122   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00123 
00136   virtual void AllocateOutputs();
00137 
00147   virtual void ReleaseInputs(); 
00148 
00149 private:
00150   InPlaceImageFilter(const Self&); //purposely not implemented
00151   void operator=(const Self&); //purposely not implemented
00152 
00153   bool m_InPlace;
00154 
00155 };
00156 
00157 } // end namespace itk
00158 
00159 // Define instantiation macro for this template.
00160 #define ITK_TEMPLATE_InPlaceImageFilter(_, EXPORT, x, y) namespace itk { \
00161   _(2(class EXPORT InPlaceImageFilter< ITK_TEMPLATE_2 x >)) \
00162   namespace Templates { typedef InPlaceImageFilter< ITK_TEMPLATE_2 x > InPlaceImageFilter##y; } \
00163   }
00164 
00165 #if ITK_TEMPLATE_EXPLICIT
00166 # include "Templates/itkInPlaceImageFilter+-.h"
00167 #endif
00168 
00169 #if ITK_TEMPLATE_TXX
00170 # include "itkInPlaceImageFilter.txx"
00171 #endif
00172 
00173 #endif
00174 

Generated at Thu May 28 10:30:34 2009 for ITK by doxygen 1.5.5 written by Dimitri van Heesch, © 1997-2000