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 #ifdef ITK_USE_CONCEPT_CHECKING
00196
00197 itkConceptMacro(IntConvertibleToInputCheck,
00198 (Concept::Convertible<int, PixelType>));
00199 itkConceptMacro(InputHasNumericTraitsCheck,
00200 (Concept::HasNumericTraits<PixelType>));
00201
00203 #endif
00204
00205 protected:
00206 SignedDanielssonDistanceMapImageFilter();
00207 virtual ~SignedDanielssonDistanceMapImageFilter() {};
00208 void PrintSelf(std::ostream& os, Indent indent) const;
00209
00211 void GenerateData();
00212
00213 private:
00214 SignedDanielssonDistanceMapImageFilter(const Self&);
00215 void operator=(const Self&);
00216
00217 bool m_SquaredDistance;
00218 bool m_UseImageSpacing;
00219 bool m_InsideIsPositive;
00220 };
00221
00222 }
00223
00224
00225 #ifndef ITK_MANUAL_INSTANTIATION
00226 #include "itkSignedDanielssonDistanceMapImageFilter.txx"
00227 #endif
00228
00229 #endif
00230