Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMultiplyImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMultiplyImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/09/27 11:36:41 $
00007   Version:   $Revision: 1.25 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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&); //purposely not implemented
00099   void operator=(const Self&); //purposely not implemented
00100 
00101 };
00102 
00103 } // end namespace itk
00104 
00105 
00106 #endif
00107 

Generated at Tue Jul 29 21:21:33 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000