ITK  6.0.0
Insight Toolkit
itkMaximumImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * https://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkMaximumImageFilter_h
19 #define itkMaximumImageFilter_h
20 
22 
23 namespace itk
24 {
25 namespace Functor
26 {
32 template <typename TInput1, typename TInput2 = TInput1, typename TOutput = TInput1>
33 class Maximum
34 {
35 public:
36  bool
37  operator==(const Maximum &) const
38  {
39  return true;
40  }
41 
43 
44  inline TOutput
45  operator()(const TInput1 & A, const TInput2 & B) const
46  {
47  if (A > B)
48  {
49  return static_cast<TOutput>(A);
50  }
51  else
52  {
53  return static_cast<TOutput>(B);
54  }
55  }
56 };
57 } // namespace Functor
58 
78 template <typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1>
79 class ITK_TEMPLATE_EXPORT MaximumImageFilter
80  : public BinaryGeneratorImageFilter<TInputImage1, TInputImage2, TOutputImage>
81 {
82 public:
83  ITK_DISALLOW_COPY_AND_MOVE(MaximumImageFilter);
84 
88 
91  using FunctorType = Functor::
92  Maximum<typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType>;
93 
95  itkNewMacro(Self);
96 
98  itkOverrideGetNameOfClassMacro(MaximumImageFilter);
99 
100 #ifdef ITK_USE_CONCEPT_CHECKING
101  // Begin concept checking
102  itkConceptMacro(Input1ConvertibleToOutputCheck,
104  itkConceptMacro(Input2ConvertibleToOutputCheck,
106  itkConceptMacro(Input1GreaterThanInput2Check,
108  // End concept checking
109 #endif
110 
111 protected:
113  {
114 #if !defined(ITK_WRAPPING_PARSER)
115  Superclass::SetFunctor(FunctorType());
116 #endif
117  }
118 
119  ~MaximumImageFilter() override = default;
120 };
121 } // end namespace itk
122 
123 #endif
itk::Functor::Maximum::operator==
bool operator==(const Maximum &) const
Definition: itkMaximumImageFilter.h:37
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:284
itk::BinaryGeneratorImageFilter
Implements pixel-wise generic operation of two images, or of an image and a constant.
Definition: itkBinaryGeneratorImageFilter.h:56
itk::SmartPointer< Self >
itkBinaryGeneratorImageFilter.h
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::Maximum::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Maximum)
itk::Functor::Maximum
Definition: itkMaximumImageFilter.h:33
FunctorType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkAddImageFilter.h:97
itk::MaximumImageFilter
Implements a pixel-wise operator Max(a,b) between two images.
Definition: itkMaximumImageFilter.h:79
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::Functor::Maximum::operator()
TOutput operator()(const TInput1 &A, const TInput2 &B) const
Definition: itkMaximumImageFilter.h:45
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::MaximumImageFilter::MaximumImageFilter
MaximumImageFilter()
Definition: itkMaximumImageFilter.h:112