00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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)
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<TInputImage1,TInputImage2,TOutputImage,
00071 Function::Minimum<
00072 typename TInputImage1::PixelType,
00073 typename TInputImage2::PixelType,
00074 typename TOutputImage::PixelType>
00075 > Superclass;
00076 typedef SmartPointer<Self> Pointer;
00077 typedef SmartPointer<const Self> ConstPointer;
00078
00080 itkNewMacro(Self);
00081
00083 itkTypeMacro(MinimumImageFilter,
00084 BinaryFunctorImageFilter);
00085
00086 #ifdef ITK_USE_CONCEPT_CHECKING
00087
00088 itkConceptMacro(Input1ConvertibleToInput2Check,
00089 (Concept::Convertible<typename TInputImage1::PixelType,
00090 typename TInputImage2::PixelType>));
00091 itkConceptMacro(Input2ConvertibleToOutputCheck,
00092 (Concept::Convertible<typename TInputImage2::PixelType,
00093 typename TOutputImage::PixelType>));
00094 itkConceptMacro(Input1LessThanInput2Check,
00095 (Concept::LessThanComparable<typename TInputImage1::PixelType,
00096 typename TInputImage2::PixelType>));
00097
00099 #endif
00100
00101 protected:
00102 MinimumImageFilter() {}
00103 virtual ~MinimumImageFilter() {}
00104
00105 private:
00106 MinimumImageFilter(const Self&);
00107 void operator=(const Self&);
00108
00109 };
00110
00111 }
00112
00113
00114 #endif
00115