OTB  10.0.0
Orfeo Toolbox
otbSamplingRateCalculatorList.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbSamplingRateCalculatorList_h
22 #define otbSamplingRateCalculatorList_h
23 
25 #include "otbObjectList.h"
26 #include "OTBSamplingExport.h"
27 
28 namespace otb
29 {
41 class OTBSampling_EXPORT SamplingRateCalculatorList : public ObjectList<SamplingRateCalculator>
42 {
43 public:
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
52 
54  {
57  CUSTOM
58  };
59 
61  itkNewMacro(Self);
62 
65 
67  void SetNthClassCount(unsigned int index, const ClassCountMapType& map);
68 
70  const MapRateType& GetRatesByClass(unsigned int index);
71 
73  void ClearRates(void);
74 
77 
81 
83  void SetNbOfSamplesAllClasses(std::vector<unsigned long>& nb, PartitionType t);
84 
86  void SetNbOfSamplesByClass(const std::vector<ClassCountMapType>& required, PartitionType t);
87 
90  void SetPercentageOfSamples(std::vector<double>& p, PartitionType t);
91 
94  void SetTotalNumberOfSamples(std::vector<unsigned long>& tot, PartitionType t);
95 
96 protected:
99  {
100  }
101 
104  {
105  }
106 
107 private:
109  void operator=(const Self&) = delete;
110 
112 
114 };
115 } // end namespace otb
116 
117 #endif
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:41
This class is a list of sampling rate calculators.
void SetAllSamples(PartitionType t)
ObjectList< SamplingRateCalculator > Superclass
void SetPercentageOfSamples(std::vector< double > &p, PartitionType t)
void SetNbOfSamplesAllClasses(std::vector< unsigned long > &nb, PartitionType t)
void SetNthClassCount(unsigned int index, const ClassCountMapType &map)
void SetMinimumNbOfSamplesByClass(PartitionType t)
void operator=(const Self &)=delete
SamplingRateCalculator::ClassCountMapType ClassCountMapType
SamplingRateCalculator::MapRateType MapRateType
SamplingRateCalculatorList(const Self &)=delete
void SetTotalNumberOfSamples(std::vector< unsigned long > &tot, PartitionType t)
void SetNbOfSamplesByClass(const std::vector< ClassCountMapType > &required, PartitionType t)
itk::SmartPointer< const Self > ConstPointer
const MapRateType & GetRatesByClass(unsigned int index)
std::map< std::string, unsigned long > ClassCountMapType
std::map< std::string, TripletType > MapRateType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.