00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkZeroCrossingImageFilter_h
00018 #define __itkZeroCrossingImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022 namespace itk
00023 {
00055 template<class TInputImage, class TOutputImage>
00056 class ITK_EXPORT ZeroCrossingImageFilter
00057 : public ImageToImageFilter<TInputImage, TOutputImage>
00058 {
00059 public:
00061 typedef ZeroCrossingImageFilter Self;
00062 typedef ImageToImageFilter<TInputImage, TOutputImage> Superclass;
00063
00065 typedef TInputImage InputImageType;
00066 typedef TOutputImage OutputImageType;
00067
00069 typedef SmartPointer<Self> Pointer;
00070 typedef SmartPointer<const Self> ConstPointer;
00071
00073 typedef typename TInputImage::PixelType InputImagePixelType;
00074 typedef typename TOutputImage::PixelType OutputImagePixelType;
00075
00077 itkNewMacro(Self);
00078
00080 typedef typename TOutputImage::RegionType OutputImageRegionType;
00081
00083 itkTypeMacro(ZeroCrossingImageFilter, ImageToImageFilter);
00084
00086 itkStaticConstMacro(ImageDimension, unsigned int,
00087 TInputImage::ImageDimension );
00088
00097 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00098
00100 itkSetMacro(ForegroundValue, OutputImagePixelType);
00101 itkGetMacro(ForegroundValue, OutputImagePixelType);
00102
00104 itkSetMacro(BackgroundValue, OutputImagePixelType);
00105 itkGetMacro(BackgroundValue, OutputImagePixelType);
00106
00107 protected:
00108 ZeroCrossingImageFilter()
00109 {
00110 m_ForegroundValue = NumericTraits<OutputImagePixelType>::One;
00111 m_BackgroundValue = NumericTraits<OutputImagePixelType>::Zero;
00112 }
00113 ~ZeroCrossingImageFilter(){}
00114 void PrintSelf(std::ostream& os, Indent indent) const;
00115
00116 ZeroCrossingImageFilter(const Self&) {}
00117 OutputImagePixelType m_BackgroundValue;
00118 OutputImagePixelType m_ForegroundValue;
00119
00131 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00132 int threadId );
00133 };
00134
00135 }
00136
00137 #ifndef ITK_MANUAL_INSTANTIATION
00138 #include "itkZeroCrossingImageFilter.txx"
00139 #endif
00140
00141 #endif
00142