OTB  9.0.0
Orfeo Toolbox
otbSamplingRateCalculatorList.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 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 
76  void SetAllSamples(PartitionType t);
77 
80  void SetMinimumNbOfSamplesByClass(PartitionType t);
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:
108  SamplingRateCalculatorList(const Self&) = delete;
109  void operator=(const Self&) = delete;
110 
111  void UpdateGlobalCounts();
112 
114 };
115 } // end namespace otb
116 
117 #endif
otb::SamplingRateCalculatorList::Superclass
ObjectList< SamplingRateCalculator > Superclass
Definition: otbSamplingRateCalculatorList.h:46
otb::SamplingRateCalculatorList::PROPORTIONAL
@ PROPORTIONAL
Definition: otbSamplingRateCalculatorList.h:55
otb::SamplingRateCalculatorList::MapRateType
SamplingRateCalculator::MapRateType MapRateType
Definition: otbSamplingRateCalculatorList.h:51
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::SamplingRateCalculatorList::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbSamplingRateCalculatorList.h:48
otb::SamplingRateCalculatorList::m_GlobalCountMap
ClassCountMapType m_GlobalCountMap
Definition: otbSamplingRateCalculatorList.h:113
otb::SamplingRateCalculatorList::SamplingRateCalculatorList
SamplingRateCalculatorList()
Definition: otbSamplingRateCalculatorList.h:98
otb::SamplingRateCalculatorList::PartitionType
PartitionType
Definition: otbSamplingRateCalculatorList.h:53
otb::SamplingRateCalculatorList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSamplingRateCalculatorList.h:47
otb::SamplingRateCalculatorList::ClassCountMapType
SamplingRateCalculator::ClassCountMapType ClassCountMapType
Definition: otbSamplingRateCalculatorList.h:50
otb::SamplingRateCalculatorList::Self
SamplingRateCalculatorList Self
Definition: otbSamplingRateCalculatorList.h:45
otb::SamplingRateCalculator::MapRateType
std::map< std::string, TripletType > MapRateType
Definition: otbSamplingRateCalculator.h:60
otbObjectList.h
otb::SamplingRateCalculatorList::EQUAL
@ EQUAL
Definition: otbSamplingRateCalculatorList.h:56
otb::SamplingRateCalculator::ClassCountMapType
std::map< std::string, unsigned long > ClassCountMapType
Definition: otbSamplingRateCalculator.h:50
otb::SamplingRateCalculatorList::~SamplingRateCalculatorList
~SamplingRateCalculatorList() override
Definition: otbSamplingRateCalculatorList.h:103
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::SamplingRateCalculatorList
This class is a list of sampling rate calculators.
Definition: otbSamplingRateCalculatorList.h:41
otbSamplingRateCalculator.h