OTB  9.0.0
Orfeo Toolbox
otbSarCalibrationLookupData.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 SarCalibrationLookupData_H
22 #define SarCalibrationLookupData_H
23 
24 #include "OTBMetadataExport.h"
25 #include "otbMetaDataKey.h"
26 
27 #include <itkLightObject.h>
28 #include <itkNumericTraits.h>
29 #include <itkObjectFactory.h>
30 
31 #include <boost/lexical_cast.hpp>
32 
33 #include <string>
34 
35 namespace otb
36 {
37 
38 class OTBMetadata_EXPORT SarCalibrationLookupData : public itk::LightObject
39 {
40 
41 public:
44  typedef itk::LightObject Superclass;
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(SarCalibrationLookupData, itk::LightObject);
53 
54  typedef itk::IndexValueType IndexValueType;
55 
56  enum
57  {
58  SIGMA = 0,
61  DN,
62  NOISE
63  };
64 
66  {
67  }
68 
69  ~SarCalibrationLookupData() override = default;
70 
71  virtual double GetValue(const IndexValueType itkNotUsed(x), const IndexValueType itkNotUsed(y)) const
72  {
73  return 1.0;
74  }
75 
76  void SetType(short t)
77  {
78  m_Type = t;
79  }
80 
81  itkGetMacro(Type, short);
82 
83  void PrintSelf(std::ostream& os, itk::Indent indent) const override
84  {
85  os << indent << " lookup table type:'" << m_Type << "'" << std::endl;
86  Superclass::PrintSelf(os, indent);
87  }
88 
90  virtual void ToKeywordlist(MetaData::Keywordlist & kwl, const std::string & prefix) const
91  {
92  kwl.insert({prefix + "Sensor", "Default"});
93  kwl.insert({prefix + "Type",
94  boost::lexical_cast<std::string>(m_Type)});
95  }
97 
99  virtual void FromKeywordlist(const MetaData::Keywordlist & kwl, const std::string & prefix)
100  {
101  m_Type = boost::lexical_cast<short>(kwl.at(prefix + "Type"));
102  }
103 
104 private:
105  SarCalibrationLookupData(const Self&) = delete;
106  void operator=(const Self&) = delete;
107  short m_Type;
108 };
109 }
110 #endif
otb::SarCalibrationLookupData::PrintSelf
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Definition: otbSarCalibrationLookupData.h:83
otb::SarCalibrationLookupData::DN
@ DN
Definition: otbSarCalibrationLookupData.h:61
otb::SarCalibrationLookupData::Self
SarCalibrationLookupData Self
Definition: otbSarCalibrationLookupData.h:43
otb::SarCalibrationLookupData::BETA
@ BETA
Definition: otbSarCalibrationLookupData.h:59
otb::SarCalibrationLookupData::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSarCalibrationLookupData.h:45
otb::SarCalibrationLookupData
Definition: otbSarCalibrationLookupData.h:38
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SarCalibrationLookupData::IndexValueType
itk::IndexValueType IndexValueType
Definition: otbSarCalibrationLookupData.h:52
otb::SarCalibrationLookupData::FromKeywordlist
virtual void FromKeywordlist(const MetaData::Keywordlist &kwl, const std::string &prefix)
Definition: otbSarCalibrationLookupData.h:99
otb::SarCalibrationLookupData::GetValue
virtual double GetValue(const IndexValueType, const IndexValueType) const
Definition: otbSarCalibrationLookupData.h:71
otb::SarCalibrationLookupData::SarCalibrationLookupData
SarCalibrationLookupData()
Definition: otbSarCalibrationLookupData.h:65
otbMetaDataKey.h
otb::SarCalibrationLookupData::GAMMA
@ GAMMA
Definition: otbSarCalibrationLookupData.h:60
otb::MetaData::Keywordlist
std::unordered_map< std::string, std::string > Keywordlist
Definition: otbMetaDataKey.h:233
otb::SarCalibrationLookupData::ToKeywordlist
virtual void ToKeywordlist(MetaData::Keywordlist &kwl, const std::string &prefix) const
Definition: otbSarCalibrationLookupData.h:90
otb::SarCalibrationLookupData::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSarCalibrationLookupData.h:46
otb::SarCalibrationLookupData::Superclass
itk::LightObject Superclass
Definition: otbSarCalibrationLookupData.h:44
otb::SarCalibrationLookupData::m_Type
short m_Type
Definition: otbSarCalibrationLookupData.h:107
otb::SarCalibrationLookupData::SetType
void SetType(short t)
Definition: otbSarCalibrationLookupData.h:76