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::RandomSampler Class Reference

#include <otbRandomSampler.h>

+ Inheritance diagram for otb::RandomSampler:
+ Collaboration diagram for otb::RandomSampler:


struct  Parameter

Public Types

typedef itk::SmartPointer
< const Self
typedef struct
typedef itk::SmartPointer< SelfPointer
typedef RandomSampler Self
typedef SamplerBase Superclass
- Public Types inherited from otb::SamplerBase
typedef itk::SmartPointer
< const Self
typedef itk::SmartPointer< SelfPointer
typedef SamplerBase Self
typedef itk::Object Superclass
- 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

virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const
ParameterType GetParameters ()
void Reset (void) override
bool TakeSample (void)
void SetParameters (const ParameterType &param)
- Public Member Functions inherited from otb::SamplerBase
virtual unsigned long GetChosenElements ()
virtual unsigned long GetNeededElements ()
virtual unsigned long GetProcessedElements ()
virtual double GetRate ()
virtual unsigned long GetTotalElements ()
void SetNumberOfElements (unsigned long needed, unsigned long total)
void SetRate (double rate, unsigned long total=0UL)
- 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 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

 RandomSampler ()
 ~RandomSampler () override
- Protected Member Functions inherited from otb::SamplerBase
 SamplerBase ()
 ~SamplerBase () override
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void PrintSelf (std::ostream &os, Indent indent) const override
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 &)
 RandomSampler (const Self &)

Private Attributes

std::vector< unsigned long >
ParameterType m_Parameters
std::vector< unsigned long > m_Positions

Additional Inherited Members

- Protected Attributes inherited from otb::SamplerBase
unsigned long m_ChosenElements
unsigned long m_ProcessedElements
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount

Detailed Description

Random sampler for iteration loops.

This class allows doing random sampling during an iteration loop. It uses the MersenneTwisterRandomGenerator.

Definition at line 39 of file otbRandomSampler.h.

Member Typedef Documentation

Definition at line 45 of file otbRandomSampler.h.

Internal parameters, only contains an offset to shift the periodic sampling

Definition at line 44 of file otbRandomSampler.h.

Definition at line 42 of file otbRandomSampler.h.

Definition at line 43 of file otbRandomSampler.h.

Constructor & Destructor Documentation

otb::RandomSampler::RandomSampler ( )


otb::RandomSampler::~RandomSampler ( )


Definition at line 98 of file otbRandomSampler.h.

otb::RandomSampler::RandomSampler ( const Self )

Member Function Documentation

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

Reimplemented from itk::Object.

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

Runtime information support.

Reimplemented from otb::SamplerBase.

ParameterType otb::RandomSampler::GetParameters ( void  )

Getter for internal parameters

Definition at line 77 of file otbRandomSampler.h.

static Pointer otb::RandomSampler::New ( )

Method for creation through the object factory.

void otb::RandomSampler::operator= ( const Self )
void otb::RandomSampler::Reset ( void  )

Reset internal counter (to be called before starting iteration)

Reimplemented from otb::SamplerBase.

void otb::RandomSampler::SetParameters ( const ParameterType param)

Setter for internal parameters

Definition at line 66 of file otbRandomSampler.h.

bool otb::RandomSampler::TakeSample ( void  )

Method to call during iteration, returns true if the sample is selected, and false otherwise.

Member Data Documentation

std::vector<unsigned long>::iterator otb::RandomSampler::m_CurrentPosition

Internal current position

Definition at line 112 of file otbRandomSampler.h.

ParameterType otb::RandomSampler::m_Parameters

Internal parameters for the sampler

Definition at line 106 of file otbRandomSampler.h.

std::vector<unsigned long> otb::RandomSampler::m_Positions

Internal list of positions to select

Definition at line 109 of file otbRandomSampler.h.

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