Orfeo Toolbox  3.16
itkMaximumImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkMaximumImageFilter.h,v $
5  Language: C++
6  Date: $Date: 2009-04-01 14:36:30 $
7  Version: $Revision: 1.12 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkMaximumImageFilter_h
18 #define __itkMaximumImageFilter_h
19 
21 
22 namespace itk
23 {
24 
37 namespace Function {
38 
39 template< class TInput1, class TInput2=TInput1, class TOutput=TInput1>
40 class Maximum
41 {
42 public:
43  Maximum() {}
44  ~Maximum() {}
45  bool operator!=( const Maximum & ) const
46  {
47  return false;
48  }
49  bool operator==( const Maximum & other ) const
50  {
51  return !(*this != other);
52  }
53  inline TOutput operator()( const TInput1 & A, const TInput2 & B) const
54  {
55  if(A > B)
56  {
57  return static_cast<TOutput>(A);
58  }
59  else
60  {
61  return static_cast<TOutput>(B);
62  }
63  }
64 };
65 }
66 
67 template <class TInputImage1, class TInputImage2=TInputImage1, class TOutputImage=TInputImage1>
69  public
70 BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
71  Function::Maximum<
72  typename TInputImage1::PixelType,
73  typename TInputImage2::PixelType,
74  typename TOutputImage::PixelType> >
75 {
76 public:
79  typedef BinaryFunctorImageFilter<TInputImage1,TInputImage2,TOutputImage,
81  typename TInputImage1::PixelType,
82  typename TInputImage2::PixelType,
83  typename TOutputImage::PixelType>
87 
89  itkNewMacro(Self);
90 
92  itkTypeMacro(MaximumImageFilter,
94 
95 #ifdef ITK_USE_CONCEPT_CHECKING
96 
97  itkConceptMacro(Input1ConvertibleToOutputCheck,
98  (Concept::Convertible<typename TInputImage1::PixelType,
99  typename TOutputImage::PixelType>));
100  itkConceptMacro(Input2ConvertibleToOutputCheck,
101  (Concept::Convertible<typename TInputImage2::PixelType,
102  typename TOutputImage::PixelType>));
103  itkConceptMacro(Input1GreaterThanInput2Check,
104  (Concept::GreaterThanComparable<typename TInputImage1::PixelType,
105  typename TInputImage2::PixelType>));
107 #endif
108 
109 protected:
111  virtual ~MaximumImageFilter() {}
112 
113 private:
114  MaximumImageFilter(const Self&); //purposely not implemented
115  void operator=(const Self&); //purposely not implemented
116 
117 };
118 
119 } // end namespace itk
120 
121 
122 #endif

Generated at Sat Feb 2 2013 23:51:53 for Orfeo Toolbox with doxygen 1.8.1.1