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 itkTypeMacro(SignedMaurerDistanceMapImageFilter,
00094 ImageToImageFilter);
00095
00097 typedef typename InputImageType::PixelType InputPixelType;
00098 typedef typename OutputImageType::PixelType OutputPixelType;
00099
00100 typedef typename InputImageType::SizeType InputSizeType;
00101 typedef typename OutputImageType::SizeType OutputSizeType;
00102
00103 typedef typename InputImageType::IndexType InputIndexType;
00104 typedef typename OutputImageType::IndexType OutputIndexType;
00105
00106 typedef typename InputImageType::SpacingType InputSpacingType;
00107 typedef typename OutputImageType::SpacingType OutputSpacingType;
00108
00110 itkSetMacro(SquaredDistance, bool);
00111
00113 itkGetConstReferenceMacro(SquaredDistance, bool);
00114
00116 itkBooleanMacro(SquaredDistance);
00117
00120 itkSetMacro(InsideIsPositive, bool);
00121
00124 itkGetConstReferenceMacro(InsideIsPositive, bool);
00125
00129 itkBooleanMacro(InsideIsPositive);
00130
00132 itkSetMacro(UseImageSpacing, bool);
00133
00135 itkGetConstReferenceMacro(UseImageSpacing, bool);
00136
00138 itkBooleanMacro(UseImageSpacing);
00139
00144 itkSetMacro(BackgroundValue, InputPixelType);
00145 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00147
00148 protected:
00149
00150 SignedMaurerDistanceMapImageFilter();
00151
00152 virtual ~SignedMaurerDistanceMapImageFilter();
00153
00154 void PrintSelf(std::ostream& os, Indent indent) const;
00155
00156 void GenerateData();
00157
00158
00159 private:
00160
00161 SignedMaurerDistanceMapImageFilter(const Self&);
00162 void operator=(const Self&);
00163
00164 void Voronoi( unsigned int, OutputIndexType );
00165 bool Remove( OutputPixelType, OutputPixelType, OutputPixelType,
00166 OutputPixelType, OutputPixelType, OutputPixelType );
00167
00168 InputPixelType m_BackgroundValue;
00169 InputSpacingType m_Spacing;
00170
00171 bool m_InsideIsPositive;
00172 bool m_UseImageSpacing;
00173 bool m_SquaredDistance;
00174
00175 };
00176
00177 }
00178
00179 #ifndef ITK_MANUAL_INSTANTIATION
00180 #include "itkSignedMaurerDistanceMapImageFilter.txx"
00181 #endif
00182
00183 #endif
00184