OTB  6.7.0
Orfeo Toolbox
otbWrapperMetaDataHelper.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 otbWrapperMetaDataHelper_h
22 #define otbWrapperMetaDataHelper_h
23 
24 #include "otbMetaDataKey.h"
25 #include "otbImageKeywordlist.h"
27 #include "itkMetaDataDictionary.h"
28 #include "OTBApplicationEngineExport.h"
29 
30 namespace otb
31 {
32 namespace Wrapper
33 {
34 
44 namespace MetaDataHelper
45 {
46 
47  enum class MDType
48  {
49  String,
50  Int,
51  Double,
52  GCP,
53  Vector,
54  ImageKWL,
57  };
58 
59  OTBApplicationEngine_EXPORT MDType GetType(const std::string &val);
60 
61  OTBApplicationEngine_EXPORT std::string GetString(
62  const itk::MetaDataDictionary &dict,
63  const std::string &key);
64  OTBApplicationEngine_EXPORT void SetString(
66  const std::string &key,
67  const std::string &val);
68 
69  OTBApplicationEngine_EXPORT unsigned int GetInt(
70  const itk::MetaDataDictionary &dict,
71  const std::string &key);
72  OTBApplicationEngine_EXPORT void SetInt(
74  const std::string &key,
75  unsigned int val);
76 
77  OTBApplicationEngine_EXPORT double GetDouble(
78  const itk::MetaDataDictionary &dict,
79  const std::string &key);
80  OTBApplicationEngine_EXPORT void SetDouble(
82  const std::string &key,
83  double val);
84 
85  OTBApplicationEngine_EXPORT otb::OTB_GCP GetGCP(
86  const itk::MetaDataDictionary &dict,
87  const std::string &key);
88  OTBApplicationEngine_EXPORT void SetGCP(
90  const std::string &key,
91  const otb::OTB_GCP &val);
92 
93  OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(
94  const itk::MetaDataDictionary &dict,
95  const std::string &key);
96  OTBApplicationEngine_EXPORT void SetVector(
98  const std::string &key,
99  const otb::MetaDataKey::VectorType &val);
100 
101  OTBApplicationEngine_EXPORT otb::ImageKeywordlist GetImageKWL(
102  const itk::MetaDataDictionary &dict,
103  const std::string &key);
104  OTBApplicationEngine_EXPORT void SetImageKWL(
106  const std::string &key,
107  const otb::ImageKeywordlist &val);
108 
109  OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(
110  const itk::MetaDataDictionary &dict,
111  const std::string &key);
112  OTBApplicationEngine_EXPORT void SetVectorDataKWL(
114  const std::string &key,
115  const otb::VectorDataKeywordlist &val);
116 
117  OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(
118  const itk::MetaDataDictionary &dict,
119  const std::string &key);
120  OTBApplicationEngine_EXPORT void SetBoolVector(
122  const std::string &key,
124 
125 } // end of namespace MetaDataHelper
126 
127 } // end of namespace Wrapper
128 } // end of namespace otb
129 
130 #endif
OTBApplicationEngine_EXPORT void SetInt(itk::MetaDataDictionary &dict, const std::string &key, unsigned int val)
Storage and conversion for OSSIM metadata.
OTBApplicationEngine_EXPORT void SetImageKWL(itk::MetaDataDictionary &dict, const std::string &key, const otb::ImageKeywordlist &val)
OTBApplicationEngine_EXPORT unsigned int GetInt(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT double GetDouble(const itk::MetaDataDictionary &dict, const std::string &key)
std::vector< double > VectorType
This OTB_GCP class is used to manage the GCP parameters in OTB.
OTBApplicationEngine_EXPORT void SetGCP(itk::MetaDataDictionary &dict, const std::string &key, const otb::OTB_GCP &val)
OTBApplicationEngine_EXPORT void SetBoolVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::BoolVectorType &val)
OTBApplicationEngine_EXPORT void SetVectorDataKWL(itk::MetaDataDictionary &dict, const std::string &key, const otb::VectorDataKeywordlist &val)
OTBApplicationEngine_EXPORT otb::OTB_GCP GetGCP(const itk::MetaDataDictionary &dict, const std::string &key)
std::vector< bool > BoolVectorType
OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT void SetDouble(itk::MetaDataDictionary &dict, const std::string &key, double val)
OTBApplicationEngine_EXPORT std::string GetString(const itk::MetaDataDictionary &dict, const std::string &key)
this class handle the metadata of vector data.
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
OTBApplicationEngine_EXPORT void SetString(itk::MetaDataDictionary &dict, const std::string &key, const std::string &val)
OTBApplicationEngine_EXPORT otb::ImageKeywordlist GetImageKWL(const itk::MetaDataDictionary &dict, const std::string &key)
OTBApplicationEngine_EXPORT void SetVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::VectorType &val)
OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(const itk::MetaDataDictionary &dict, const std::string &key)