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
00104 typedef FixedArray<double, itkGetStaticConstMacro(ImageDimension)> ArrayType;
00105
00107
itkSetMacro(Variance,
ArrayType);
00108
itkGetMacro(Variance,
const ArrayType);
00109
itkSetMacro(MaximumError,
ArrayType);
00110
itkGetMacro(MaximumError,
const ArrayType);
00111
00113
itkGetMacro(BackgroundValue,
OutputImagePixelType);
00114
itkSetMacro(BackgroundValue,
OutputImagePixelType);
00115
itkGetMacro(ForegroundValue,
OutputImagePixelType);
00116
itkSetMacro(ForegroundValue,
OutputImagePixelType);
00117
00119
void SetVariance(
const typename ArrayType::ValueType v)
00120 {
00121 m_Variance.Fill(v);
00122 }
00123
00125
void SetMaximumError(
const typename ArrayType::ValueType v)
00126 {
00127 m_MaximumError.Fill(v);
00128 }
00129
00130
protected:
00131 ZeroCrossingBasedEdgeDetectionImageFilter()
00132 {
00133 m_Variance.Fill(1.0);
00134 m_MaximumError.Fill(0.01);
00135 m_BackgroundValue =
NumericTraits<OutputImagePixelType>::Zero;
00136 m_ForegroundValue =
NumericTraits<OutputImagePixelType>::One;
00137 }
00138 ~ZeroCrossingBasedEdgeDetectionImageFilter(){}
00139 ZeroCrossingBasedEdgeDetectionImageFilter(
const Self&) {}
00140 void PrintSelf(std::ostream& os,
Indent indent)
const;
00141
00148
void GenerateData();
00149
00150
private:
00152
ArrayType m_Variance;
00153
00156
ArrayType m_MaximumError;
00157
00158
OutputImagePixelType m_BackgroundValue;
00159
OutputImagePixelType m_ForegroundValue;
00160 };
00161
00162 }
00163
00164
#ifndef ITK_MANUAL_INSTANTIATION
00165
#include "itkZeroCrossingBasedEdgeDetectionImageFilter.txx"
00166
#endif
00167
00168
#endif
00169