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

#include <otbSampleAugmentationFilter.h>

+ Inheritance diagram for otb::SampleAugmentationFilter:
+ Collaboration diagram for otb::SampleAugmentationFilter:

Public Types

typedef itk::SmartPointer
< const Self
ConstPointer
 
typedef
itk::ProcessObject::DataObjectPointerArraySizeType 
DataObjectPointerArraySizeType
 
typedef OGRDataSourceType::Pointer OGRDataSourcePointerType
 
typedef ogr::DataSource OGRDataSourceType
 
typedef ogr::Layer OGRLayerType
 
typedef itk::SmartPointer< SelfPointer
 
using SampleType = sampleAugmentation::SampleType
 
using SampleVectorType = sampleAugmentation::SampleVectorType
 
typedef SampleAugmentationFilter Self
 
enum  Strategy {
  Strategy::Replicate,
  Strategy::Jitter,
  Strategy::Smote
}
 
typedef itk::ProcessObject Superclass
 
- Public Types inherited from itk::ProcessObject
typedef SmartPointer< const SelfConstPointer
 
typedef
DataObject::DataObjectIdentifierType 
DataObjectIdentifierType
 
typedef DataObject::Pointer DataObjectPointer
 
typedef std::vector
< DataObjectPointer
DataObjectPointerArray
 
typedef
DataObjectPointerArray::size_type 
DataObjectPointerArraySizeType
 
typedef std::vector
< DataObjectIdentifierType
NameArray
 
typedef SmartPointer< SelfPointer
 
typedef ProcessObject Self
 
typedef 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 std::string GetClassFieldName ()
 
std::vector< std::string > GetExcludedFields () const
 
virtual int GetLabel ()
 
virtual vcl_size_t GetLayer ()
 
virtual const char * GetNameOfClass () const
 
virtual int GetNumberOfSamples ()
 
const OGRDataSourceTypeGetOutput ()
 
virtual int GetSeed ()
 
virtual vcl_size_t GetSmoteNeighbors ()
 
virtual double GetStdFactor ()
 
Strategy GetStrategy () const
 
virtual void SetClassFieldName (std::string _arg)
 
void SetExcludedFields (const std::vector< std::string > &ef)
 
virtual void SetLabel (int _arg)
 
virtual void SetLayer (vcl_size_t _arg)
 
virtual void SetNumberOfSamples (int _arg)
 
virtual void SetOutputSamples (ogr::DataSource *data)
 
virtual void SetSeed (int _arg)
 
virtual void SetSmoteNeighbors (vcl_size_t _arg)
 
virtual void SetStdFactor (double _arg)
 
void SetStrategy (Strategy s)
 
virtual void SetInput (const OGRDataSourceType *ds)
 
const OGRDataSourceTypeGetInput (unsigned int idx)
 
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
 
virtual void AbortGenerateDataOn ()
 
virtual void EnlargeOutputRequestedRegion (DataObject *)
 
virtual const bool & GetAbortGenerateData () const
 
DataObjectPointerArray GetIndexedInputs ()
 
DataObjectPointerArray GetIndexedOutputs ()
 
NameArray GetInputNames () const
 
DataObjectPointerArray GetInputs ()
 
MultiThreader * GetMultiThreader () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
 
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
 
DataObjectPointerArraySizeType GetNumberOfInputs () const
 
DataObjectPointerArraySizeType GetNumberOfOutputs () const
 
virtual const ThreadIdTypeGetNumberOfThreads () const
 
virtual
DataObjectPointerArraySizeType 
GetNumberOfValidRequiredInputs () const
 
NameArray GetOutputNames () const
 
DataObjectPointerArray GetOutputs ()
 
virtual const float & GetProgress () const
 
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
 
virtual bool GetReleaseDataFlag () const
 
NameArray GetRequiredInputNames () const
 
bool HasInput (const DataObjectIdentifierType &key) const
 
bool HasOutput (const DataObjectIdentifierType &key) const
 
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
 
virtual void PrepareOutputs ()
 
virtual void PropagateRequestedRegion (DataObject *output)
 
virtual void ReleaseDataBeforeUpdateFlagOff ()
 
virtual void ReleaseDataBeforeUpdateFlagOn ()
 
void ReleaseDataFlagOff ()
 
void ReleaseDataFlagOn ()
 
virtual void ResetPipeline ()
 
virtual void SetAbortGenerateData (bool _arg)
 
virtual void SetNumberOfThreads (ThreadIdType _arg)
 
void SetProgress (float progress)
 
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
 
virtual void SetReleaseDataFlag (bool flag)
 
virtual void Update ()
 
virtual void UpdateLargestPossibleRegion ()
 
virtual void UpdateOutputData (DataObject *output)
 
virtual void UpdateOutputInformation ()
 
void UpdateProgress (float progress)
 
- 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 Types

typedef itk::DataObject::Pointer DataObjectPointer
 

Protected Member Functions

SampleVectorType ExtractSamples (const ogr::DataSource::Pointer vectors, vcl_size_t layerName, const std::string &classField, const int label, const std::vector< std::string > &excludedFields={})
 
void GenerateData () override
 
std::set< vcl_size_t > GetExcludedFieldsIds (const std::vector< std::string > &excludedFields, const ogr::Layer &inputLayer)
 
bool IsNumericField (const ogr::Feature &feature, const int idx)
 
DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
 SampleAugmentationFilter ()
 
void SampleToOGRFeatures (const ogr::DataSource::Pointer &vectors, ogr::DataSource *output, const SampleVectorType &samples, const vcl_size_t layerName, const std::string &classField, int label, const std::vector< std::string > &excludedFields={})
 
ogr::Feature SelectTemplateFeature (const ogr::Layer &inputLayer, const std::string &classField, int label)
 
 ~SampleAugmentationFilter () override
 
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
 
virtual void AddOutput (DataObject *output)
 
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
 
bool AddRequiredInputName (const DataObjectIdentifierType &)
 
virtual void CacheInputReleaseDataFlags ()
 
virtual void GenerateInputRequestedRegion ()
 
virtual void GenerateOutputInformation ()
 
virtual void GenerateOutputRequestedRegion (DataObject *output)
 
const DataObjectGetInput (const DataObjectIdentifierType &key) const
 
DataObjectGetInput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetInput (const DataObjectIdentifierType &key)
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredInputs () const
 
virtual const
DataObjectPointerArraySizeType
GetNumberOfRequiredOutputs () const
 
DataObjectGetOutput (const DataObjectIdentifierType &key)
 
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
 
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
 
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
 
DataObjectGetPrimaryInput ()
 
const DataObjectGetPrimaryInput () const
 
virtual const char * GetPrimaryInputName (void) const
 
DataObjectGetPrimaryOutput ()
 
const DataObjectGetPrimaryOutput () const
 
virtual const char * GetPrimaryOutputName (void) const
 
bool IsIndexedInputName (const DataObjectIdentifierType &) const
 
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
 
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 
 itkLegacyMacro (virtual void RemoveInput(DataObject *input))
 
 itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num))
 
 itkLegacyMacro (virtual void RemoveOutput(DataObject *output))
 
 itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num))
 
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
 
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
 
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
 
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
 
virtual void PopBackInput ()
 
virtual void PopFrontInput ()
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
 ProcessObject ()
 
virtual void PropagateResetPipeline ()
 
virtual void PushBackInput (const DataObject *input)
 
virtual void PushFrontInput (const DataObject *input)
 
virtual void ReleaseInputs ()
 
virtual void RemoveInput (const DataObjectIdentifierType &key)
 
virtual void RemoveInput (DataObjectPointerArraySizeType)
 
virtual void RemoveOutput (const DataObjectIdentifierType &key)
 
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
 
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
 
virtual void RestoreInputReleaseDataFlags ()
 
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
 
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
 
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
 
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
 
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
 
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
 
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
 
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
 
virtual void SetPrimaryInput (DataObject *input)
 
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
 
virtual void SetPrimaryOutput (DataObject *output)
 
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
 
void SetRequiredInputNames (const NameArray &)
 
virtual void VerifyInputInformation ()
 
virtual void VerifyPreconditions ()
 
 ~ProcessObject ()
 
- 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
 
 SampleAugmentationFilter (const Self &)=delete
 

Private Attributes

std::string m_ClassFieldName
 
std::vector< std::string > m_ExcludedFields
 
int m_Label
 
vcl_size_t m_Layer
 
int m_NumberOfSamples
 
int m_Seed
 
vcl_size_t m_SmoteNeighbors
 
double m_StdFactor
 
Strategy m_Strategy
 

Additional Inherited Members

- Protected Attributes inherited from itk::ProcessObject
TimeStamp m_OutputInformationMTime
 
bool m_Updating
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Detailed Description

Filter to generate synthetic samples from existing ones.

This class generates synthetic samples from existing ones either by replication, jitter (adding gaussian noise to the features of existing samples) or SMOTE (linear combination of pairs neighbouring samples of the same class.

Definition at line 47 of file otbSampleAugmentationFilter.h.

Member Typedef Documentation

Definition at line 56 of file otbSampleAugmentationFilter.h.

DataObject pointer

Definition at line 135 of file otbSampleAugmentationFilter.h.

Definition at line 68 of file otbSampleAugmentationFilter.h.

Definition at line 65 of file otbSampleAugmentationFilter.h.

Definition at line 62 of file otbSampleAugmentationFilter.h.

Definition at line 66 of file otbSampleAugmentationFilter.h.

Definition at line 55 of file otbSampleAugmentationFilter.h.

Definition at line 70 of file otbSampleAugmentationFilter.h.

Definition at line 71 of file otbSampleAugmentationFilter.h.

typedef for the classes standards.

Definition at line 53 of file otbSampleAugmentationFilter.h.

Definition at line 54 of file otbSampleAugmentationFilter.h.

Member Enumeration Documentation

Enumerator
Replicate 
Jitter 
Smote 

Definition at line 73 of file otbSampleAugmentationFilter.h.

Constructor & Destructor Documentation

otb::SampleAugmentationFilter::SampleAugmentationFilter ( )
protected
otb::SampleAugmentationFilter::~SampleAugmentationFilter ( )
inlineoverrideprotected

Definition at line 129 of file otbSampleAugmentationFilter.h.

otb::SampleAugmentationFilter::SampleAugmentationFilter ( const Self )
privatedelete

Member Function Documentation

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

Reimplemented from itk::Object.

SampleVectorType otb::SampleAugmentationFilter::ExtractSamples ( const ogr::DataSource::Pointer  vectors,
vcl_size_t  layerName,
const std::string &  classField,
const int  label,
const std::vector< std::string > &  excludedFields = {} 
)
protected
void otb::SampleAugmentationFilter::GenerateData ( )
overrideprotectedvirtual

Generate Data method

Reimplemented from itk::ProcessObject.

virtual std::string otb::SampleAugmentationFilter::GetClassFieldName ( )
virtual

Return the Field name in which labels have been written.

std::vector<std::string> otb::SampleAugmentationFilter::GetExcludedFields ( ) const
inline

Definition at line 112 of file otbSampleAugmentationFilter.h.

std::set<vcl_size_t> otb::SampleAugmentationFilter::GetExcludedFieldsIds ( const std::vector< std::string > &  excludedFields,
const ogr::Layer inputLayer 
)
protected
const OGRDataSourceType* otb::SampleAugmentationFilter::GetInput ( unsigned int  idx)
virtual int otb::SampleAugmentationFilter::GetLabel ( )
virtual
virtual vcl_size_t otb::SampleAugmentationFilter::GetLayer ( )
virtual
virtual const char* otb::SampleAugmentationFilter::GetNameOfClass ( ) const
virtual

Return the name of the class.

Reimplemented from itk::ProcessObject.

virtual int otb::SampleAugmentationFilter::GetNumberOfSamples ( )
virtual
const OGRDataSourceType* otb::SampleAugmentationFilter::GetOutput ( )

Get the output ogr::DataSource which is a "memory" datasource.

virtual int otb::SampleAugmentationFilter::GetSeed ( )
virtual
virtual vcl_size_t otb::SampleAugmentationFilter::GetSmoteNeighbors ( )
virtual
virtual double otb::SampleAugmentationFilter::GetStdFactor ( )
virtual
Strategy otb::SampleAugmentationFilter::GetStrategy ( ) const
inline

Definition at line 102 of file otbSampleAugmentationFilter.h.

bool otb::SampleAugmentationFilter::IsNumericField ( const ogr::Feature feature,
const int  idx 
)
protected
DataObjectPointer otb::SampleAugmentationFilter::MakeOutput ( DataObjectPointerArraySizeType  idx)
overrideprotectedvirtual

Reimplemented from itk::ProcessObject.

static Pointer otb::SampleAugmentationFilter::New ( )
static

Method for management of the object factory.

void otb::SampleAugmentationFilter::operator= ( const Self )
privatedelete
void otb::SampleAugmentationFilter::SampleToOGRFeatures ( const ogr::DataSource::Pointer vectors,
ogr::DataSource output,
const SampleVectorType samples,
const vcl_size_t  layerName,
const std::string &  classField,
int  label,
const std::vector< std::string > &  excludedFields = {} 
)
protected
ogr::Feature otb::SampleAugmentationFilter::SelectTemplateFeature ( const ogr::Layer inputLayer,
const std::string &  classField,
int  label 
)
protected
virtual void otb::SampleAugmentationFilter::SetClassFieldName ( std::string  _arg)
virtual

Set the Field Name in which labels will be written. (default is "class") A field "ClassFieldName" of type integer is created in the output memory layer.

void otb::SampleAugmentationFilter::SetExcludedFields ( const std::vector< std::string > &  ef)
inline

Definition at line 108 of file otbSampleAugmentationFilter.h.

virtual void otb::SampleAugmentationFilter::SetInput ( const OGRDataSourceType ds)
virtual
virtual void otb::SampleAugmentationFilter::SetLabel ( int  _arg)
virtual
virtual void otb::SampleAugmentationFilter::SetLayer ( vcl_size_t  _arg)
virtual
virtual void otb::SampleAugmentationFilter::SetNumberOfSamples ( int  _arg)
virtual
virtual void otb::SampleAugmentationFilter::SetOutputSamples ( ogr::DataSource data)
virtual
virtual void otb::SampleAugmentationFilter::SetSeed ( int  _arg)
virtual
virtual void otb::SampleAugmentationFilter::SetSmoteNeighbors ( vcl_size_t  _arg)
virtual
virtual void otb::SampleAugmentationFilter::SetStdFactor ( double  _arg)
virtual
void otb::SampleAugmentationFilter::SetStrategy ( Strategy  s)
inline

Definition at line 98 of file otbSampleAugmentationFilter.h.

Member Data Documentation

std::string otb::SampleAugmentationFilter::m_ClassFieldName
private

Definition at line 163 of file otbSampleAugmentationFilter.h.

std::vector<std::string> otb::SampleAugmentationFilter::m_ExcludedFields
private

Definition at line 166 of file otbSampleAugmentationFilter.h.

int otb::SampleAugmentationFilter::m_Label
private

Definition at line 165 of file otbSampleAugmentationFilter.h.

vcl_size_t otb::SampleAugmentationFilter::m_Layer
private

Definition at line 164 of file otbSampleAugmentationFilter.h.

int otb::SampleAugmentationFilter::m_NumberOfSamples
private

Definition at line 168 of file otbSampleAugmentationFilter.h.

int otb::SampleAugmentationFilter::m_Seed
private

Definition at line 171 of file otbSampleAugmentationFilter.h.

vcl_size_t otb::SampleAugmentationFilter::m_SmoteNeighbors
private

Definition at line 170 of file otbSampleAugmentationFilter.h.

double otb::SampleAugmentationFilter::m_StdFactor
private

Definition at line 169 of file otbSampleAugmentationFilter.h.

Strategy otb::SampleAugmentationFilter::m_Strategy
private

Definition at line 167 of file otbSampleAugmentationFilter.h.


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