ITK  5.2.0
Insight Toolkit
itkBoundedReciprocalImageFilter.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  * http://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  *
20  * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21  *
22  * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23  *
24  * For complete copyright, license and disclaimer of warranty information
25  * please refer to the NOTICE file at the top of the ITK source tree.
26  *
27  *=========================================================================*/
28 #ifndef itkBoundedReciprocalImageFilter_h
29 #define itkBoundedReciprocalImageFilter_h
30 
32 
33 namespace itk
34 {
44 namespace Functor
45 {
46 template <typename TInput, typename TOutput>
48 {
49 public:
50  BoundedReciprocal() = default;
51  ~BoundedReciprocal() = default;
52  bool
54  {
55  return false;
56  }
57 
58  bool
59  operator==(const BoundedReciprocal & other) const
60  {
61  return !(*this != other);
62  }
63 
64  inline TOutput
65  operator()(const TInput & A) const
66  {
67  return static_cast<TOutput>(1.0 / (1.0 + static_cast<double>(A)));
68  }
69 };
70 } // namespace Functor
71 
72 template <typename TInputImage, typename TOutputImage>
73 class BoundedReciprocalImageFilter : public UnaryGeneratorImageFilter<TInputImage, TOutputImage>
74 {
75 public:
76  ITK_DISALLOW_COPY_AND_MOVE(BoundedReciprocalImageFilter);
77 
84 
86  itkNewMacro(Self);
87 
90 
91 #ifdef ITK_USE_CONCEPT_CHECKING
92  // Begin concept checking
95  // End concept checking
96 #endif
97 
98 protected:
100  {
101 #if !defined(ITK_WRAPPING_PARSER)
103 #endif
104  }
105 
106  ~BoundedReciprocalImageFilter() override = default;
107 };
108 } // end namespace itk
109 
110 #endif
itk::BoundedReciprocalImageFilter::FunctorType
Functor::BoundedReciprocal< typename TInputImage::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkBoundedReciprocalImageFilter.h:83
itk::UnaryGeneratorImageFilter::SetFunctor
void SetFunctor(const std::function< ConstRefFunctionType > &f)
Definition: itkUnaryGeneratorImageFilter.h:92
itk::UnaryGeneratorImageFilter
Implements pixel-wise generic "operation" on one image.
Definition: itkUnaryGeneratorImageFilter.h:55
itk::SmartPointer< Self >
itk::Functor::BoundedReciprocal::operator()
TOutput operator()(const TInput &A) const
Definition: itkBoundedReciprocalImageFilter.h:65
itk::BoundedReciprocalImageFilter
Computes 1/(1+x) for each pixel in the image.
Definition: itkBoundedReciprocalImageFilter.h:73
itkUnaryGeneratorImageFilter.h
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::Functor::BoundedReciprocal
Definition: itkBoundedReciprocalImageFilter.h:47
itk::Functor::BoundedReciprocal::operator==
bool operator==(const BoundedReciprocal &other) const
Definition: itkBoundedReciprocalImageFilter.h:59
itk::Functor::BoundedReciprocal::BoundedReciprocal
BoundedReciprocal()=default
itk::BoundedReciprocalImageFilter::BoundedReciprocalImageFilter
BoundedReciprocalImageFilter()
Definition: itkBoundedReciprocalImageFilter.h:99
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk::Functor::BoundedReciprocal::operator!=
bool operator!=(const BoundedReciprocal &) const
Definition: itkBoundedReciprocalImageFilter.h:53
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::BoundedReciprocalImageFilter::~BoundedReciprocalImageFilter
~BoundedReciprocalImageFilter() override=default
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Functor::BoundedReciprocal::~BoundedReciprocal
~BoundedReciprocal()=default