OTB  6.7.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 
25 #include "vnl/vnl_math.h"
26 
27 namespace otb
28 {
29 
39 namespace Function {
40 
41 template< class TInputImageImaginaryPart, class TOutput>
43 {
44 public:
45  typedef typename TOutput::value_type OutputValueType;
46 
49  bool operator!=( const ImaginaryToComplex & ) const
50  {
51  return false;
52  }
53  bool operator==( const ImaginaryToComplex & other ) const
54  {
55  return !(*this != other);
56  }
57  inline TOutput operator()( const TInputImageImaginaryPart & imaginary) const
58  {
59  return TOutput(static_cast<OutputValueType>(0.0), static_cast<OutputValueType>(imaginary));
60  }
61 };
62 }
63 
64 template <class TInputImageImaginaryPart, class TOutputImage>
66  public itk::UnaryFunctorImageFilter<TInputImageImaginaryPart, TOutputImage,
67  Function::ImaginaryToComplex<
68  typename TInputImageImaginaryPart::PixelType,
69  typename TOutputImage::PixelType> >
70 {
71 public:
75  TInputImageImaginaryPart, TOutputImage,
76  Function::ImaginaryToComplex< typename TInputImageImaginaryPart::PixelType,
77  typename TOutputImage::PixelType> >
81 
83  itkNewMacro(Self);
84 
87  UnaryFunctorImageFilter);
88 
89  typedef typename TInputImageImaginaryPart::PixelType InputImaginaryPartPixelType;
90  typedef typename TOutputImage::PixelType OutputPixelType;
92 
93 protected:
96 
97 private:
98  ImaginaryImageToComplexImageFilter(const Self&) = delete;
99  void operator=(const Self&) = delete;
100 
101 };
102 
103 } // end namespace otb
104 
105 #endif
Computes pixel-wise the complex image of a imaginary image.
bool operator!=(const ImaginaryToComplex &) const
itk::NumericTraits< OutputPixelType >::ValueType OutputPixelValueType
bool operator==(const ImaginaryToComplex &other) const
itk::UnaryFunctorImageFilter< TInputImageImaginaryPart, TOutputImage, Function::ImaginaryToComplex< typename TInputImageImaginaryPart::PixelType, typename TOutputImage::PixelType > > Superclass
TInputImageImaginaryPart::PixelType InputImaginaryPartPixelType
TOutput operator()(const TInputImageImaginaryPart &imaginary) const