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
00058 template <class TInputImage,class TOutputImage>
00059 class ITK_EXPORT DanielssonDistanceMapImageFilter :
00060 public ImageToImageFilter<TInputImage,TOutputImage>
00061 {
00062 public:
00064 typedef DanielssonDistanceMapImageFilter Self;
00065 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00066 typedef SmartPointer<Self> Pointer;
00067 typedef SmartPointer<const Self> ConstPointer;
00068
00070 itkNewMacro(Self);
00071
00073 itkTypeMacro( DanielssonDistanceMapImageFilter, ImageToImageFilter );
00074
00076 typedef TInputImage InputImageType;
00077
00080 typedef TOutputImage OutputImageType;
00081
00083 typedef typename InputImageType::RegionType RegionType;
00084
00086 typedef typename RegionType::IndexType IndexType;
00087
00089 typedef typename InputImageType::OffsetType OffsetType;
00090
00092 typedef typename RegionType::SizeType SizeType;
00093
00095 itkStaticConstMacro(InputImageDimension, unsigned int,
00096 InputImageType::ImageDimension);
00097
00099 typedef Image< OffsetType,
00100 itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00101
00103 typedef typename InputImageType::ConstPointer InputImagePointer;
00104
00106 typedef typename OutputImageType::Pointer OutputImagePointer;
00107
00109 typedef typename VectorImageType::Pointer VectorImagePointer;
00110
00112 itkSetMacro( SquaredDistance, bool );
00113
00115 itkGetConstReferenceMacro( SquaredDistance, bool );
00116
00118 itkBooleanMacro( SquaredDistance );
00119
00125 itkSetMacro( InputIsBinary, bool );
00126
00128 itkGetConstReferenceMacro( InputIsBinary, bool );
00129
00131 itkBooleanMacro( InputIsBinary );
00132
00134 itkSetMacro( UseImageSpacing, bool );
00135
00137 itkGetConstReferenceMacro( UseImageSpacing, bool );
00138
00140 itkBooleanMacro( UseImageSpacing );
00141
00147 OutputImageType * GetVoronoiMap(void);
00148
00157 OutputImageType * GetDistanceMap(void);
00158
00160 VectorImageType * GetVectorDistanceMap(void);
00161
00162 protected:
00163 DanielssonDistanceMapImageFilter();
00164 virtual ~DanielssonDistanceMapImageFilter() {};
00165 void PrintSelf(std::ostream& os, Indent indent) const;
00166
00168 void GenerateData();
00169
00171 void PrepareData();
00172
00174 void ComputeVoronoiMap();
00175
00177 void UpdateLocalDistance(VectorImageType*,
00178 const IndexType&,
00179 const OffsetType&);
00180
00181 private:
00182 DanielssonDistanceMapImageFilter(const Self&);
00183 void operator=(const Self&);
00184
00185 bool m_SquaredDistance;
00186 bool m_InputIsBinary;
00187 bool m_UseImageSpacing;
00188
00189 };
00190
00191 }
00192
00193
00194 #ifndef ITK_MANUAL_INSTANTIATION
00195 #include "itkDanielssonDistanceMapImageFilter.txx"
00196 #endif
00197
00198 #endif