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

itkMinimumImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMinimumImageFilter.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 __itkMinimumImageFilter_h
00018 #define __itkMinimumImageFilter_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 Minimum
00041 {
00042 public:
00043   Minimum() {}
00044   ~Minimum() {}
00045   bool operator!=( const Minimum & ) const
00046     {
00047     return false;
00048     }
00049   bool operator==( const Minimum & other ) const
00050     {
00051     return !(*this != other);
00052     }
00053   inline TOutput operator()( const TInput1 & A, const TInput2 & B) const
00054     { return static_cast<TOutput>( (A < B)? A : B ); }
00055 }; 
00056 }
00057 
00058 template <class TInputImage1, class TInputImage2=TInputImage1, class TOutputImage=TInputImage1>
00059 class ITK_EXPORT MinimumImageFilter :
00060     public
00061 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage, 
00062                          Function::Minimum< 
00063   typename TInputImage1::PixelType, 
00064   typename TInputImage2::PixelType,
00065   typename TOutputImage::PixelType>   >
00066 {
00067 public:
00069   typedef MinimumImageFilter        Self;
00070   typedef BinaryFunctorImageFilter<
00071     TInputImage1,TInputImage2,TOutputImage, 
00072     Function::Minimum< 
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 
00084   itkTypeMacro(MinimumImageFilter, 
00085                BinaryFunctorImageFilter);
00086 
00087 #ifdef ITK_USE_CONCEPT_CHECKING
00088 
00089   itkConceptMacro(Input1ConvertibleToInput2Check,
00090     (Concept::Convertible<typename TInputImage1::PixelType,
00091                           typename TInputImage2::PixelType>));
00092   itkConceptMacro(Input2ConvertibleToOutputCheck,
00093     (Concept::Convertible<typename TInputImage2::PixelType,
00094                           typename TOutputImage::PixelType>));
00095   itkConceptMacro(Input1LessThanInput2Check,
00096     (Concept::LessThanComparable<typename TInputImage1::PixelType,
00097                                  typename TInputImage2::PixelType>));
00098 
00100 #endif
00101 
00102 protected:
00103   MinimumImageFilter() {}
00104   virtual ~MinimumImageFilter() {}
00105 
00106 private:
00107   MinimumImageFilter(const Self&); //purposely not implemented
00108   void operator=(const Self&); //purposely not implemented
00109 
00110 };
00111 
00112 } // end namespace itk
00113 
00114 
00115 #endif
00116 

Generated at Tue Sep 15 03:58:02 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000