itkTernaryAddImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkTernaryAddImageFilter_h
00018 #define __itkTernaryAddImageFilter_h
00019
00020 #include "itkTernaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00034 namespace Function {
00035
00036 template< class TInput1, class TInput2, class TInput3, class TOutput>
00037 class Add3
00038 {
00039 public:
00040 Add3() {}
00041 ~Add3() {}
00042 bool operator!=( const Add3 & ) const
00043 {
00044 return false;
00045 }
00046 bool operator==( const Add3 & other ) const
00047 {
00048 return !(*this != other);
00049 }
00050 inline TOutput operator()( const TInput1 & A,
00051 const TInput2 & B,
00052 const TInput3 & C) const
00053 { return (TOutput)(A + B + C); }
00054 };
00055 }
00056
00057 template <class TInputImage1, class TInputImage2,
00058 class TInputImage3, class TOutputImage>
00059 class ITK_EXPORT TernaryAddImageFilter :
00060 public
00061 TernaryFunctorImageFilter<TInputImage1,TInputImage2,
00062 TInputImage3,TOutputImage,
00063 Function::Add3< typename TInputImage1::PixelType,
00064 typename TInputImage2::PixelType,
00065 typename TInputImage3::PixelType,
00066 typename TOutputImage::PixelType> >
00067 {
00068 public:
00070 typedef TernaryAddImageFilter Self;
00071 typedef TernaryFunctorImageFilter<
00072 TInputImage1,TInputImage2,
00073 TInputImage3,TOutputImage,
00074 Function::Add3< typename TInputImage1::PixelType,
00075 typename TInputImage2::PixelType,
00076 typename TInputImage3::PixelType,
00077 typename TOutputImage::PixelType> > Superclass;
00078 typedef SmartPointer<Self> Pointer;
00079 typedef SmartPointer<const Self> ConstPointer;
00080
00082 itkNewMacro(Self);
00083
00085 itkTypeMacro(TernaryAddImageFilter,
00086 TernaryFunctorImageFilter);
00087
00088 protected:
00089 TernaryAddImageFilter() {}
00090 virtual ~TernaryAddImageFilter() {}
00091
00092 private:
00093 TernaryAddImageFilter(const Self&);
00094 void operator=(const Self&);
00095
00096 };
00097
00098 }
00099
00100
00101 #endif
00102