00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSignedDanielssonDistanceMapImageFilter_h
00018 #define __itkSignedDanielssonDistanceMapImageFilter_h
00019
00020 #include <itkImageToImageFilter.h>
00021 #include <itkDanielssonDistanceMapImageFilter.h>
00022 #include "itkSubtractImageFilter.h"
00023
00024
00025
00026 namespace itk
00027 {
00028 template <class InputPixelType> class InvertIntensityFunctor
00029 {
00030 public:
00031 InputPixelType operator()( InputPixelType input )
00032 {
00033 if (input)
00034 {
00035 return NumericTraits<InputPixelType>::Zero;
00036 }
00037 else
00038 {
00039 return NumericTraits<InputPixelType>::One;
00040 }
00041 }
00042 };
00043 }
00044
00045
00046 namespace itk
00047 {
00048
00085 template <class TInputImage,class TOutputImage>
00086 class ITK_EXPORT SignedDanielssonDistanceMapImageFilter :
00087 public ImageToImageFilter<TInputImage,TOutputImage>
00088 {
00089 public:
00091 typedef SignedDanielssonDistanceMapImageFilter Self;
00092 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00093 typedef SmartPointer<Self> Pointer;
00094 typedef SmartPointer<const Self> ConstPointer;
00095
00097 itkNewMacro(Self);
00098
00100 itkTypeMacro( SignedDanielssonDistanceMapImageFilter, ImageToImageFilter );
00101
00103 typedef TInputImage InputImageType;
00104
00107 typedef TOutputImage OutputImageType;
00108
00110 typedef typename InputImageType::RegionType RegionType;
00111
00113 typedef typename RegionType::IndexType IndexType;
00114
00116 typedef typename InputImageType::OffsetType OffsetType;
00117
00119 typedef typename InputImageType::PixelType PixelType;
00120
00122 typedef typename RegionType::SizeType SizeType;
00123
00125 itkStaticConstMacro(InputImageDimension, unsigned int,
00126 InputImageType::ImageDimension);
00127
00129 typedef Image< OffsetType,
00130 itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00131
00133 typedef typename InputImageType::ConstPointer InputImagePointer;
00134
00136 typedef typename OutputImageType::Pointer OutputImagePointer;
00137
00139 typedef typename VectorImageType::Pointer VectorImagePointer;
00140
00142 itkSetMacro( SquaredDistance, bool );
00143
00145 itkGetConstReferenceMacro( SquaredDistance, bool );
00146
00148 itkBooleanMacro( SquaredDistance );
00149
00151 itkSetMacro( UseImageSpacing, bool );
00152
00154 itkGetConstReferenceMacro( UseImageSpacing, bool );
00155
00157 itkBooleanMacro( UseImageSpacing );
00158
00161 itkSetMacro( InsideIsPositive, bool );
00162
00165 itkGetConstReferenceMacro( InsideIsPositive, bool );
00166
00170 itkBooleanMacro( InsideIsPositive );
00171
00177 OutputImageType * GetVoronoiMap(void);
00178
00187 OutputImageType * GetDistanceMap(void);
00188
00190 VectorImageType * GetVectorDistanceMap(void);
00191
00192 protected:
00193 SignedDanielssonDistanceMapImageFilter();
00194 virtual ~SignedDanielssonDistanceMapImageFilter() {};
00195 void PrintSelf(std::ostream& os, Indent indent) const;
00196
00198 void GenerateData();
00199
00200 private:
00201 SignedDanielssonDistanceMapImageFilter(const Self&);
00202 void operator=(const Self&);
00203
00204 bool m_SquaredDistance;
00205 bool m_UseImageSpacing;
00206 bool m_InsideIsPositive;
00207 };
00208
00209 }
00210
00211
00212 #ifndef ITK_MANUAL_INSTANTIATION
00213 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00214 #endif
00215
00216 #endif