ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkAbsImageFilter.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 itkAbsImageFilter_h
19#define itkAbsImageFilter_h
20
22#include "itkConceptChecking.h"
23
24namespace itk
25{
26namespace Functor
27{
32template <typename TInput, typename TOutput>
33class Abs
34{
35public:
36 bool
37 operator==(const Abs &) const
38 {
39 return true;
40 }
41
43
44 inline TOutput
45 operator()(const TInput & A) const
46 {
47 return static_cast<TOutput>(itk::Math::abs(A));
48 }
49};
50} // namespace Functor
51
65template <typename TInputImage, typename TOutputImage>
66class ITK_TEMPLATE_EXPORT AbsImageFilter : public UnaryGeneratorImageFilter<TInputImage, TOutputImage>
67{
68public:
69 ITK_DISALLOW_COPY_AND_MOVE(AbsImageFilter);
70
77
79 itkNewMacro(Self);
80
82 itkOverrideGetNameOfClassMacro(AbsImageFilter);
83
84 using InputPixelType = typename TInputImage::PixelType;
85 using OutputPixelType = typename TOutputImage::PixelType;
86
87
90
91protected:
93 {
94#if !defined(ITK_WRAPPING_PARSER)
96#endif
97 }
98
99 ~AbsImageFilter() override = default;
100};
101} // end namespace itk
102
103#endif
typename TInputImage::PixelType InputPixelType
SmartPointer< const Self > ConstPointer
~AbsImageFilter() override=default
UnaryGeneratorImageFilter< TInputImage, TOutputImage > Superclass
typename TOutputImage::PixelType OutputPixelType
SmartPointer< Self > Pointer
Functor::Abs< typename TInputImage::PixelType, typename TOutputImage::PixelType > FunctorType
Computes the absolute value of a pixel.
TOutput operator()(const TInput &A) const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Abs)
bool operator==(const Abs &) const
Implements transparent reference counting.
void SetFunctor(const std::function< ConstRefFunctionType > &f)
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
#define itkConceptMacro(name, concept)
bool abs(bool x)
Definition itkMath.h:837
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....