ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMaximumAbsoluteValueImageFilter.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
19#ifndef itkMaximumAbsoluteValueImageFilter_h
20#define itkMaximumAbsoluteValueImageFilter_h
21
23#include "itkMath.h"
24
25namespace itk
26{
27namespace Functor
28{
42template <typename TInputPixel1, typename TInputPixel2 = TInputPixel1, typename TOutputPixel = TInputPixel1>
44{
45public:
47
49
50 bool
52 {
53 return false;
54 }
55
56 bool
57 operator==(const MaximumAbsoluteValue & other) const
58 {
59 return !(*this != other);
60 }
61
62 TOutputPixel
63 operator()(const TInputPixel1 A, const TInputPixel2 B)
64 {
65 return static_cast<TOutputPixel>(itk::Math::Absolute(A) > itk::Math::Absolute(B) ? A : B);
66 }
67}; // end of class
68} // namespace Functor
69
83template <typename TInputImage1, typename TInputImage2 = TInputImage1, typename TOutputImage = TInputImage1>
84class ITK_TEMPLATE_EXPORT MaximumAbsoluteValueImageFilter
85 : public BinaryFunctorImageFilter<TInputImage1,
86 TInputImage2,
87 TOutputImage,
88 Functor::MaximumAbsoluteValue<typename TInputImage1::PixelType,
89 typename TInputImage2::PixelType,
90 typename TOutputImage::PixelType>>
91{
92public:
93 ITK_DISALLOW_COPY_AND_MOVE(MaximumAbsoluteValueImageFilter);
94
98 TInputImage2,
99 TOutputImage,
100 Functor::MaximumAbsoluteValue<typename TInputImage1::PixelType,
101 typename TInputImage2::PixelType,
102 typename TOutputImage::PixelType>>;
105 using Input1PixelType = typename TInputImage1::PixelType;
106 using Input2PixelType = typename TInputImage2::PixelType;
107 using OutputPixelType = typename TOutputImage::PixelType;
108
110 itkNewMacro(Self);
111
113 itkOverrideGetNameOfClassMacro(MaximumAbsoluteValueImageFilter);
116
117protected:
120}; // end of class
121} // end namespace itk
122
123#endif // itkMaximumAbsoluteValueImageFilter_h
Compute the maximum (of the absolute value) between two images.
bool operator!=(const MaximumAbsoluteValue &) const
TOutputPixel operator()(const TInputPixel1 A, const TInputPixel2 B)
bool operator==(const MaximumAbsoluteValue &other) const
BinaryFunctorImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::MaximumAbsoluteValue< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > > Superclass
~MaximumAbsoluteValueImageFilter() override=default
Implements transparent reference counting.
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
constexpr auto Absolute(T x) noexcept
Returns the absolute value of a number.
Definition itkMath.h:1134
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....