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
00076 typedef TOutputImage OutputImageType;
00077
00079 typedef typename InputImageType::RegionType RegionType;
00080
00082 typedef typename RegionType::IndexType IndexType;
00083
00085 typedef typename InputImageType::OffsetType OffsetType;
00086
00088 typedef typename RegionType::SizeType SizeType;
00089
00091 itkStaticConstMacro(InputImageDimension, unsigned int,
00092 InputImageType::ImageDimension);
00093
00095 typedef Image< OffsetType, itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00096
00098 typedef typename InputImageType::ConstPointer InputImagePointer;
00099
00101 typedef typename OutputImageType::Pointer OutputImagePointer;
00102
00104 typedef typename VectorImageType::Pointer VectorImagePointer;
00105
00107 itkSetMacro( SquaredDistance, bool );
00108
00110 itkGetConstReferenceMacro( SquaredDistance, bool );
00111
00113 itkBooleanMacro( SquaredDistance );
00114
00116 itkSetMacro( InputIsBinary, bool );
00117
00119 itkGetConstReferenceMacro( InputIsBinary, bool );
00120
00122 itkBooleanMacro( InputIsBinary );
00123
00129 OutputImageType * GetVoronoiMap(void);
00130
00139 OutputImageType * GetDistanceMap(void);
00140
00142 VectorImageType * GetVectorDistanceMap(void);
00143
00144 protected:
00145 DanielssonDistanceMapImageFilter();
00146 virtual ~DanielssonDistanceMapImageFilter() {};
00147 void PrintSelf(std::ostream& os, Indent indent) const;
00148
00150 void GenerateData();
00151
00153 void PrepareData();
00154
00156 void ComputeVoronoiMap();
00157
00159 void UpdateLocalDistance(VectorImageType*,
00160 const IndexType&,
00161 const OffsetType&);
00162
00163 private:
00164 DanielssonDistanceMapImageFilter(const Self&);
00165 void operator=(const Self&);
00166
00167 bool m_SquaredDistance;
00168 bool m_InputIsBinary;
00169
00173 template <unsigned int VDimension>
00174 class SquaredDistance
00175 {
00176 };
00177
00178 };
00179
00180 }
00181
00182
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkDanielssonDistanceMapImageFilter.txx"
00185 #endif
00186
00187 #endif