ITK  5.3.0
Insight Toolkit
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 
24 namespace itk
25 {
26 namespace Functor
27 {
32 template <typename TInput, typename TOutput>
33 class Abs
34 {
35 public:
36  Abs() = default;
37  ~Abs() = default;
38  bool
39  operator==(const Abs &) const
40  {
41  return true;
42  }
43 
45 
46  inline TOutput
47  operator()(const TInput & A) const
48  {
49  return static_cast<TOutput>(itk::Math::abs(A));
50  }
51 };
52 } // namespace Functor
53 
67 template <typename TInputImage, typename TOutputImage>
68 class ITK_TEMPLATE_EXPORT AbsImageFilter : public UnaryGeneratorImageFilter<TInputImage, TOutputImage>
69 {
70 public:
71  ITK_DISALLOW_COPY_AND_MOVE(AbsImageFilter);
72 
79 
81  itkNewMacro(Self);
82 
85 
86  using InputPixelType = typename TInputImage::PixelType;
87  using OutputPixelType = typename TOutputImage::PixelType;
88 
89 
90 #ifdef ITK_USE_CONCEPT_CHECKING
91  // Begin concept checking
94  // End concept checking
95 #endif
96 
97 protected:
99  {
100 #if !defined(ITK_WRAPPING_PARSER)
101  Superclass::SetFunctor(FunctorType());
102 #endif
103  }
104 
105  ~AbsImageFilter() override = default;
106 };
107 } // end namespace itk
108 
109 #endif
itk::AbsImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkAbsImageFilter.h:86
itk::AbsImageFilter::AbsImageFilter
AbsImageFilter()
Definition: itkAbsImageFilter.h:98
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:284
itkConceptChecking.h
itk::UnaryGeneratorImageFilter
Implements pixel-wise generic "operation" on one image.
Definition: itkUnaryGeneratorImageFilter.h:55
itk::SmartPointer< Self >
itk::Functor::Abs
Computes the absolute value of a pixel.
Definition: itkAbsImageFilter.h:33
itk::Functor::Abs::operator==
bool operator==(const Abs &) const
Definition: itkAbsImageFilter.h:39
itk::Functor::Abs::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Abs)
itk::Math::abs
bool abs(bool x)
Definition: itkMath.h:851
itkUnaryGeneratorImageFilter.h
itk::Functor::Abs::~Abs
~Abs()=default
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::Abs::operator()
TOutput operator()(const TInput &A) const
Definition: itkAbsImageFilter.h:47
itk::Functor::Abs::Abs
Abs()=default
FunctorType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkAddImageFilter.h:96
itk::AbsImageFilter
Computes the absolute value of each pixel.
Definition: itkAbsImageFilter.h:68
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
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::AbsImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkAbsImageFilter.h:87