OTB  9.0.0
Orfeo Toolbox
otbComplexMomentsImageFunction.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 otbComplexMomentsImageFunction_h
22 #define otbComplexMomentsImageFunction_h
23 
24 #include "itkImageFunction.h"
25 
26 #include <complex>
27 
28 namespace otb
29 {
30 
55 template <class TInputImage, class TCoordRep = double>
56 class ITK_EXPORT ComplexMomentsImageFunction : public itk::ImageFunction<TInputImage, std::vector<std::vector<std::complex<double>>>, TCoordRep>
57 {
58 public:
61  typedef itk::ImageFunction<TInputImage, std::vector<std::vector<std::complex<double>>>, TCoordRep> Superclass;
62  typedef itk::SmartPointer<Self> Pointer;
63  typedef itk::SmartPointer<const Self> ConstPointer;
64 
66  itkTypeMacro(ComplexMomentsImageFunction, ImageFunction);
67 
69  itkNewMacro(Self);
70 
72  typedef TInputImage InputImageType;
73  typedef typename Superclass::IndexType IndexType;
74  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
75  typedef typename Superclass::PointType PointType;
76  typedef typename Superclass::OutputType OutputType;
77 
78  typedef double ScalarRealType;
79  typedef typename std::complex<ScalarRealType> ScalarComplexType;
80 
81  typedef TCoordRep CoordRepType;
82 
84  itkStaticConstMacro(ImageDimension, unsigned int, InputImageType::ImageDimension);
85 
87  OutputType EvaluateAtIndex(const IndexType& index) const override;
88 
90  OutputType Evaluate(const PointType& point) const override
91  {
92  IndexType index;
93  this->ConvertPointToNearestIndex(point, index);
94  return this->EvaluateAtIndex(index);
95  }
97  {
98  IndexType index;
99  this->ConvertContinuousIndexToNearestIndex(cindex, index);
100  return this->EvaluateAtIndex(index);
101  }
103 
107  itkSetMacro(NeighborhoodRadius, unsigned int);
108  itkGetConstReferenceMacro(NeighborhoodRadius, unsigned int);
110 
111  itkSetMacro(Pmax, unsigned int);
112  itkGetConstReferenceMacro(Pmax, unsigned int);
113  itkSetMacro(Qmax, unsigned int);
114  itkGetConstReferenceMacro(Qmax, unsigned int);
115 
116 protected:
119  {
120  }
121  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
122 
123 private:
124  ComplexMomentsImageFunction(const Self&) = delete;
125  void operator=(const Self&) = delete;
126 
127  unsigned int m_Pmax;
128  unsigned int m_Qmax;
129  unsigned int m_NeighborhoodRadius;
130 };
131 
132 } // namespace otb
133 
134 #ifndef OTB_MANUAL_INSTANTIATION
136 #endif
137 
138 #endif
otb::ComplexMomentsImageFunction::m_Qmax
unsigned int m_Qmax
Definition: otbComplexMomentsImageFunction.h:128
otb::ComplexMomentsImageFunction::InputImageType
TInputImage InputImageType
Definition: otbComplexMomentsImageFunction.h:69
otb::ComplexMomentsImageFunction::IndexType
Superclass::IndexType IndexType
Definition: otbComplexMomentsImageFunction.h:73
otb::ComplexMomentsImageFunction
Calculate the complex moment values in the specified neighborhood.
Definition: otbComplexMomentsImageFunction.h:56
otb::ComplexMomentsImageFunction::PointType
Superclass::PointType PointType
Definition: otbComplexMomentsImageFunction.h:75
otb::ComplexMomentsImageFunction::ScalarComplexType
std::complex< ScalarRealType > ScalarComplexType
Definition: otbComplexMomentsImageFunction.h:79
otb::ComplexMomentsImageFunction::ScalarRealType
double ScalarRealType
Definition: otbComplexMomentsImageFunction.h:78
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ComplexMomentsImageFunction::ContinuousIndexType
Superclass::ContinuousIndexType ContinuousIndexType
Definition: otbComplexMomentsImageFunction.h:74
otb::ComplexMomentsImageFunction::OutputType
Superclass::OutputType OutputType
Definition: otbComplexMomentsImageFunction.h:76
otbComplexMomentsImageFunction.hxx
otb::ComplexMomentsImageFunction::m_Pmax
unsigned int m_Pmax
Definition: otbComplexMomentsImageFunction.h:127
otb::ComplexMomentsImageFunction::Self
ComplexMomentsImageFunction Self
Definition: otbComplexMomentsImageFunction.h:60
otb::ComplexMomentsImageFunction::~ComplexMomentsImageFunction
~ComplexMomentsImageFunction() override
Definition: otbComplexMomentsImageFunction.h:118
otb::ComplexMomentsImageFunction::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbComplexMomentsImageFunction.h:63
otb::ComplexMomentsImageFunction::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbComplexMomentsImageFunction.h:62
otb::ComplexMomentsImageFunction::Superclass
itk::ImageFunction< TInputImage, std::vector< std::vector< std::complex< double > > >, TCoordRep > Superclass
Definition: otbComplexMomentsImageFunction.h:61
otb::ComplexMomentsImageFunction::CoordRepType
TCoordRep CoordRepType
Definition: otbComplexMomentsImageFunction.h:81
otb::ComplexMomentsImageFunction::EvaluateAtContinuousIndex
OutputType EvaluateAtContinuousIndex(const ContinuousIndexType &cindex) const override
Definition: otbComplexMomentsImageFunction.h:96
otb::ComplexMomentsImageFunction::Evaluate
OutputType Evaluate(const PointType &point) const override
Definition: otbComplexMomentsImageFunction.h:90
otb::ComplexMomentsImageFunction::m_NeighborhoodRadius
unsigned int m_NeighborhoodRadius
Definition: otbComplexMomentsImageFunction.h:129