OTB  9.0.0
Orfeo Toolbox
otbRealImageToComplexImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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:
102  RealImageToComplexImageFilter(const Self&) = delete;
103  void operator=(const Self&) = delete;
104 };
105 
106 } // end namespace otb
107 
108 #endif
otb::Function::RealToComplex::operator()
TOutput operator()(const TInputImageRealPart &real) const
Definition: otbRealImageToComplexImageFilter.h:62
otb::RealImageToComplexImageFilter::Superclass
itk::UnaryFunctorImageFilter< TInputImageRealPart, TOutputImage, Function::RealToComplex< typename TInputImageRealPart::PixelType, typename TOutputImage::PixelType > > Superclass
Definition: otbRealImageToComplexImageFilter.h:79
otb::Function::RealToComplex
Definition: otbRealImageToComplexImageFilter.h:43
otb::Function::RealToComplex::operator==
bool operator==(const RealToComplex &other) const
Definition: otbRealImageToComplexImageFilter.h:58
otb::RealImageToComplexImageFilter::RealImageToComplexImageFilter
RealImageToComplexImageFilter()
Definition: otbRealImageToComplexImageFilter.h:94
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::RealImageToComplexImageFilter::OutputPixelType
TOutputImage::PixelType OutputPixelType
Definition: otbRealImageToComplexImageFilter.h:90
otb::Function::RealToComplex::RealToComplex
RealToComplex()
Definition: otbRealImageToComplexImageFilter.h:48
otb::RealImageToComplexImageFilter::InputRealPartPixelType
TInputImageRealPart::PixelType InputRealPartPixelType
Definition: otbRealImageToComplexImageFilter.h:87
otb::RealImageToComplexImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbRealImageToComplexImageFilter.h:81
otb::RealImageToComplexImageFilter::OutputPixelValueType
itk::NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
Definition: otbRealImageToComplexImageFilter.h:91
otb::Function::RealToComplex::~RealToComplex
~RealToComplex()
Definition: otbRealImageToComplexImageFilter.h:51
otb::RealImageToComplexImageFilter::Self
RealImageToComplexImageFilter Self
Definition: otbRealImageToComplexImageFilter.h:76
otb::RealImageToComplexImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbRealImageToComplexImageFilter.h:80
otb::RealImageToComplexImageFilter::~RealImageToComplexImageFilter
~RealImageToComplexImageFilter() override
Definition: otbRealImageToComplexImageFilter.h:97
otb::Function::RealToComplex::operator!=
bool operator!=(const RealToComplex &) const
Definition: otbRealImageToComplexImageFilter.h:54
otb::RealImageToComplexImageFilter
Computes pixel-wise the complex image of a real image.
Definition: otbRealImageToComplexImageFilter.h:70
otb::Function::RealToComplex::OutputValueType
TOutput::value_type OutputValueType
Definition: otbRealImageToComplexImageFilter.h:46