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 itkStaticConstMacro(OutputImageDimension, unsigned int,
00089 TOutputImage::ImageDimension );
00091
00100 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00101
00103 itkSetMacro(ForegroundValue, OutputImagePixelType);
00104 itkGetMacro(ForegroundValue, OutputImagePixelType);
00106
00108 itkSetMacro(BackgroundValue, OutputImagePixelType);
00109 itkGetMacro(BackgroundValue, OutputImagePixelType);
00111
00112 #ifdef ITK_USE_CONCEPT_CHECKING
00113
00114 itkConceptMacro(OutputEqualityComparableCheck,
00115 (Concept::EqualityComparable<OutputImagePixelType>));
00116 itkConceptMacro(SameDimensionCheck,
00117 (Concept::SameDimension<ImageDimension, OutputImageDimension>));
00118 itkConceptMacro(InputComparableCheck,
00119 (Concept::Comparable<InputImagePixelType>));
00120 itkConceptMacro(OutputOStreamWritableCheck,
00121 (Concept::OStreamWritable<OutputImagePixelType>));
00122
00124 #endif
00125
00126 protected:
00127 ZeroCrossingImageFilter()
00128 {
00129 m_ForegroundValue = NumericTraits<OutputImagePixelType>::One;
00130 m_BackgroundValue = NumericTraits<OutputImagePixelType>::Zero;
00131 }
00132 ~ZeroCrossingImageFilter(){}
00133 void PrintSelf(std::ostream& os, Indent indent) const;
00134
00135 ZeroCrossingImageFilter(const Self&) {}
00136 OutputImagePixelType m_BackgroundValue;
00137 OutputImagePixelType m_ForegroundValue;
00138
00150 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00151 int threadId );
00152 };
00154
00155 }
00156
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkZeroCrossingImageFilter.txx"
00159 #endif
00160
00161 #endif
00162
00163