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/08/30 15:01:09 $
00007   Version:   $Revision: 1.24 $
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 
00079 #ifdef ITK_USE_CONCEPT_CHECKING
00080 
00081   itkConceptMacro(Input1Input2OutputMultiplyOperatorCheck,
00082     (Concept::MultiplyOperator<typename TInputImage1::PixelType,
00083                                typename TInputImage2::PixelType,
00084                                typename TOutputImage::PixelType>));
00085 
00087 #endif
00088 
00089 protected:
00090   MultiplyImageFilter() {}
00091   virtual ~MultiplyImageFilter() {}
00092 
00093 private:
00094   MultiplyImageFilter(const Self&); //purposely not implemented
00095   void operator=(const Self&); //purposely not implemented
00096 
00097 };
00098 
00099 } // end namespace itk
00100 
00101 
00102 #endif
00103 

Generated at Sun Sep 23 13:36:10 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000