ITK  5.4.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 * 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 itkTernaryMagnitudeSquaredImageFilter_h
19#define itkTernaryMagnitudeSquaredImageFilter_h
20
22
23namespace itk
24{
25namespace Functor
26{
32template <typename TInput1, typename TInput2, typename TInput3, typename TOutput>
34{
35public:
36 bool
38 {
39 return true;
40 }
41
43
44 inline TOutput
45 operator()(const TInput1 & A, const TInput2 & B, const TInput3 & C) const
46 {
47 return static_cast<TOutput>(A * A + B * B + C * C);
48 }
49};
50} // namespace Functor
51
63template <typename TInputImage1, typename TInputImage2, typename TInputImage3, typename TOutputImage>
65 : public TernaryGeneratorImageFilter<TInputImage1, TInputImage2, TInputImage3, TOutputImage>
66{
67public:
68 ITK_DISALLOW_COPY_AND_MOVE(TernaryMagnitudeSquaredImageFilter);
69
73
76
77 using FunctorType = Functor::ModulusSquare3<typename TInputImage1::PixelType,
78 typename TInputImage2::PixelType,
79 typename TInputImage3::PixelType,
80 typename TOutputImage::PixelType>;
81
83 itkNewMacro(Self);
84
86 itkOverrideGetNameOfClassMacro(TernaryMagnitudeSquaredImageFilter);
87
88protected:
90 {
91#if !defined(ITK_WRAPPING_PARSER)
93#endif
94 }
96};
97} // end namespace itk
98
99#endif
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ModulusSquare3)
bool operator==(const ModulusSquare3 &) const
TOutput operator()(const TInput1 &A, const TInput2 &B, const TInput3 &C) const
Base class for all process objects that output image data.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Implements pixel-wise generic operation of three images or images with constants.
void SetFunctor(const std::function< ConstRefFunctionType > &f)
Compute the pixel-wise squared magnitude of three images.
Functor::ModulusSquare3< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TInputImage3::PixelType, typename TOutputImage::PixelType > FunctorType
~TernaryMagnitudeSquaredImageFilter() override=default
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....