ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkTernaryMagnitudeSquaredImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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:
38  bool operator!=(const ModulusSquare3 &) const
39  {
40  return false;
41  }
43 
44  bool operator==(const ModulusSquare3 & other) const
45  {
46  return !( *this != other );
47  }
48 
49  inline TOutput operator()(const TInput1 & A,
50  const TInput2 & B,
51  const TInput3 & C) const
52  { return (TOutput)( A * A + B * B + C * C ); }
53 };
54 }
65 template< typename TInputImage1, typename TInputImage2,
66  typename TInputImage3, typename TOutputImage >
68  public
69  TernaryFunctorImageFilter< TInputImage1, TInputImage2,
70  TInputImage3, TOutputImage,
71  Functor::ModulusSquare3<
72  typename TInputImage1::PixelType,
73  typename TInputImage2::PixelType,
74  typename TInputImage3::PixelType,
75  typename TOutputImage::PixelType > >
76 {
77 public:
81  TInputImage1, TInputImage2,
82  TInputImage3, TOutputImage,
84  typename TInputImage1::PixelType,
85  typename TInputImage2::PixelType,
86  typename TInputImage3::PixelType,
87  typename TOutputImage::PixelType > > Superclass;
88 
91 
93  itkNewMacro(Self);
94 
98 
99 protected:
102 
103 private:
104  TernaryMagnitudeSquaredImageFilter(const Self &); //purposely not implemented
105  void operator=(const Self &); //purposely not implemented
106 };
107 } // end namespace itk
108 
109 #endif
Implements pixel-wise generic operation of three images.
Base class for all process objects that output image data.
TOutput operator()(const TInput1 &A, const TInput2 &B, const TInput3 &C) const
bool operator!=(const ModulusSquare3 &) const
TernaryFunctorImageFilter< TInputImage1, TInputImage2, TInputImage3, TOutputImage, Functor::ModulusSquare3< typename TInputImage1::PixelType, typename TInputImage2::PixelType, typename TInputImage3::PixelType, typename TOutputImage::PixelType > > Superclass
bool operator==(const ModulusSquare3 &other) const