itkMultiplyImageFilter.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 __itkMultiplyImageFilter_h
00018 #define __itkMultiplyImageFilter_h
00019
00020 #include "itkBinaryFunctorImageFilter.h"
00021
00022 namespace itk
00023 {
00024
00034 namespace Function {
00035
00036 template< class TInput1, class TInput2=TInput1, class TOutput=TInput1>
00037 class Mult
00038 {
00039 public:
00040 Mult() {}
00041 ~Mult() {}
00042 bool operator!=( const Mult & ) const
00043 {
00044 return false;
00045 }
00046 bool operator==( const Mult & other ) const
00047 {
00048 return !(*this != other);
00049 }
00050 inline TOutput operator()( const TInput1 & A, const TInput2 & B)
00051 { return (TOutput)(A * B); }
00052 };
00053 }
00054
00055 template <class TInputImage1, class TInputImage2=TInputImage1, class TOutputImage=TInputImage1>
00056 class ITK_EXPORT MultiplyImageFilter :
00057 public
00058 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00059 Function::Mult<
00060 typename TInputImage1::PixelType,
00061 typename TInputImage2::PixelType,
00062 typename TOutputImage::PixelType> >
00063 {
00064 public:
00066 typedef MultiplyImageFilter Self;
00067 typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
00068 Function::Mult<
00069 typename TInputImage1::PixelType,
00070 typename TInputImage2::PixelType,
00071 typename TOutputImage::PixelType>
00072 > Superclass;
00073 typedef SmartPointer<Self> Pointer;
00074 typedef SmartPointer<const Self> ConstPointer;
00075
00077 itkNewMacro(Self);
00078
00080 itkTypeMacro(MultiplyImageFilter,
00081 BinaryFunctorImageFilter);
00082
00083 #ifdef ITK_USE_CONCEPT_CHECKING
00084
00085 itkConceptMacro(Input1Input2OutputMultiplyOperatorCheck,
00086 (Concept::MultiplyOperator<typename TInputImage1::PixelType,
00087 typename TInputImage2::PixelType,
00088 typename TOutputImage::PixelType>));
00089
00091 #endif
00092
00093 protected:
00094 MultiplyImageFilter() {}
00095 virtual ~MultiplyImageFilter() {}
00096
00097 private:
00098 MultiplyImageFilter(const Self&);
00099 void operator=(const Self&);
00100
00101 };
00102
00103 }
00104
00105
00106 #endif
00107