OTB  6.7.0
Orfeo Toolbox
otbComplexToIntensityImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbComplexToIntensityImageFilter_h
22 #define otbComplexToIntensityImageFilter_h
23 
25 #include "vnl/vnl_math.h"
26 
27 namespace otb
28 {
29 
39 namespace Function {
40 
41 template< class TInput, class TOutput>
43 {
44 public:
47  bool operator!=( const ComplexToIntensity & ) const
48  {
49  return false;
50  }
51  bool operator==( const ComplexToIntensity & other ) const
52  {
53  return !(*this != other);
54  }
55  inline TOutput operator()( const TInput & A ) const
56  {
57  return static_cast<TOutput>( A.real()*A.real() + A.imag()*A.imag() );
58  }
59 };
60 }
61 
62 template <class TInputImage, class TOutputImage>
64  public
65 itk::UnaryFunctorImageFilter<TInputImage, TOutputImage,
66  Function::ComplexToIntensity<
67  typename TInputImage::PixelType,
68  typename TOutputImage::PixelType> >
69 {
70 public:
74  TInputImage, TOutputImage,
75  Function::ComplexToIntensity< typename TInputImage::PixelType,
76  typename TOutputImage::PixelType> >
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(ComplexToIntensityImageFilter,
86  UnaryFunctorImageFilter);
87 
88  typedef typename TInputImage::PixelType InputPixelType;
89  typedef typename TOutputImage::PixelType OutputPixelType;
91 
92 #ifdef ITK_USE_CONCEPT_CHECKING
93 
94  itkConceptMacro(InputConvertibleToOutputCheck,
96 
98 #endif
99 
100 
101 protected:
104 
105 private:
106  ComplexToIntensityImageFilter(const Self&) = delete;
107  void operator=(const Self&) = delete;
108 
109 };
110 
111 } // end namespace otb
112 
113 #endif
Computes pixel-wise the intensity of a complex image.
bool operator==(const ComplexToIntensity &other) const
itk::NumericTraits< InputPixelType >::ValueType InputPixelValueType
itk::UnaryFunctorImageFilter< TInputImage, TOutputImage, Function::ComplexToIntensity< typename TInputImage::PixelType, typename TOutputImage::PixelType > > Superclass
#define itkConceptMacro(name, concept)
bool operator!=(const ComplexToIntensity &) const