ITK  5.3.0
Insight Toolkit
itkTernaryMagnitudeImageFilter.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 #ifndef itkTernaryMagnitudeImageFilter_h
19 #define itkTernaryMagnitudeImageFilter_h
20 
22 
23 namespace itk
24 {
25 namespace Functor
26 {
32 template <typename TInput1, typename TInput2, typename TInput3, typename TOutput>
33 class Modulus3
34 {
35 public:
36  Modulus3() = default;
37  ~Modulus3() = default;
38  bool
39  operator==(const Modulus3 &) const
40  {
41  return true;
42  }
44 
46 
47  inline TOutput
48  operator()(const TInput1 & A, const TInput2 & B, const TInput3 & C) const
49  {
50  return static_cast<TOutput>(std::sqrt(static_cast<double>(A * A + B * B + C * C)));
51  }
52 };
53 } // namespace Functor
54 
66 template <typename TInputImage1, typename TInputImage2, typename TInputImage3, typename TOutputImage>
68  : public TernaryGeneratorImageFilter<TInputImage1, TInputImage2, TInputImage3, TOutputImage>
69 {
70 public:
71  ITK_DISALLOW_COPY_AND_MOVE(TernaryMagnitudeImageFilter);
72 
76 
79 
80  using FunctorType = Functor::Modulus3<typename TInputImage1::PixelType,
81  typename TInputImage2::PixelType,
82  typename TInputImage3::PixelType,
83  typename TOutputImage::PixelType>;
84 
86  itkNewMacro(Self);
87 
90 
91 protected:
93  {
94 #if !defined(ITK_WRAPPING_PARSER)
96 #endif
97  }
98  ~TernaryMagnitudeImageFilter() override = default;
99 };
100 } // end namespace itk
101 
102 #endif
itk::TernaryMagnitudeImageFilter::TernaryMagnitudeImageFilter
TernaryMagnitudeImageFilter()
Definition: itkTernaryMagnitudeImageFilter.h:92
itk::Functor::Modulus3::operator()
TOutput operator()(const TInput1 &A, const TInput2 &B, const TInput3 &C) const
Definition: itkTernaryMagnitudeImageFilter.h:48
itk::SmartPointer< Self >
itk::Functor::Modulus3
Definition: itkTernaryMagnitudeImageFilter.h:33
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itk::TernaryGeneratorImageFilter
Implements pixel-wise generic operation of three images or images with constants.
Definition: itkTernaryGeneratorImageFilter.h:54
itk::TernaryGeneratorImageFilter::SetFunctor
void SetFunctor(const std::function< ConstRefFunctionType > &f)
Definition: itkTernaryGeneratorImageFilter.h:166
itk::TernaryMagnitudeImageFilter
Compute the pixel-wise magnitude of three images.
Definition: itkTernaryMagnitudeImageFilter.h:67
itk::Functor::Modulus3::ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(Modulus3)
itk::Functor::Modulus3::~Modulus3
~Modulus3()=default
itk::Functor::Modulus3::Modulus3
Modulus3()=default
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:138
itk::Functor::Modulus3::operator==
bool operator==(const Modulus3 &) const
Definition: itkTernaryMagnitudeImageFilter.h:39
itk::TernaryMagnitudeImageFilter::FunctorType
Functor::Modulus3< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TInputImage3::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkTernaryMagnitudeImageFilter.h:83
itk::TernaryMagnitudeImageFilter::~TernaryMagnitudeImageFilter
~TernaryMagnitudeImageFilter() override=default
itkTernaryGeneratorImageFilter.h