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

itkInPlaceLabelMapFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkInPlaceLabelMapFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-10 14:15:40 $
00007   Version:   $Revision: 1.4 $
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 __itkInPlaceLabelMapFilter_h
00021 #define __itkInPlaceLabelMapFilter_h
00022 
00023 #include "itkLabelMapFilter.h"
00024 
00025 namespace itk
00026 {
00027 
00066 template <class TInputImage>
00067 class ITK_EXPORT InPlaceLabelMapFilter : public LabelMapFilter<TInputImage, TInputImage>
00068 {
00069 public:
00071   typedef InPlaceLabelMapFilter                     Self;
00072   typedef LabelMapFilter<TInputImage, TInputImage>  Superclass;
00073   typedef SmartPointer<Self>                        Pointer;
00074   typedef SmartPointer<const Self>                  ConstPointer;
00075 
00076   
00078   itkTypeMacro(InPlaceLabelMapFilter, LabelMapFilter);
00079 
00081   itkNewMacro(Self);
00082 
00084   typedef typename Superclass::OutputImageType       OutputImageType;
00085   typedef typename Superclass::OutputImagePointer    OutputImagePointer;
00086   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00087   typedef typename Superclass::OutputImagePixelType  OutputImagePixelType;
00088 
00090   typedef TInputImage                              InputImageType;
00091   typedef typename InputImageType::Pointer         InputImagePointer;
00092   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00093   typedef typename InputImageType::RegionType      InputImageRegionType; 
00094   typedef typename InputImageType::PixelType       InputImagePixelType;
00095   typedef typename InputImageType::LabelObjectType LabelObjectType;
00096 
00097   typedef typename InputImageType::PixelType       PixelType;
00098   typedef typename InputImageType::IndexType       IndexType;
00099   typedef typename InputImageType::RegionType      RegionType;
00100 
00101   typedef TInputImage TOutputImage;
00102   
00104   itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
00105   itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
00107 
00110   itkSetMacro(InPlace, bool);
00111   itkGetMacro(InPlace, bool);
00112   itkBooleanMacro(InPlace);
00114 
00121   bool CanRunInPlace() const
00122     {
00123     return (typeid(TInputImage) == typeid(TOutputImage));
00124     };
00126 
00127 protected:
00128   InPlaceLabelMapFilter();
00129   ~InPlaceLabelMapFilter();
00130 
00131   virtual void PrintSelf(std::ostream& os, Indent indent) const;
00132 
00145   virtual void AllocateOutputs();
00146 
00156   virtual void ReleaseInputs(); 
00157 
00158 
00163   virtual InputImageType * GetLabelMap()
00164     {
00165     return this->GetOutput();
00166     }
00167 
00168   typedef typename Superclass::LabelObjectContainerType          LabelObjectContainerType;
00169   typedef typename Superclass::LabelObjectContainerConstIterator LabelObjectContainerConstIterator;
00170 
00171 private:
00172   InPlaceLabelMapFilter(const Self&); //purposely not implemented
00173   void operator=(const Self&); //purposely not implemented
00174 
00175   bool m_InPlace;
00176 
00177 };
00178 
00179 } // end namespace itk
00180 
00181 #ifndef ITK_MANUAL_INSTANTIATION
00182 #include "itkInPlaceLabelMapFilter.txx"
00183 #endif
00184 
00185 #endif
00186 

Generated at Fri Apr 16 18:46:05 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000