ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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
23namespace itk
24{
25namespace Functor
26{
32template <typename TInput1, typename TInput2 = TInput1, typename TOutput = TInput1>
34{
35public:
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
52 return static_cast<TOutput>(B);
53 }
54};
55} // namespace Functor
56
76template <typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1>
77class ITK_TEMPLATE_EXPORT MaximumImageFilter
78 : public BinaryGeneratorImageFilter<TInputImage1, TInputImage2, TOutputImage>
79{
80public:
81 ITK_DISALLOW_COPY_AND_MOVE(MaximumImageFilter);
82
86
89 using FunctorType = Functor::
90 Maximum<typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType>;
91
93 itkNewMacro(Self);
94
96 itkOverrideGetNameOfClassMacro(MaximumImageFilter);
97
98 itkConceptMacro(Input1ConvertibleToOutputCheck,
100 itkConceptMacro(Input2ConvertibleToOutputCheck,
102 itkConceptMacro(Input1GreaterThanInput2Check,
104
105protected:
107 {
108#if !defined(ITK_WRAPPING_PARSER)
110#endif
111 }
112
113 ~MaximumImageFilter() override = default;
114};
115} // end namespace itk
116
117#endif
void SetFunctor(const std::function< ConstRefFunctionType > &f)
TOutput operator()(const TInput1 &A, const TInput2 &B) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Maximum)
bool operator==(const Maximum &) const
~MaximumImageFilter() override=default
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
Functor:: Maximum< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
BinaryGeneratorImageFilter< TInputImage1, TInputImage2, TOutputImage > Superclass
Implements transparent reference counting.
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....