00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSubtractImageFilter_h
00018 #define __itkSubtractImageFilter_h
00019
00020 #include "itkBinaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00034 namespace Function {
00035
00036 template< class TInput1, class TInput2, class TOutput>
00037 class Sub2
00038 {
00039 public:
00040 Sub2() {}
00041 ~Sub2() {}
00042 inline TOutput operator()( const TInput1 & A, const TInput2 & B)
00043 { return (TOutput)(A - B); }
00044 };
00045 }
00046
00047 template <class TInputImage1, class TInputImage2, class TOutputImage>
00048 class ITK_EXPORT SubtractImageFilter :
00049 public
00050 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00051 Function::Sub2<
00052 typename TInputImage1::PixelType,
00053 typename TInputImage2::PixelType,
00054 typename TOutputImage::PixelType> >
00055 {
00056 public:
00058 typedef SubtractImageFilter Self;
00059 typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00060 Function::Sub2< typename TInputImage1::PixelType,
00061 typename TInputImage2::PixelType,
00062 typename TOutputImage::PixelType> > Superclass;
00063 typedef SmartPointer<Self> Pointer;
00064 typedef SmartPointer<const Self> ConstPointer;
00065
00066
00068 itkNewMacro(Self);
00069
00070 protected:
00071 SubtractImageFilter() {}
00072 virtual ~SubtractImageFilter() {}
00073
00074 private:
00075 SubtractImageFilter(const Self&);
00076 void operator=(const Self&);
00077
00078
00079 };
00080
00081 }
00082
00083
00084 #endif