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 namespace Functor
00029 {
00030 template <class InputPixelType> class InvertIntensityFunctor
00031 {
00032 public:
00033 InputPixelType operator()( InputPixelType input )
00034 {
00035 if (input)
00036 {
00037 return NumericTraits<InputPixelType>::Zero;
00038 }
00039 else
00040 {
00041 return NumericTraits<InputPixelType>::One;
00042 }
00043 }
00044 };
00045 }
00046 }
00047
00048
00049 namespace itk
00050 {
00051
00088 template <class TInputImage,class TOutputImage>
00089 class ITK_EXPORT SignedDanielssonDistanceMapImageFilter :
00090 public ImageToImageFilter<TInputImage,TOutputImage>
00091 {
00092 public:
00094 typedef SignedDanielssonDistanceMapImageFilter Self;
00095 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00096 typedef SmartPointer<Self> Pointer;
00097 typedef SmartPointer<const Self> ConstPointer;
00098
00100 itkNewMacro(Self);
00101
00103 itkTypeMacro( SignedDanielssonDistanceMapImageFilter, ImageToImageFilter );
00104
00106 typedef TInputImage InputImageType;
00107
00110 typedef TOutputImage OutputImageType;
00111
00113 typedef typename InputImageType::RegionType RegionType;
00114
00116 typedef typename RegionType::IndexType IndexType;
00117
00119 typedef typename InputImageType::OffsetType OffsetType;
00120
00122 typedef typename InputImageType::PixelType PixelType;
00123
00125 typedef typename RegionType::SizeType SizeType;
00126
00128 itkStaticConstMacro(InputImageDimension, unsigned int,
00129 InputImageType::ImageDimension);
00130
00132 typedef Image< OffsetType,
00133 itkGetStaticConstMacro(InputImageDimension)> VectorImageType;
00134
00136 typedef typename InputImageType::ConstPointer InputImagePointer;
00137
00139 typedef typename OutputImageType::Pointer OutputImagePointer;
00140
00142 typedef typename VectorImageType::Pointer VectorImagePointer;
00143
00145 itkSetMacro( SquaredDistance, bool );
00146
00148 itkGetConstReferenceMacro( SquaredDistance, bool );
00149
00151 itkBooleanMacro( SquaredDistance );
00152
00154 itkSetMacro( UseImageSpacing, bool );
00155
00157 itkGetConstReferenceMacro( UseImageSpacing, bool );
00158
00160 itkBooleanMacro( UseImageSpacing );
00161
00164 itkSetMacro( InsideIsPositive, bool );
00165
00168 itkGetConstReferenceMacro( InsideIsPositive, bool );
00169
00173 itkBooleanMacro( InsideIsPositive );
00174
00180 OutputImageType * GetVoronoiMap(void);
00181
00190 OutputImageType * GetDistanceMap(void);
00191
00193 VectorImageType * GetVectorDistanceMap(void);
00194
00195 protected:
00196 SignedDanielssonDistanceMapImageFilter();
00197 virtual ~SignedDanielssonDistanceMapImageFilter() {};
00198 void PrintSelf(std::ostream& os, Indent indent) const;
00199
00201 void GenerateData();
00202
00203 private:
00204 SignedDanielssonDistanceMapImageFilter(const Self&);
00205 void operator=(const Self&);
00206
00207 bool m_SquaredDistance;
00208 bool m_UseImageSpacing;
00209 bool m_InsideIsPositive;
00210 };
00211
00212 }
00213
00214
00215 #ifndef ITK_MANUAL_INSTANTIATION
00216 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00217 #endif
00218
00219 #endif