OTB  9.0.0
Orfeo Toolbox
otbMachineLearningModelTraits.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 
22 #ifndef otbMachineLearningModelTraits_h
23 #define otbMachineLearningModelTraits_h
24 
25 
26 #include "itkVariableLengthVector.h"
27 #include "itkFixedArray.h"
28 #include "itkIsNumber.h"
29 #include "itkMetaProgrammingLibrary.h"
30 
31 namespace otb
32 {
33 
45 template <typename TInput, typename isNumber>
47 
48 
50 // For Numbers
51 template <typename TInput>
52 struct MLMSampleTraitsImpl<TInput, itk::mpl::TrueType>
53 {
54  typedef TInput ValueType;
55  typedef itk::VariableLengthVector<TInput> SampleType;
56 };
57 
58 // For Vectors
59 template <typename TInput>
60 struct MLMSampleTraitsImpl<TInput, itk::mpl::FalseType>
61 {
62  typedef typename TInput::ValueType ValueType;
63  typedef TInput SampleType;
64 };
66 
70 template <typename TInput>
72 
73 
85 template <typename TInput, typename isNumber>
87 
88 
90 // For Numbers
91 template <typename TInput>
92 struct MLMTargetTraitsImpl<TInput, itk::mpl::TrueType>
93 {
94  typedef TInput ValueType;
95  typedef itk::FixedArray<TInput, 1> SampleType;
96 };
97 
98 // For Vectors
99 template <typename TInput>
100 struct MLMTargetTraitsImpl<TInput, itk::mpl::FalseType>
101 {
102  typedef typename TInput::ValueType ValueType;
103  typedef TInput SampleType;
104 };
106 
110 template <typename TInput>
112 
113 
114 } // End namespace otb
115 
116 #endif
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::sampleAugmentation::SampleType
std::vector< double > SampleType
Definition: otbSampleAugmentation.h:41
otb::MLMSampleTraitsImpl
Definition: otbMachineLearningModelTraits.h:46
itk
Definition: otbNoDataHelper.h:31
otb::MLMTargetTraitsImpl
Definition: otbMachineLearningModelTraits.h:86