00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDanielssonDistanceMapImageFilter_h
00018 #define __itkDanielssonDistanceMapImageFilter_h
00019
00020 #include <itkImageToImageFilter.h>
00021 #include <itkImageRegionIteratorWithIndex.h>
00022
00023 namespace itk
00024 {
00025
00055 template <class TInputImage,class TOutputImage>
00056 class ITK_EXPORT DanielssonDistanceMapImageFilter :
00057 public ImageToImageFilter<TInputImage,TOutputImage>
00058 {
00059 public:
00061 typedef DanielssonDistanceMapImageFilter Self;
00062 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00063 typedef SmartPointer<Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00067 itkNewMacro(Self);
00068
00070 itkTypeMacro( DanielssonDistanceMapImageFilter, ImageToImageFilter );
00071
00073 typedef TInputImage InputImageType;
00074
00077 typedef TOutputImage OutputImageType;
00078
00080 typedef typename InputImageType::RegionType RegionType;
00081
00083 typedef typename RegionType::IndexType IndexType;
00084
00086 typedef typename InputImageType::OffsetType OffsetType;
00087
00089 typedef typename RegionType::SizeType SizeType;
00090
00092 itkStaticConstMacro(InputImageDimension, unsigned int,
00093 InputImageType::ImageDimension);
00094
00096 typedef Image< OffsetType, itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00097
00099 typedef typename InputImageType::ConstPointer InputImagePointer;
00100
00102 typedef typename OutputImageType::Pointer OutputImagePointer;
00103
00105 typedef typename VectorImageType::Pointer VectorImagePointer;
00106
00108 itkSetMacro( SquaredDistance, bool );
00109
00111 itkGetConstReferenceMacro( SquaredDistance, bool );
00112
00114 itkBooleanMacro( SquaredDistance );
00115
00117 itkSetMacro( InputIsBinary, bool );
00118
00120 itkGetConstReferenceMacro( InputIsBinary, bool );
00121
00123 itkBooleanMacro( InputIsBinary );
00124
00130 OutputImageType * GetVoronoiMap(void);
00131
00140 OutputImageType * GetDistanceMap(void);
00141
00143 VectorImageType * GetVectorDistanceMap(void);
00144
00145 protected:
00146 DanielssonDistanceMapImageFilter();
00147 virtual ~DanielssonDistanceMapImageFilter() {};
00148 void PrintSelf(std::ostream& os, Indent indent) const;
00149
00151 void GenerateData();
00152
00154 void PrepareData();
00155
00157 void ComputeVoronoiMap();
00158
00160 void UpdateLocalDistance(VectorImageType*,
00161 const IndexType&,
00162 const OffsetType&);
00163
00164 private:
00165 DanielssonDistanceMapImageFilter(const Self&);
00166 void operator=(const Self&);
00167
00168 bool m_SquaredDistance;
00169 bool m_InputIsBinary;
00170
00174 template <unsigned int VDimension>
00175 class SquaredDistance
00176 {
00177 };
00178
00179 };
00180
00181 }
00182
00183
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "itkDanielssonDistanceMapImageFilter.txx"
00186 #endif
00187
00188 #endif