OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::PatternSampler Class Reference

#include <otbPatternSampler.h>

+ Inheritance diagram for otb::PatternSampler:
+ Collaboration diagram for otb::PatternSampler:

Classes

struct  Parameter
 

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef struct otb::PatternSampler::Parameter ParameterType
 
typedef itk::SmartPointer< SelfPointer
 
typedef PatternSampler Self
 
typedef SamplerBase Superclass
 
- Public Types inherited from otb::SamplerBase
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef SamplerBase Self
 
typedef itk::Object Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
- 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)
 

Static Public Member Functions

static Pointer New ()
 
ParameterType m_Parameters
 
unsigned long m_Index1
 
unsigned long m_Index2
 
static void ImportPatterns (const std::string &data, ParameterType &param)
 
static void ExportPatterns (const ParameterType &param, std::string &data)
 
void SetParameters (const ParameterType &param)
 
ParameterType GetParameters ()
 
void Reset (void) override
 
bool TakeSample (void)
 
 PatternSampler ()
 
 ~PatternSampler () override
 
 PatternSampler (const Self &)
 
void operator= (const Self &)
 
std::vector< bool > RandArray (unsigned long N, unsigned long T)
 
unsigned long FindBestSize (unsigned long tot)
 
static unsigned int ParseSymbol (const char &s)
 

Additional Inherited Members

- Protected Member Functions inherited from otb::SamplerBase
 SamplerBase ()
 
 ~SamplerBase () override
 
- Protected Attributes inherited from otb::SamplerBase
unsigned long m_ChosenElements
 
unsigned long m_ProcessedElements
 

Detailed Description

Periodic sampler for iteration loops.

This class allows doing periodic sampling during an iteration loop.

Definition at line 39 of file otbPatternSampler.h.

Member Typedef Documentation

◆ ConstPointer

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

Definition at line 45 of file otbPatternSampler.h.

◆ ParameterType

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

◆ Pointer

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

Definition at line 44 of file otbPatternSampler.h.

◆ Self

Definition at line 42 of file otbPatternSampler.h.

◆ Superclass

Definition at line 43 of file otbPatternSampler.h.

Constructor & Destructor Documentation

◆ PatternSampler() [1/2]

otb::PatternSampler::PatternSampler ( )
protected

Constructor

◆ ~PatternSampler()

otb::PatternSampler::~PatternSampler ( )
inlineoverrideprotected

Destructor

Definition at line 120 of file otbPatternSampler.h.

◆ PatternSampler() [2/2]

otb::PatternSampler::PatternSampler ( const Self )
private

Internal parameters for the sampler

Member Function Documentation

◆ CreateAnother()

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

◆ ExportPatterns()

static void otb::PatternSampler::ExportPatterns ( const ParameterType param,
std::string &  data 
)
static

Export the sampling patterns in the input parameter to an output string. If the second pattern is not empty, it will be concatenated to the output string, separated by a slash

◆ FindBestSize()

unsigned long otb::PatternSampler::FindBestSize ( unsigned long  tot)
private

Find a suitable size for internal patterns

◆ GetNameOfClass()

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

Runtime information support.

Reimplemented from otb::SamplerBase.

◆ GetParameters()

ParameterType otb::PatternSampler::GetParameters ( )
inline

Getter for internal parameters

Definition at line 87 of file otbPatternSampler.h.

◆ ImportPatterns()

static void otb::PatternSampler::ImportPatterns ( const std::string &  data,
ParameterType param 
)
static

Import sampling patterns from an input string Two patterns may be given, separated by a slash Beware, the second pattern may be empty

◆ New()

static Pointer otb::PatternSampler::New ( )
static

Method for creation through the object factory.

◆ operator=()

void otb::PatternSampler::operator= ( const Self )
private

Internal parameters for the sampler

◆ ParseSymbol()

static unsigned int otb::PatternSampler::ParseSymbol ( const char &  s)
staticprivate

Helper function to decode boolean sequence Characters converted into true : '1' 'X' 'y' 'Y' '|' '+' Characters converted into false : '0' '_' 'n' 'N' '.' '-' Other characters will return a 2

◆ RandArray()

std::vector<bool> otb::PatternSampler::RandArray ( unsigned long  N,
unsigned long  T 
)
private

Generate a random array of booleans

◆ Reset()

void otb::PatternSampler::Reset ( void  )
overridevirtual

Method that resets the internal state of the sampler

Reimplemented from otb::SamplerBase.

◆ SetParameters()

void otb::PatternSampler::SetParameters ( const ParameterType param)
inline

Setter for internal parameters

Definition at line 76 of file otbPatternSampler.h.

◆ TakeSample()

bool otb::PatternSampler::TakeSample ( void  )

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

Member Data Documentation

◆ m_Index1

unsigned long otb::PatternSampler::m_Index1
private

Index tracking the position in first internal pattern

Definition at line 139 of file otbPatternSampler.h.

◆ m_Index2

unsigned long otb::PatternSampler::m_Index2
private

Index tracking the position in the second internal pattern

Definition at line 142 of file otbPatternSampler.h.

◆ m_Parameters

ParameterType otb::PatternSampler::m_Parameters
private

Internal parameters for the sampler

Definition at line 136 of file otbPatternSampler.h.


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