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: 2009-04-01 14:36:30 $
00007   Version:   $Revision: 1.12 $
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=TInput1, class TOutput=TInput1>
00040 class Maximum
00041 {
00042 public:
00043   Maximum() {}
00044   ~Maximum() {}
00045   bool operator!=( const Maximum & ) const
00046     {
00047     return false;
00048     }
00049   bool operator==( const Maximum & other ) const
00050     {
00051     return !(*this != other);
00052     }
00053   inline TOutput operator()( const TInput1 & A, const TInput2 & B) const
00054     { 
00055     if(A > B)
00056       {
00057       return static_cast<TOutput>(A);
00058       }
00059     else
00060       {
00061       return static_cast<TOutput>(B);
00062       }
00063     } 
00064 };
00065 }
00066 
00067 template <class TInputImage1, class TInputImage2=TInputImage1, class TOutputImage=TInputImage1>
00068 class ITK_EXPORT MaximumImageFilter :
00069     public
00070 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00071                          Function::Maximum< 
00072   typename TInputImage1::PixelType, 
00073   typename TInputImage2::PixelType,
00074   typename TOutputImage::PixelType>   >
00075 {
00076 public:
00078   typedef MaximumImageFilter        Self;
00079   typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00080                                    Function::Maximum< 
00081     typename TInputImage1::PixelType, 
00082     typename TInputImage2::PixelType,
00083     typename TOutputImage::PixelType>   
00084   >                                 Superclass;
00085   typedef SmartPointer<Self>        Pointer;
00086   typedef SmartPointer<const Self>  ConstPointer;
00087 
00089   itkNewMacro(Self);
00090 
00092   itkTypeMacro(MaximumImageFilter, 
00093                BinaryFunctorImageFilter);
00094 
00095 #ifdef ITK_USE_CONCEPT_CHECKING
00096 
00097   itkConceptMacro(Input1ConvertibleToOutputCheck,
00098     (Concept::Convertible<typename TInputImage1::PixelType,
00099                           typename TOutputImage::PixelType>));
00100   itkConceptMacro(Input2ConvertibleToOutputCheck,
00101     (Concept::Convertible<typename TInputImage2::PixelType,
00102                           typename TOutputImage::PixelType>));
00103   itkConceptMacro(Input1GreaterThanInput2Check,
00104     (Concept::GreaterThanComparable<typename TInputImage1::PixelType,
00105                                     typename TInputImage2::PixelType>));
00106 
00108 #endif
00109 
00110 protected:
00111   MaximumImageFilter() {}
00112   virtual ~MaximumImageFilter() {}
00113 
00114 private:
00115   MaximumImageFilter(const Self&); //purposely not implemented
00116   void operator=(const Self&); //purposely not implemented
00117 
00118 };
00119 
00120 } // end namespace itk
00121 
00122 
00123 #endif
00124 

Generated at Fri Apr 16 19:00:01 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000