Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00041 template<class TInputImage, class TOutputImage=LabelMap< LabelObject< typename TInputImage::PixelType, ::itk::GetImageDimension<TInputImage>::ImageDimension > > >
00042 class ITK_EXPORT LabelImageToLabelMapFilter :
00043 public ImageToImageFilter<TInputImage, TOutputImage>
00044 {
00045 public:
00047 typedef LabelImageToLabelMapFilter Self;
00048 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 typedef TInputImage InputImageType;
00054 typedef TOutputImage OutputImageType;
00055 typedef typename InputImageType::Pointer InputImagePointer;
00056 typedef typename InputImageType::ConstPointer InputImageConstPointer;
00057 typedef typename InputImageType::RegionType InputImageRegionType;
00058 typedef typename InputImageType::PixelType InputImagePixelType;
00059 typedef typename InputImageType::IndexType IndexType;
00060
00061 typedef typename OutputImageType::Pointer OutputImagePointer;
00062 typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
00063 typedef typename OutputImageType::RegionType OutputImageRegionType;
00064 typedef typename OutputImageType::PixelType OutputImagePixelType;
00065 typedef typename OutputImageType::LabelObjectType LabelObjectType;
00066
00068 itkStaticConstMacro(InputImageDimension, unsigned int,
00069 TInputImage::ImageDimension);
00070 itkStaticConstMacro(OutputImageDimension, unsigned int,
00071 TOutputImage::ImageDimension);
00073
00075 itkNewMacro(Self);
00076
00078 itkTypeMacro(LabelImageToLabelMapFilter,
00079 ImageToImageFilter);
00080
00085 itkSetMacro(BackgroundValue, OutputImagePixelType);
00086 itkGetConstMacro(BackgroundValue, OutputImagePixelType);
00088
00089 protected:
00090 LabelImageToLabelMapFilter();
00091 ~LabelImageToLabelMapFilter() {};
00092 void PrintSelf(std::ostream& os, Indent indent) const;
00093
00097 void GenerateInputRequestedRegion();
00098
00100 void EnlargeOutputRequestedRegion(DataObject *itkNotUsed(output));
00101
00102 virtual void BeforeThreadedGenerateData();
00103
00104 virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId );
00105
00106 virtual void AfterThreadedGenerateData();
00107
00108
00109 private:
00110 LabelImageToLabelMapFilter(const Self&);
00111 void operator=(const Self&);
00112
00113 OutputImagePixelType m_BackgroundValue;
00114
00115 typename std::vector< OutputImagePointer > m_TemporaryImages;
00116
00117 };
00118
00119 }
00120
00121 #ifndef ITK_MANUAL_INSTANTIATION
00122 #include "itkLabelImageToLabelMapFilter.txx"
00123 #endif
00124
00125 #endif
00126