OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::SamplingRateCalculator Class Reference

#include <otbSamplingRateCalculator.h>

+ Inheritance diagram for otb::SamplingRateCalculator:
+ Collaboration diagram for otb::SamplingRateCalculator:

Classes

struct  Triplet
 

Public Types

typedef std::map< std::string, unsigned long > ClassCountMapType
 
typedef ClassCountMapType::const_iterator constItMapType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, TripletTypeMapRateType
 
typedef itk::SmartPointer< SelfPointer
 
typedef SamplingRateCalculator Self
 
typedef itk::Object Superclass
 
typedef struct OTBSampling_EXPORT otb::SamplingRateCalculator::Triplet TripletType
 

Public Member Functions

void ClearRates (void)
 
virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
virtual const MapRateTypeGetRatesByClass () const
 
void Read (std::string filename)
 
void SetAllSamples (void)
 
void SetClassCount (const ClassCountMapType &map)
 
void SetMinimumNbOfSamplesByClass (void)
 
void SetNbOfSamplesAllClasses (unsigned long)
 
void SetNbOfSamplesByClass (const ClassCountMapType &required)
 
void SetPercentageOfSamples (double percent)
 
void SetTotalNumberOfSamples (unsigned long value)
 
void Write (std::string filename)
 

Static Public Member Functions

static Pointer New ()
 
static ClassCountMapType ReadRequiredSamples (const std::string &filename)
 

Protected Member Functions

void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 SamplingRateCalculator ()
 
 ~SamplingRateCalculator () override
 

Private Member Functions

void operator= (const Self &)=delete
 
 SamplingRateCalculator (const Self &)=delete
 
void UpdateRate (const std::string &name)
 

Private Attributes

MapRateType m_RatesByClass
 

Detailed Description

This class is a sampling rate calculator.

It computes sampling rates for each class, given input statistics on available samples, and a sampling strategy.

Definition at line 40 of file otbSamplingRateCalculator.h.

Member Typedef Documentation

◆ ClassCountMapType

typedef std::map<std::string, unsigned long> otb::SamplingRateCalculator::ClassCountMapType

typdefs

Definition at line 50 of file otbSamplingRateCalculator.h.

◆ constItMapType

typedef ClassCountMapType::const_iterator otb::SamplingRateCalculator::constItMapType

Definition at line 51 of file otbSamplingRateCalculator.h.

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::SamplingRateCalculator::ConstPointer

Definition at line 47 of file otbSamplingRateCalculator.h.

◆ MapRateType

typedef std::map<std::string, TripletType> otb::SamplingRateCalculator::MapRateType

Definition at line 60 of file otbSamplingRateCalculator.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::SamplingRateCalculator::Pointer

Definition at line 46 of file otbSamplingRateCalculator.h.

◆ Self

Standard typedefs

Definition at line 44 of file otbSamplingRateCalculator.h.

◆ Superclass

Definition at line 45 of file otbSamplingRateCalculator.h.

◆ TripletType

Constructor & Destructor Documentation

◆ SamplingRateCalculator() [1/2]

otb::SamplingRateCalculator::SamplingRateCalculator ( )
protected

Constructor

◆ ~SamplingRateCalculator()

otb::SamplingRateCalculator::~SamplingRateCalculator ( )
inlineoverrideprotected

Destructor

Definition at line 113 of file otbSamplingRateCalculator.h.

◆ SamplingRateCalculator() [2/2]

otb::SamplingRateCalculator::SamplingRateCalculator ( const Self )
privatedelete

Member Function Documentation

◆ ClearRates()

void otb::SamplingRateCalculator::ClearRates ( void  )

Clear internal data

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::SamplingRateCalculator::CreateAnother ( void  ) const

◆ GetNameOfClass()

virtual const char* otb::SamplingRateCalculator::GetNameOfClass ( ) const
virtual

Creation through object factory macro

◆ GetRatesByClass()

virtual const MapRateType& otb::SamplingRateCalculator::GetRatesByClass ( ) const
virtual

Get macro to the computed sampling rates.

◆ New()

static Pointer otb::SamplingRateCalculator::New ( )
static

◆ operator=()

void otb::SamplingRateCalculator::operator= ( const Self )
privatedelete

◆ PrintSelf()

void otb::SamplingRateCalculator::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

◆ Read()

void otb::SamplingRateCalculator::Read ( std::string  filename)

Method to import sampling rates from a CSV file. Columns are : class name, required samples, total samples, rate.

◆ ReadRequiredSamples()

static ClassCountMapType otb::SamplingRateCalculator::ReadRequiredSamples ( const std::string &  filename)
static

◆ SetAllSamples()

void otb::SamplingRateCalculator::SetAllSamples ( void  )

Method to select all available samples

◆ SetClassCount()

void otb::SamplingRateCalculator::SetClassCount ( const ClassCountMapType map)

Set method to input the total number of samples in each class. This method should be called before the other Set... methods that apply a sampling strategy

◆ SetMinimumNbOfSamplesByClass()

void otb::SamplingRateCalculator::SetMinimumNbOfSamplesByClass ( void  )

Method to choose a sampling strategy based on the smallest class. The number of samples in each class is set to this minimum size

◆ SetNbOfSamplesAllClasses()

void otb::SamplingRateCalculator::SetNbOfSamplesAllClasses ( unsigned long  )

Method to set the same number of required samples in each class

◆ SetNbOfSamplesByClass()

void otb::SamplingRateCalculator::SetNbOfSamplesByClass ( const ClassCountMapType required)

Method to manually set the number of samples required in each class

◆ SetPercentageOfSamples()

void otb::SamplingRateCalculator::SetPercentageOfSamples ( double  percent)

Method to set a percentage of samples for each class

◆ SetTotalNumberOfSamples()

void otb::SamplingRateCalculator::SetTotalNumberOfSamples ( unsigned long  value)

Method to set the total number of samples to generate

◆ UpdateRate()

void otb::SamplingRateCalculator::UpdateRate ( const std::string &  name)
private

Update the computed rate for a given class.

◆ Write()

void otb::SamplingRateCalculator::Write ( std::string  filename)

Method to export sampling rates in a CSV file. Columns are : class name, required samples, total samples, rate.

Member Data Documentation

◆ m_RatesByClass

MapRateType otb::SamplingRateCalculator::m_RatesByClass
private

Internal sampling rates.

Definition at line 128 of file otbSamplingRateCalculator.h.


The documentation for this class was generated from the following file: