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
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&);
00107 void operator=(const Self&);
00108
00109 OutputImagePixelType m_BackgroundValue;
00110
00111 typename std::vector< OutputImagePointer > m_TemporaryImages;
00112
00113 };
00114
00115 }
00116
00117 #ifndef ITK_MANUAL_INSTANTIATION
00118 #include "itkLabelImageToLabelMapFilter.txx"
00119 #endif
00120
00121 #endif
00122