21 #ifndef otbSampleAugmentationFilter_h
22 #define otbSampleAugmentationFilter_h
24 #include "itkProcessObject.h"
27 #include "OTBSamplingExport.h"
79 using Superclass::SetInput;
89 itkSetMacro(ClassFieldName, std::string);
94 itkGetMacro(ClassFieldName, std::string);
97 itkSetMacro(Layer,
size_t);
98 itkGetMacro(Layer,
size_t);
99 itkSetMacro(Label,
int);
100 itkGetMacro(Label,
int);
109 itkSetMacro(NumberOfSamples,
int);
110 itkGetMacro(NumberOfSamples,
int);
113 m_ExcludedFields = ef;
117 return m_ExcludedFields;
119 itkSetMacro(StdFactor,
double);
120 itkGetMacro(StdFactor,
double);
121 itkSetMacro(SmoteNeighbors,
size_t);
122 itkGetMacro(SmoteNeighbors,
size_t);
123 itkSetMacro(Seed,
int);
124 itkGetMacro(Seed,
int);
143 using Superclass::MakeOutput;
147 const std::vector<std::string>& excludedFields = {});
150 const std::string& classField,
int label,
const std::vector<std::string>& excludedFields = {});
Filter to generate synthetic samples from existing ones.
Strategy GetStrategy() const
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
SampleAugmentationFilter Self
OGRDataSourceType::Pointer OGRDataSourcePointerType
void GenerateData() override
SampleAugmentationFilter()
SampleAugmentationFilter(const Self &)=delete
void SetExcludedFields(const std::vector< std::string > &ef)
vcl_size_t m_SmoteNeighbors
bool IsNumericField(const ogr::Feature &feature, const int idx)
std::string m_ClassFieldName
virtual void SetOutputSamples(ogr::DataSource *data)
void operator=(const Self &)=delete
const OGRDataSourceType * GetInput(unsigned int idx)
ogr::Feature SelectTemplateFeature(const ogr::Layer &inputLayer, const std::string &classField, int label)
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
SampleVectorType ExtractSamples(const ogr::DataSource::Pointer vectors, vcl_size_t layerName, const std::string &classField, const int label, const std::vector< std::string > &excludedFields={})
ogr::DataSource OGRDataSourceType
std::set< vcl_size_t > GetExcludedFieldsIds(const std::vector< std::string > &excludedFields, const ogr::Layer &inputLayer)
virtual void SetInput(const OGRDataSourceType *ds)
~SampleAugmentationFilter() override
itk::SmartPointer< const Self > ConstPointer
std::vector< std::string > m_ExcludedFields
sampleAugmentation::SampleVectorType SampleVectorType
itk::SmartPointer< Self > Pointer
std::vector< std::string > GetExcludedFields() const
void SetStrategy(Strategy s)
const OGRDataSourceType * GetOutput()
itk::ProcessObject Superclass
itk::DataObject::Pointer DataObjectPointer
sampleAugmentation::SampleType SampleType
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={})
Collection of geometric objects.
itk::SmartPointer< Self > Pointer
Geometric object with descriptive fields.
Layer of geometric objects.
std::vector< double > SampleType
std::vector< SampleType > SampleVectorType
void Smote(const SampleVectorType &inSamples, const vcl_size_t nbSamples, SampleVectorType &newSamples, const int nbNeighbors, const int seed=std::time(nullptr))
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.