OTB  6.7.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 Self
ConstPointer
 
typedef std::map< std::string,
TripletType
MapRateType
 
typedef itk::SmartPointer< SelfPointer
 
typedef SamplingRateCalculator Self
 
typedef itk::Object Superclass
 
typedef struct
OTBSampling_EXPORT
otb::SamplingRateCalculator::Triplet 
TripletType
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

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)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
static ClassCountMapType ReadRequiredSamples (const std::string &filename)
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 SamplingRateCalculator ()
 
 ~SamplingRateCalculator () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Member Functions

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

Private Attributes

MapRateType m_RatesByClass
 

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

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

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

typdefs

Definition at line 51 of file otbSamplingRateCalculator.h.

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

Definition at line 52 of file otbSamplingRateCalculator.h.

Definition at line 48 of file otbSamplingRateCalculator.h.

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

Definition at line 61 of file otbSamplingRateCalculator.h.

Definition at line 47 of file otbSamplingRateCalculator.h.

Standard typedefs

Definition at line 45 of file otbSamplingRateCalculator.h.

Definition at line 46 of file otbSamplingRateCalculator.h.

Constructor & Destructor Documentation

otb::SamplingRateCalculator::SamplingRateCalculator ( )
protected

Constructor

otb::SamplingRateCalculator::~SamplingRateCalculator ( )
inlineoverrideprotected

Destructor

Definition at line 114 of file otbSamplingRateCalculator.h.

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

Member Function Documentation

void otb::SamplingRateCalculator::ClearRates ( void  )

Clear internal data

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

Reimplemented from itk::Object.

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

Creation through object factory macro

Reimplemented from itk::Object.

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

Get macro to the computed sampling rates.

static Pointer otb::SamplingRateCalculator::New ( )
static
void otb::SamplingRateCalculator::operator= ( const Self )
privatedelete
void otb::SamplingRateCalculator::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotectedvirtual

PrintSelf method

Reimplemented from itk::Object.

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.

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

Method to select all available samples

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

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

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

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

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

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

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

Method to set a percentage of samples for each class

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

Method to set the total number of samples to generate

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

Update the computed rate for a given class.

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

MapRateType otb::SamplingRateCalculator::m_RatesByClass
private

Internal sampling rates.

Definition at line 127 of file otbSamplingRateCalculator.h.


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