ITK  5.2.0
Insight Toolkit
itkTernaryMagnitudeSquaredImageFilter.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 itkTernaryMagnitudeSquaredImageFilter_h
19 #define itkTernaryMagnitudeSquaredImageFilter_h
20 
22 
23 namespace itk
24 {
25 namespace Functor
26 {
32 template <typename TInput1, typename TInput2, typename TInput3, typename TOutput>
34 {
35 public:
36  ModulusSquare3() = default;
37  ~ModulusSquare3() = default;
38  bool
39  operator!=(const ModulusSquare3 &) const
40  {
41  return false;
42  }
44 
45  bool
46  operator==(const ModulusSquare3 & other) const
47  {
48  return !(*this != other);
49  }
50 
51  inline TOutput
52  operator()(const TInput1 & A, const TInput2 & B, const TInput3 & C) const
53  {
54  return static_cast<TOutput>(A * A + B * B + C * C);
55  }
56 };
57 } // namespace Functor
58 
70 template <typename TInputImage1, typename TInputImage2, typename TInputImage3, typename TOutputImage>
72  : public TernaryGeneratorImageFilter<TInputImage1, TInputImage2, TInputImage3, TOutputImage>
73 {
74 public:
75  ITK_DISALLOW_COPY_AND_MOVE(TernaryMagnitudeSquaredImageFilter);
76 
80 
83 
84  using FunctorType = Functor::ModulusSquare3<typename TInputImage1::PixelType,
85  typename TInputImage2::PixelType,
86  typename TInputImage3::PixelType,
87  typename TOutputImage::PixelType>;
88 
90  itkNewMacro(Self);
91 
94 
95 protected:
97  {
98 #if !defined(ITK_WRAPPING_PARSER)
100 #endif
101  }
102  ~TernaryMagnitudeSquaredImageFilter() override = default;
103 };
104 } // end namespace itk
105 
106 #endif
itk::Functor::ModulusSquare3
Definition: itkTernaryMagnitudeSquaredImageFilter.h:33
itk::TernaryMagnitudeSquaredImageFilter::~TernaryMagnitudeSquaredImageFilter
~TernaryMagnitudeSquaredImageFilter() override=default
itk::Functor::ModulusSquare3::operator()
TOutput operator()(const TInput1 &A, const TInput2 &B, const TInput3 &C) const
Definition: itkTernaryMagnitudeSquaredImageFilter.h:52
itk::Functor::ModulusSquare3::operator==
bool operator==(const ModulusSquare3 &other) const
Definition: itkTernaryMagnitudeSquaredImageFilter.h:46
itk::SmartPointer< Self >
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::TernaryMagnitudeSquaredImageFilter::FunctorType
Functor::ModulusSquare3< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TInputImage3::PixelType, typename TOutputImage::PixelType > FunctorType
Definition: itkTernaryMagnitudeSquaredImageFilter.h:87
itk::Functor::ModulusSquare3::ModulusSquare3
ModulusSquare3()=default
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::TernaryMagnitudeSquaredImageFilter::TernaryMagnitudeSquaredImageFilter
TernaryMagnitudeSquaredImageFilter()
Definition: itkTernaryMagnitudeSquaredImageFilter.h:96
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:138
itk::Functor::ModulusSquare3::operator!=
bool operator!=(const ModulusSquare3 &) const
Definition: itkTernaryMagnitudeSquaredImageFilter.h:39
itk::Functor::ModulusSquare3::~ModulusSquare3
~ModulusSquare3()=default
itk::TernaryMagnitudeSquaredImageFilter
Compute the pixel-wise squared magnitude of three images.
Definition: itkTernaryMagnitudeSquaredImageFilter.h:71
itkTernaryGeneratorImageFilter.h