ITK  6.0.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  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 
65 template <typename TInputImage, typename TOutputImage>
66 class ITK_TEMPLATE_EXPORT AbsImageFilter : public UnaryGeneratorImageFilter<TInputImage, TOutputImage>
67 {
68 public:
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 
88 #ifdef ITK_USE_CONCEPT_CHECKING
89  // Begin concept checking
92  // End concept checking
93 #endif
94 
95 protected:
97  {
98 #if !defined(ITK_WRAPPING_PARSER)
99  Superclass::SetFunctor(FunctorType());
100 #endif
101  }
102 
103  ~AbsImageFilter() override = default;
104 };
105 } // end namespace itk
106 
107 #endif
itk::AbsImageFilter::InputPixelType
typename TInputImage::PixelType InputPixelType
Definition: itkAbsImageFilter.h:84
itk::AbsImageFilter::AbsImageFilter
AbsImageFilter()
Definition: itkAbsImageFilter.h:96
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:285
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:37
itk::Functor::Abs::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Abs)
itk::Math::abs
bool abs(bool x)
Definition: itkMath.h:839
itkUnaryGeneratorImageFilter.h
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:45
FunctorType
Functor::Add2< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkAddImageFilter.h:97
itk::AbsImageFilter
Computes the absolute value of each pixel.
Definition: itkAbsImageFilter.h:66
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
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:217
itk::AbsImageFilter::OutputPixelType
typename TOutputImage::PixelType OutputPixelType
Definition: itkAbsImageFilter.h:85