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
00036 namespace Function {
00037
00038 template< class TInput1, class TInput2, class TOutput>
00039 class Sub2
00040 {
00041 public:
00042 Sub2() {}
00043 ~Sub2() {}
00044 bool operator!=( const Sub2 & ) const
00045 {
00046 return false;
00047 }
00048 bool operator==( const Sub2 & other ) const
00049 {
00050 return !(*this != other);
00051 }
00052 inline TOutput operator()( const TInput1 & A, const TInput2 & B)
00053 { return (TOutput)(A - B); }
00054 };
00055 }
00056
00057 template <class TInputImage1, class TInputImage2, class TOutputImage>
00058 class ITK_EXPORT SubtractImageFilter :
00059 public
00060 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00061 Function::Sub2<
00062 typename TInputImage1::PixelType,
00063 typename TInputImage2::PixelType,
00064 typename TOutputImage::PixelType> >
00065 {
00066 public:
00068 typedef SubtractImageFilter Self;
00069 typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00070 Function::Sub2< typename TInputImage1::PixelType,
00071 typename TInputImage2::PixelType,
00072 typename TOutputImage::PixelType> > Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00076
00078 itkNewMacro(Self);
00079
00080 #ifdef ITK_USE_CONCEPT_CHECKING
00081
00082 itkConceptMacro(Input1Input2OutputAdditiveOperatorsCheck,
00083 (Concept::AdditiveOperators<typename TInputImage1::PixelType,
00084 typename TInputImage2::PixelType,
00085 typename TOutputImage::PixelType>));
00086
00088 #endif
00089
00090 protected:
00091 SubtractImageFilter() {}
00092 virtual ~SubtractImageFilter() {}
00093
00094 private:
00095 SubtractImageFilter(const Self&);
00096 void operator=(const Self&);
00097
00098
00099 };
00100
00101 }
00102
00103
00104 #endif
00105