OTB  9.0.0
Orfeo Toolbox
otbImaginaryImageToComplexImageFilter.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 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
otb::Function::ImaginaryToComplex::OutputValueType
TOutput::value_type OutputValueType
Definition: otbImaginaryImageToComplexImageFilter.h:46
otb::ImaginaryImageToComplexImageFilter::ImaginaryImageToComplexImageFilter
ImaginaryImageToComplexImageFilter()
Definition: otbImaginaryImageToComplexImageFilter.h:94
otb::ImaginaryImageToComplexImageFilter::OutputPixelValueType
itk::NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
Definition: otbImaginaryImageToComplexImageFilter.h:91
otb::Function::ImaginaryToComplex::operator==
bool operator==(const ImaginaryToComplex &other) const
Definition: otbImaginaryImageToComplexImageFilter.h:58
otb::Function::ImaginaryToComplex
Definition: otbImaginaryImageToComplexImageFilter.h:43
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImaginaryImageToComplexImageFilter::~ImaginaryImageToComplexImageFilter
~ImaginaryImageToComplexImageFilter() override
Definition: otbImaginaryImageToComplexImageFilter.h:97
otb::ImaginaryImageToComplexImageFilter
Computes pixel-wise the complex image of a imaginary image.
Definition: otbImaginaryImageToComplexImageFilter.h:70
otb::ImaginaryImageToComplexImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImaginaryImageToComplexImageFilter.h:80
otb::Function::ImaginaryToComplex::~ImaginaryToComplex
~ImaginaryToComplex()
Definition: otbImaginaryImageToComplexImageFilter.h:51
otb::ImaginaryImageToComplexImageFilter::Superclass
itk::UnaryFunctorImageFilter< TInputImageImaginaryPart, TOutputImage, Function::ImaginaryToComplex< typename TInputImageImaginaryPart::PixelType, typename TOutputImage::PixelType > > Superclass
Definition: otbImaginaryImageToComplexImageFilter.h:79
otb::ImaginaryImageToComplexImageFilter::Self
ImaginaryImageToComplexImageFilter Self
Definition: otbImaginaryImageToComplexImageFilter.h:76
otb::ImaginaryImageToComplexImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImaginaryImageToComplexImageFilter.h:81
otb::Function::ImaginaryToComplex::operator()
TOutput operator()(const TInputImageImaginaryPart &imaginary) const
Definition: otbImaginaryImageToComplexImageFilter.h:62
otb::ImaginaryImageToComplexImageFilter::InputImaginaryPartPixelType
TInputImageImaginaryPart::PixelType InputImaginaryPartPixelType
Definition: otbImaginaryImageToComplexImageFilter.h:87
otb::Function::ImaginaryToComplex::ImaginaryToComplex
ImaginaryToComplex()
Definition: otbImaginaryImageToComplexImageFilter.h:48
otb::ImaginaryImageToComplexImageFilter::OutputPixelType
TOutputImage::PixelType OutputPixelType
Definition: otbImaginaryImageToComplexImageFilter.h:90
otb::Function::ImaginaryToComplex::operator!=
bool operator!=(const ImaginaryToComplex &) const
Definition: otbImaginaryImageToComplexImageFilter.h:54