00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSignedMaurerDistanceMapImageFilter_h
00018 #define __itkSignedMaurerDistanceMapImageFilter_h
00019
00020 #include "itkImage.h"
00021 #include "itkImageToImageFilter.h"
00022
00059 namespace itk
00060 {
00061
00062 template <class TInputImage, class TOutputImage>
00063 class SignedMaurerDistanceMapImageFilter :
00064 public ImageToImageFilter< TInputImage, TOutputImage >
00065 {
00066 public:
00067
00069 itkStaticConstMacro(InputImageDimension, unsigned int,
00070 TInputImage::ImageDimension);
00071 itkStaticConstMacro(OutputImageDimension, unsigned int,
00072 TOutputImage::ImageDimension);
00074
00075
00077 typedef TInputImage InputImageType;
00078 typedef TOutputImage OutputImageType;
00079
00081 typedef SignedMaurerDistanceMapImageFilter Self;
00082 typedef ImageToImageFilter<
00083 InputImageType,
00084 OutputImageType> Superclass;
00085
00086 typedef SmartPointer<Self> Pointer;
00087 typedef SmartPointer<const Self> ConstPointer;
00088
00090 itkNewMacro(Self);
00091
00093 typedef typename InputImageType::PixelType InputPixelType;
00094 typedef typename OutputImageType::PixelType OutputPixelType;
00095
00096 typedef typename InputImageType::SizeType InputSizeType;
00097 typedef typename OutputImageType::SizeType OutputSizeType;
00098
00099 typedef typename InputImageType::IndexType InputIndexType;
00100 typedef typename OutputImageType::IndexType OutputIndexType;
00101
00102 typedef typename InputImageType::SpacingType InputSpacingType;
00103 typedef typename OutputImageType::SpacingType OutputSpacingType;
00104
00106 itkSetMacro(SquaredDistance, bool);
00107
00109 itkGetConstReferenceMacro(SquaredDistance, bool);
00110
00112 itkBooleanMacro(SquaredDistance);
00113
00116 itkSetMacro(InsideIsPositive, bool);
00117
00120 itkGetConstReferenceMacro(InsideIsPositive, bool);
00121
00125 itkBooleanMacro(InsideIsPositive);
00126
00128 itkSetMacro(UseImageSpacing, bool);
00129
00131 itkGetConstReferenceMacro(UseImageSpacing, bool);
00132
00134 itkBooleanMacro(UseImageSpacing);
00135
00140 itkSetMacro(BackgroundValue, InputPixelType);
00141 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00143
00144 protected:
00145
00146 SignedMaurerDistanceMapImageFilter();
00147
00148 virtual ~SignedMaurerDistanceMapImageFilter();
00149
00150 void PrintSelf(std::ostream& os, Indent indent) const;
00151
00152 void GenerateData();
00153
00154
00155 private:
00156
00157 SignedMaurerDistanceMapImageFilter(const Self&);
00158 void operator=(const Self&);
00159
00160 void Voronoi( unsigned int, OutputIndexType );
00161 bool Remove( OutputPixelType, OutputPixelType, OutputPixelType,
00162 OutputPixelType, OutputPixelType, OutputPixelType );
00163
00164 InputPixelType m_BackgroundValue;
00165 InputSpacingType m_Spacing;
00166
00167 bool m_InsideIsPositive;
00168 bool m_UseImageSpacing;
00169 bool m_SquaredDistance;
00170
00171 };
00172
00173 }
00174
00175 #ifndef ITK_MANUAL_INSTANTIATION
00176 #include "itkSignedMaurerDistanceMapImageFilter.txx"
00177 #endif
00178
00179 #endif
00180