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

itkLabelImageToLabelMapFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkLabelImageToLabelMapFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-05-14 21:08:43 $
00007   Version:   $Revision: 1.2 $
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      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkLabelImageToLabelMapFilter_h
00018 #define __itkLabelImageToLabelMapFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkLabelMap.h"
00022 #include "itkLabelObject.h"
00023 
00024 namespace itk {
00025 
00037 template<class TInputImage, class TOutputImage=LabelMap< LabelObject< typename TInputImage::PixelType, ::itk::GetImageDimension<TInputImage>::ImageDimension::ImageDimension > > >
00038 class ITK_EXPORT LabelImageToLabelMapFilter : 
00039     public ImageToImageFilter<TInputImage, TOutputImage>
00040 {
00041 public:
00043   typedef LabelImageToLabelMapFilter                    Self;
00044   typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00045   typedef SmartPointer<Self>                            Pointer;
00046   typedef SmartPointer<const Self>                      ConstPointer;
00047 
00049   typedef TInputImage                              InputImageType;
00050   typedef TOutputImage                             OutputImageType;
00051   typedef typename InputImageType::Pointer         InputImagePointer;
00052   typedef typename InputImageType::ConstPointer    InputImageConstPointer;
00053   typedef typename InputImageType::RegionType      InputImageRegionType;
00054   typedef typename InputImageType::PixelType       InputImagePixelType;
00055   typedef typename InputImageType::IndexType       IndexType;
00056 
00057   typedef typename OutputImageType::Pointer         OutputImagePointer;
00058   typedef typename OutputImageType::ConstPointer    OutputImageConstPointer;
00059   typedef typename OutputImageType::RegionType      OutputImageRegionType;
00060   typedef typename OutputImageType::PixelType       OutputImagePixelType;
00061   typedef typename OutputImageType::LabelObjectType LabelObjectType;
00062   
00064   itkStaticConstMacro(InputImageDimension, unsigned int,
00065                       TInputImage::ImageDimension);
00066   itkStaticConstMacro(OutputImageDimension, unsigned int,
00067                       TOutputImage::ImageDimension);
00069 
00071   itkNewMacro(Self);  
00072 
00074   itkTypeMacro(LabelImageToLabelMapFilter, 
00075                ImageToImageFilter);
00076 
00081   itkSetMacro(BackgroundValue, OutputImagePixelType);
00082   itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00084 
00085 protected:
00086   LabelImageToLabelMapFilter();
00087   ~LabelImageToLabelMapFilter() {};
00088   void PrintSelf(std::ostream& os, Indent indent) const;
00089 
00093   void GenerateInputRequestedRegion();
00094 
00096   void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00097 
00098   virtual void BeforeThreadedGenerateData();
00099 
00100   virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId );
00101 
00102   virtual void AfterThreadedGenerateData();
00103   
00104 
00105 private:
00106   LabelImageToLabelMapFilter(const Self&); //purposely not implemented
00107   void operator=(const Self&); //purposely not implemented
00108 
00109   OutputImagePixelType m_BackgroundValue;
00110   
00111   typename std::vector< OutputImagePointer > m_TemporaryImages;
00112 
00113 }; // end of class
00114 
00115 } // end namespace itk
00116   
00117 #ifndef ITK_MANUAL_INSTANTIATION
00118 #include "itkLabelImageToLabelMapFilter.txx"
00119 #endif
00120 
00121 #endif
00122 

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