00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkZeroCrossingBasedEdgeDetectionImageFilter_h
00018 #define __itkZeroCrossingBasedEdgeDetectionImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022 #include "itkImage.h"
00023
00024
00025 namespace itk
00026 {
00027
00069 template<class TInputImage, class TOutputImage>
00070 class ITK_EXPORT ZeroCrossingBasedEdgeDetectionImageFilter
00071 : public ImageToImageFilter<TInputImage, TOutputImage>
00072 {
00073 public:
00075 typedef ZeroCrossingBasedEdgeDetectionImageFilter Self;
00076 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00077
00079 typedef TInputImage InputImageType;
00080 typedef TOutputImage OutputImageType;
00081
00083 typedef SmartPointer<Self> Pointer;
00084 typedef SmartPointer<const Self> ConstPointer;
00085
00087 typedef typename TInputImage::PixelType InputImagePixelType;
00088 typedef typename TOutputImage::PixelType OutputImagePixelType;
00089
00091 itkNewMacro(Self);
00092
00094 typedef typename TOutputImage::RegionType OutputImageRegionType;
00095
00097 itkTypeMacro(ZeroCrossingBasedEdgeDetectionImageFilter, ImageToImageFilter);
00098
00100 itkStaticConstMacro(ImageDimension, unsigned int,
00101 TInputImage::ImageDimension );
00102 itkStaticConstMacro(OutputImageDimension, unsigned int,
00103 TOutputImage::ImageDimension );
00105
00107 typedef FixedArray<double, itkGetStaticConstMacro(ImageDimension)> ArrayType;
00108
00110 itkSetMacro(Variance, ArrayType);
00111 itkGetMacro(Variance, const ArrayType);
00112 itkSetMacro(MaximumError, ArrayType);
00113 itkGetMacro(MaximumError, const ArrayType);
00115
00117 itkGetMacro(BackgroundValue, OutputImagePixelType);
00118 itkSetMacro(BackgroundValue, OutputImagePixelType);
00119 itkGetMacro(ForegroundValue, OutputImagePixelType);
00120 itkSetMacro(ForegroundValue, OutputImagePixelType);
00122
00124 void SetVariance(const typename ArrayType::ValueType v)
00125 {
00126 m_Variance.Fill(v);
00127 }
00128
00130 void SetMaximumError(const typename ArrayType::ValueType v)
00131 {
00132 m_MaximumError.Fill(v);
00133 }
00134
00135 #ifdef ITK_USE_CONCEPT_CHECKING
00136
00137 itkConceptMacro(OutputEqualityComparableCheck,
00138 (Concept::EqualityComparable<OutputImagePixelType>));
00139 itkConceptMacro(SameDimensionCheck,
00140 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00141 itkConceptMacro(SameTypeCheck,
00142 (Concept::SameType<InputImagePixelType, OutputImagePixelType>));
00143 itkConceptMacro(OutputOStreamWritableCheck,
00144 (Concept::OStreamWritable<OutputImagePixelType>));
00145
00147 #endif
00148
00149 protected:
00150 ZeroCrossingBasedEdgeDetectionImageFilter()
00151 {
00152 m_Variance.Fill(1.0);
00153 m_MaximumError.Fill(0.01);
00154 m_BackgroundValue = NumericTraits<OutputImagePixelType>::Zero;
00155 m_ForegroundValue = NumericTraits<OutputImagePixelType>::One;
00156 }
00157 ~ZeroCrossingBasedEdgeDetectionImageFilter(){}
00158 ZeroCrossingBasedEdgeDetectionImageFilter(const Self&) {}
00159 void PrintSelf(std::ostream& os, Indent indent) const;
00160
00167 void GenerateData();
00168
00169 private:
00171 ArrayType m_Variance;
00172
00175 ArrayType m_MaximumError;
00176
00177 OutputImagePixelType m_BackgroundValue;
00178 OutputImagePixelType m_ForegroundValue;
00179 };
00180
00181 }
00182
00183 #ifndef ITK_MANUAL_INSTANTIATION
00184 #include "itkZeroCrossingBasedEdgeDetectionImageFilter.txx"
00185 #endif
00186
00187 #endif
00188
00189