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

itkMaximumImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMaximumImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/02/11 23:00:50 $
00007   Version:   $Revision: 1.4 $
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 __itkMaximumImageFilter_h
00018 #define __itkMaximumImageFilter_h
00019 
00020 #include "itkBinaryFunctorImageFilter.h"
00021 
00022 namespace itk
00023 {
00024   
00037 namespace Function {  
00038 
00039 template< class TInput1, class TInput2, class TOutput>
00040 class Maximum
00041 {
00042 public:
00043   Maximum() {}
00044   ~Maximum() {}
00045   inline TOutput operator()( const TInput1 & A, const TInput2 & B)
00046   { 
00047    if(A > B)
00048      {
00049      return static_cast<TOutput>(A);
00050      }
00051    else
00052      {
00053      return static_cast<TOutput>(B);
00054      }
00055   } 
00056 };
00057 }
00058 
00059 template <class TInputImage1, class TInputImage2, class TOutputImage>
00060 class ITK_EXPORT MaximumImageFilter :
00061     public
00062 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00063                          Function::Maximum< 
00064   typename TInputImage1::PixelType, 
00065   typename TInputImage2::PixelType,
00066   typename TOutputImage::PixelType>   >
00067 {
00068 public:
00070   typedef MaximumImageFilter  Self;
00071   typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00072                                    Function::Maximum< 
00073     typename TInputImage1::PixelType, 
00074     typename TInputImage2::PixelType,
00075     typename TOutputImage::PixelType>   
00076   > Superclass;
00077   typedef SmartPointer<Self>   Pointer;
00078   typedef SmartPointer<const Self>  ConstPointer;
00079 
00081   itkNewMacro(Self);
00082   
00083 protected:
00084   MaximumImageFilter() {}
00085   virtual ~MaximumImageFilter() {}
00086 
00087 private:
00088   MaximumImageFilter(const Self&); //purposely not implemented
00089   void operator=(const Self&); //purposely not implemented
00090 
00091 };
00092 
00093 } // end namespace itk
00094 
00095 
00096 #endif

Generated at Wed May 24 23:38:02 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000