OTB  9.0.0
Orfeo Toolbox
otbWrapperMetaDataHelper.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 otbWrapperMetaDataHelper_h
22 #define otbWrapperMetaDataHelper_h
23 
24 #include "otbMetaDataKey.h"
26 #include "otbGeometryMetadata.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(const itk::MetaDataDictionary& dict, const std::string& key);
62 OTBApplicationEngine_EXPORT void SetString(itk::MetaDataDictionary& dict, const std::string& key, const std::string& val);
63 
64 OTBApplicationEngine_EXPORT unsigned int GetInt(const itk::MetaDataDictionary& dict, const std::string& key);
65 OTBApplicationEngine_EXPORT void SetInt(itk::MetaDataDictionary& dict, const std::string& key, unsigned int val);
66 
67 OTBApplicationEngine_EXPORT double GetDouble(const itk::MetaDataDictionary& dict, const std::string& key);
68 OTBApplicationEngine_EXPORT void SetDouble(itk::MetaDataDictionary& dict, const std::string& key, double val);
69 
70 OTBApplicationEngine_EXPORT otb::GCP GetGCP(const itk::MetaDataDictionary& dict, const std::string& key);
71 OTBApplicationEngine_EXPORT void SetGCP(itk::MetaDataDictionary& dict, const std::string& key, const otb::GCP& val);
72 
73 OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(const itk::MetaDataDictionary& dict, const std::string& key);
74 OTBApplicationEngine_EXPORT void SetVector(itk::MetaDataDictionary& dict, const std::string& key, const otb::MetaDataKey::VectorType& val);
75 
76 OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(const itk::MetaDataDictionary& dict, const std::string& key);
77 OTBApplicationEngine_EXPORT void SetVectorDataKWL(itk::MetaDataDictionary& dict, const std::string& key, const otb::VectorDataKeywordlist& val);
78 
79 OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(const itk::MetaDataDictionary& dict, const std::string& key);
80 OTBApplicationEngine_EXPORT void SetBoolVector(itk::MetaDataDictionary& dict, const std::string& key, const otb::MetaDataKey::BoolVectorType& val);
81 
82 } // end of namespace MetaDataHelper
83 
84 } // end of namespace Wrapper
85 } // end of namespace otb
86 
87 #endif
otb::Wrapper::MetaDataHelper::GetGCP
OTBApplicationEngine_EXPORT otb::GCP GetGCP(const itk::MetaDataDictionary &dict, const std::string &key)
MetaDataHelper
Contains small helper functions to manipulate itk::MetaDataDictionary.
otb::Wrapper::MetaDataHelper::MDType::GCP
@ GCP
otb::Wrapper::MetaDataHelper::MDType::Vector
@ Vector
otb::Wrapper::MetaDataHelper::GetDouble
OTBApplicationEngine_EXPORT double GetDouble(const itk::MetaDataDictionary &dict, const std::string &key)
otb::MetaDataKey::BoolVectorType
std::vector< bool > BoolVectorType
Definition: otbMetaDataKey.h:120
otb::Wrapper::MetaDataHelper::SetInt
OTBApplicationEngine_EXPORT void SetInt(itk::MetaDataDictionary &dict, const std::string &key, unsigned int val)
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::MetaDataKey::VectorType
std::vector< double > VectorType
Definition: otbMetaDataKey.h:119
otb::Wrapper::MetaDataHelper::GetVectorDataKWL
OTBApplicationEngine_EXPORT otb::VectorDataKeywordlist GetVectorDataKWL(const itk::MetaDataDictionary &dict, const std::string &key)
otb::Wrapper::MetaDataHelper::MDType::String
@ String
otb::Wrapper::MetaDataHelper::SetGCP
OTBApplicationEngine_EXPORT void SetGCP(itk::MetaDataDictionary &dict, const std::string &key, const otb::GCP &val)
otb::Wrapper::MetaDataHelper::SetVector
OTBApplicationEngine_EXPORT void SetVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::VectorType &val)
otb::Wrapper::MetaDataHelper::GetString
OTBApplicationEngine_EXPORT std::string GetString(const itk::MetaDataDictionary &dict, const std::string &key)
otbGeometryMetadata.h
otb::Wrapper::MetaDataHelper::SetBoolVector
OTBApplicationEngine_EXPORT void SetBoolVector(itk::MetaDataDictionary &dict, const std::string &key, const otb::MetaDataKey::BoolVectorType &val)
otb::Wrapper::MetaDataHelper::GetInt
OTBApplicationEngine_EXPORT unsigned int GetInt(const itk::MetaDataDictionary &dict, const std::string &key)
otb::Wrapper::MetaDataHelper::GetBoolVector
OTBApplicationEngine_EXPORT otb::MetaDataKey::BoolVectorType GetBoolVector(const itk::MetaDataDictionary &dict, const std::string &key)
otb::Wrapper::MetaDataHelper::MDType::ImageKWL
@ ImageKWL
otb::Wrapper::MetaDataHelper::MDType::VectorDataKWL
@ VectorDataKWL
otbMetaDataKey.h
otbVectorDataKeywordlist.h
otb::Wrapper::MetaDataHelper::MDType::Double
@ Double
otb::Wrapper::MetaDataHelper::SetVectorDataKWL
OTBApplicationEngine_EXPORT void SetVectorDataKWL(itk::MetaDataDictionary &dict, const std::string &key, const otb::VectorDataKeywordlist &val)
otb::Wrapper::MetaDataHelper::SetDouble
OTBApplicationEngine_EXPORT void SetDouble(itk::MetaDataDictionary &dict, const std::string &key, double val)
otb::Wrapper::MetaDataHelper::GetVector
OTBApplicationEngine_EXPORT otb::MetaDataKey::VectorType GetVector(const itk::MetaDataDictionary &dict, const std::string &key)
otb::Wrapper::MetaDataHelper::MDType::Int
@ Int
otb::Wrapper::MetaDataHelper::GetType
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
otb::Wrapper::MetaDataHelper::MDType::BoolVector
@ BoolVector
otb::Wrapper::MetaDataHelper::MDType
MDType
Definition: otbWrapperMetaDataHelper.h:47
otb::VectorDataKeywordlist
this class handle the metadata of vector data.
Definition: otbVectorDataKeywordlist.h:57
otb::Wrapper::MetaDataHelper::SetString
OTBApplicationEngine_EXPORT void SetString(itk::MetaDataDictionary &dict, const std::string &key, const std::string &val)
otb::GCP
This GCP class is used to manage the GCP parameters in OTB.
Definition: otbGeometryMetadata.h:43