OTB  10.0.0
Orfeo Toolbox
otbRealImageToComplexImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbRealImageToComplexImageFilter_h
22 #define otbRealImageToComplexImageFilter_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 TInputImageRealPart, class TOutput>
44 {
45 public:
46  typedef typename TOutput::value_type OutputValueType;
47 
49  {
50  }
52  {
53  }
54  bool operator!=(const RealToComplex&) const
55  {
56  return false;
57  }
58  bool operator==(const RealToComplex& other) const
59  {
60  return !(*this != other);
61  }
62  inline TOutput operator()(const TInputImageRealPart& real) const
63  {
64  return TOutput(static_cast<OutputValueType>(real), static_cast<OutputValueType>(0.0));
65  }
66 };
67 }
68 
69 template <class TInputImageRealPart, class TOutputImage>
71  : public itk::UnaryFunctorImageFilter<TInputImageRealPart, TOutputImage,
72  Function::RealToComplex<typename TInputImageRealPart::PixelType, typename TOutputImage::PixelType>>
73 {
74 public:
77  typedef itk::UnaryFunctorImageFilter<TInputImageRealPart, TOutputImage,
80  typedef itk::SmartPointer<Self> Pointer;
81  typedef itk::SmartPointer<const Self> ConstPointer;
82 
84  itkNewMacro(Self);
85 
87  itkTypeMacro(RealImageToComplexImageFilter, UnaryFunctorImageFilter);
88 
89  typedef typename TInputImageRealPart::PixelType InputRealPartPixelType;
90  typedef typename TOutputImage::PixelType OutputPixelType;
91  typedef typename itk::NumericTraits<OutputPixelType>::ValueType OutputPixelValueType;
92 
93 protected:
95  {
96  }
98  {
99  }
100 
101 private:
103  void operator=(const Self&) = delete;
104 };
105 
106 } // end namespace otb
107 
108 #endif
bool operator==(const RealToComplex &other) const
bool operator!=(const RealToComplex &) const
TOutput operator()(const TInputImageRealPart &real) const
Computes pixel-wise the complex image of a real image.
TInputImageRealPart::PixelType InputRealPartPixelType
itk::NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
itk::UnaryFunctorImageFilter< TInputImageRealPart, TOutputImage, Function::RealToComplex< typename TInputImageRealPart::PixelType, typename TOutputImage::PixelType > > Superclass
void operator=(const Self &)=delete
RealImageToComplexImageFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.