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
00138
OutputImageType * GetVoronoiMap(
void);
00139
00148
OutputImageType * GetDistanceMap(
void);
00149
00151
VectorImageType * GetVectorDistanceMap(
void);
00152
00153
protected:
00154 DanielssonDistanceMapImageFilter();
00155 virtual ~DanielssonDistanceMapImageFilter() {};
00156
void PrintSelf(std::ostream& os,
Indent indent)
const;
00157
00159
void GenerateData();
00160
00162
void PrepareData();
00163
00165
void ComputeVoronoiMap();
00166
00168
void UpdateLocalDistance(VectorImageType*,
00169
const IndexType&,
00170
const OffsetType&);
00171
00172
private:
00173 DanielssonDistanceMapImageFilter(
const Self&);
00174
void operator=(
const Self&);
00175
00176
bool m_SquaredDistance;
00177
bool m_InputIsBinary;
00178
00179 };
00180
00181 }
00182
00183
00184
#ifndef ITK_MANUAL_INSTANTIATION
00185
#include "itkDanielssonDistanceMapImageFilter.txx"
00186
#endif
00187
00188
#endif