OTB  7.1.0
Orfeo Toolbox
otbImaginaryImageToComplexImageFilter.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 otbImaginaryImageToComplexImageFilter_h
22 #define otbImaginaryImageToComplexImageFilter_h
23 
24 #include "itkUnaryFunctorImageFilter.h"
25 #include "vnl/vnl_math.h"
26 
27 namespace otb
28 {
29 
39 namespace Function
40 {
41 
42 template <class TInputImageImaginaryPart, class TOutput>
44 {
45 public:
46  typedef typename TOutput::value_type OutputValueType;
47 
49  {
50  }
52  {
53  }
54  bool operator!=(const ImaginaryToComplex&) const
55  {
56  return false;
57  }
58  bool operator==(const ImaginaryToComplex& other) const
59  {
60  return !(*this != other);
61  }
62  inline TOutput operator()(const TInputImageImaginaryPart& imaginary) const
63  {
64  return TOutput(static_cast<OutputValueType>(0.0), static_cast<OutputValueType>(imaginary));
65  }
66 };
67 }
68 
69 template <class TInputImageImaginaryPart, class TOutputImage>
71  : public itk::UnaryFunctorImageFilter<TInputImageImaginaryPart, TOutputImage,
72  Function::ImaginaryToComplex<typename TInputImageImaginaryPart::PixelType, typename TOutputImage::PixelType>>
73 {
74 public:
77  typedef itk::UnaryFunctorImageFilter<TInputImageImaginaryPart, TOutputImage,
80  typedef itk::SmartPointer<Self> Pointer;
81  typedef itk::SmartPointer<const Self> ConstPointer;
82 
84  itkNewMacro(Self);
85 
87  itkTypeMacro(ImaginaryImageToComplexImageFilter, UnaryFunctorImageFilter);
88 
89  typedef typename TInputImageImaginaryPart::PixelType InputImaginaryPartPixelType;
90  typedef typename TOutputImage::PixelType OutputPixelType;
91  typedef typename itk::NumericTraits<OutputPixelType>::ValueType OutputPixelValueType;
92 
93 protected:
95  {
96  }
98  {
99  }
100 
101 private:
102  ImaginaryImageToComplexImageFilter(const Self&) = delete;
103  void operator=(const Self&) = delete;
104 };
105 
106 } // end namespace otb
107 
108 #endif
itk::NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
Computes pixel-wise the complex image of a imaginary image.
bool operator!=(const ImaginaryToComplex &) const
bool operator==(const ImaginaryToComplex &other) const
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::UnaryFunctorImageFilter< TInputImageImaginaryPart, TOutputImage, Function::ImaginaryToComplex< typename TInputImageImaginaryPart::PixelType, typename TOutputImage::PixelType > > Superclass
TInputImageImaginaryPart::PixelType InputImaginaryPartPixelType
TOutput operator()(const TInputImageImaginaryPart &imaginary) const