OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler > Class Template Reference

#include <otbOGRDataToSamplePositionFilter.h>

+ Inheritance diagram for otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >:
+ Collaboration diagram for otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >:

Public Types

typedef std::map< std::string, unsigned int > ClassPartitionType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::DataObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef InputImageType::Pointer InputImagePointer
 
typedef TInputImage InputImageType
 
typedef MaskImageType::Pointer MaskImagePointer
 
typedef TMaskImage MaskImageType
 
typedef ogr::DataSource::Pointer OGRDataPointer
 
typedef ogr::DataSource OGRDataType
 
typedef itk::SmartPointer< SelfPointer
 
typedef InputImageType::PointType PointType
 
typedef InputImageType::RegionType RegionType
 
typedef std::map< std::string, SamplerPointerTypeSamplerMapType
 
typedef SamplerType::ParameterType SamplerParameterType
 
typedef SamplerType::Pointer SamplerPointerType
 
typedef TSampler SamplerType
 
typedef PersistentOGRDataToSamplePositionFilter Self
 
typedef PersistentSamplingFilterBase< TInputImage, TMaskImage > Superclass
 
- Public Types inherited from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >
typedef itk::SmartPointer< const SelfConstPointer
 
typedef TInputImage InputImageType
 
typedef TMaskImage MaskImageType
 
typedef ogr::DataSource::Pointer OGRDataPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef TInputImage::RegionType RegionType
 
typedef PersistentSamplingFilterBase Self
 
typedef PersistentImageFilter< TInputImage, TInputImage > Superclass
 
- Public Types inherited from otb::PersistentImageFilter< TInputImage, TInputImage >
typedef itk::SmartPointer< const SelfConstPointer
 
typedef TInputImage InputImageType
 
typedef TInputImage OutputImageType
 
typedef itk::SmartPointer< SelfPointer
 
typedef PersistentImageFilter Self
 
typedef itk::ImageToImageFilter< TInputImage, TInputImage > Superclass
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 
SamplerMapTypeGetSamplers (unsigned int level)
 
void Reset (void) override
 
void SetOutputPositionContainerAndRates (otb::ogr::DataSource *data, const SamplingRateCalculator::MapRateType &map, unsigned int level)
 
void Synthetize (void) override
 
- Public Member Functions inherited from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >
const TMaskImage * GetMask ()
 
const ogr::DataSourceGetOGRData ()
 
const std::vector< std::string > & GetOGRLayerCreationOptions ()
 
void SetMask (const TMaskImage *mask)
 
void SetOGRData (const ogr::DataSource *vector)
 
void SetOGRLayerCreationOptions (const std::vector< std::string > &options)
 
virtual void SetFieldName (std::string _arg)
 
virtual std::string GetFieldName ()
 
virtual int GetFieldIndex ()
 
virtual void SetLayerIndex (int _arg)
 
virtual int GetLayerIndex ()
 
virtual void SetOutLayerName (std::string _arg)
 
virtual std::string GetOutLayerName ()
 
- Public Member Functions inherited from otb::PersistentImageFilter< TInputImage, TInputImage >
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
ClassPartitionType m_ClassPartition
 
std::vector< SamplerMapTypem_Samplers
 
std::string m_OriginFieldName
 
bool m_UseOriginField
 
const otb::ogr::DataSourceGetOutputPositionContainer (unsigned int level) const
 
otb::ogr::DataSourceGetOutputPositionContainer (unsigned int level)
 
unsigned int GetNumberOfLevels ()
 
void ClearOutputs ()
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
virtual void SetOriginFieldName (std::string _arg)
 
virtual std::string GetOriginFieldName ()
 
 PersistentOGRDataToSamplePositionFilter ()
 
 ~PersistentOGRDataToSamplePositionFilter () override
 
void ProcessSample (const ogr::Feature &feature, typename TInputImage::IndexType &imgIndex, typename TInputImage::PointType &imgPoint, itk::ThreadIdType &threadid) override
 
void DispatchInputVectors (void) override
 
void FillOneOutput (unsigned int outIdx, ogr::DataSource *outDS, bool update) override
 
 PersistentOGRDataToSamplePositionFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 
void ComputeClassPartition (void)
 

Additional Inherited Members

- Protected Member Functions inherited from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >
 PersistentSamplingFilterBase ()
 
 ~PersistentSamplingFilterBase () override
 
void GenerateOutputInformation () override
 
void GenerateInputRequestedRegion () override
 
void GenerateData (void) override
 
void AllocateOutputs (void) override
 
virtual void ThreadedGenerateVectorData (const ogr::Layer &layerForThread, itk::ThreadIdType threadid)
 
void ExploreGeometry (const ogr::Feature &feature, OGRGeometry *geom, RegionType &region, itk::ThreadIdType &threadid)
 
virtual void ProcessLine (const ogr::Feature &feature, OGRLineString *line, RegionType &region, itk::ThreadIdType &threadid)
 
virtual void ProcessPolygon (const ogr::Feature &feature, OGRPolygon *polygon, RegionType &region, itk::ThreadIdType &threadid)
 
virtual void PrepareFeature (const ogr::Feature &feature, itk::ThreadIdType &threadid)
 
bool IsSampleInsidePolygon (OGRPolygon *poly, OGRPoint *tmpPoint)
 
bool IsSampleOnLine (OGRLineString *line, typename TInputImage::PointType &position, typename TInputImage::SpacingType &absSpacing, OGRPolygon &tmpPolygon)
 
RegionType FeatureBoundingRegion (const TInputImage *image, otb::ogr::Layer::const_iterator &featIt) const
 
virtual void GatherOutputVectors (void)
 
virtual void InitializeOutputDataSource (ogr::DataSource *inputDS, ogr::DataSource *outputDS)
 
void ClearAdditionalFields ()
 
void CreateAdditionalField (std::string name, OGRFieldType type, int width=0, int precision=0)
 
const std::vector< SimpleFieldDefn > & GetAdditionalFields ()
 
ogr::Layer GetInMemoryInput (unsigned int threadId)
 
ogr::Layer GetInMemoryOutput (unsigned int threadId, unsigned int index=0)
 
- Protected Member Functions inherited from otb::PersistentImageFilter< TInputImage, TInputImage >
 PersistentImageFilter ()
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 ~PersistentImageFilter () override
 
- Static Protected Member Functions inherited from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >
static ITK_THREAD_RETURN_TYPE VectorThreaderCallback (void *arg)
 

Detailed Description

template<class TInputImage, class TMaskImage, class TSampler>
class otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >

Persistent filter to extract sample position from an image.

This filter uses an input image (to define the sampling grid), an optional input mask, and a set of input vectors that define the sampling regions for each class.

The filter has a set of samplers (one for each class), they define what sampling rate and strategy should be performed.

Several levels of output are supported. For instance, with two outputs : when the sampler from level 1 discards a sample, the sampler from level 2 is called.

Definition at line 53 of file otbOGRDataToSamplePositionFilter.h.

Member Typedef Documentation

◆ ClassPartitionType

template<class TInputImage , class TMaskImage , class TSampler >
typedef std::map<std::string, unsigned int> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ClassPartitionType

Definition at line 79 of file otbOGRDataToSamplePositionFilter.h.

◆ ConstPointer

template<class TInputImage , class TMaskImage , class TSampler >
typedef itk::SmartPointer<const Self> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ConstPointer

Definition at line 61 of file otbOGRDataToSamplePositionFilter.h.

◆ DataObjectPointerArraySizeType

template<class TInputImage , class TMaskImage , class TSampler >
typedef itk::DataObject::DataObjectPointerArraySizeType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::DataObjectPointerArraySizeType

Definition at line 81 of file otbOGRDataToSamplePositionFilter.h.

◆ InputImagePointer

template<class TInputImage , class TMaskImage , class TSampler >
typedef InputImageType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::InputImagePointer

Definition at line 64 of file otbOGRDataToSamplePositionFilter.h.

◆ InputImageType

template<class TInputImage , class TMaskImage , class TSampler >
typedef TInputImage otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::InputImageType

Definition at line 63 of file otbOGRDataToSamplePositionFilter.h.

◆ MaskImagePointer

template<class TInputImage , class TMaskImage , class TSampler >
typedef MaskImageType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::MaskImagePointer

Definition at line 69 of file otbOGRDataToSamplePositionFilter.h.

◆ MaskImageType

template<class TInputImage , class TMaskImage , class TSampler >
typedef TMaskImage otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::MaskImageType

Definition at line 68 of file otbOGRDataToSamplePositionFilter.h.

◆ OGRDataPointer

template<class TInputImage , class TMaskImage , class TSampler >
typedef ogr::DataSource::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::OGRDataPointer

Definition at line 72 of file otbOGRDataToSamplePositionFilter.h.

◆ OGRDataType

template<class TInputImage , class TMaskImage , class TSampler >
typedef ogr::DataSource otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::OGRDataType

Definition at line 71 of file otbOGRDataToSamplePositionFilter.h.

◆ Pointer

template<class TInputImage , class TMaskImage , class TSampler >
typedef itk::SmartPointer<Self> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Pointer

Definition at line 60 of file otbOGRDataToSamplePositionFilter.h.

◆ PointType

template<class TInputImage , class TMaskImage , class TSampler >
typedef InputImageType::PointType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::PointType

Definition at line 66 of file otbOGRDataToSamplePositionFilter.h.

◆ RegionType

template<class TInputImage , class TMaskImage , class TSampler >
typedef InputImageType::RegionType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::RegionType

Definition at line 65 of file otbOGRDataToSamplePositionFilter.h.

◆ SamplerMapType

template<class TInputImage , class TMaskImage , class TSampler >
typedef std::map<std::string, SamplerPointerType> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerMapType

Definition at line 77 of file otbOGRDataToSamplePositionFilter.h.

◆ SamplerParameterType

template<class TInputImage , class TMaskImage , class TSampler >
typedef SamplerType::ParameterType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerParameterType

Definition at line 76 of file otbOGRDataToSamplePositionFilter.h.

◆ SamplerPointerType

template<class TInputImage , class TMaskImage , class TSampler >
typedef SamplerType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerPointerType

Definition at line 75 of file otbOGRDataToSamplePositionFilter.h.

◆ SamplerType

template<class TInputImage , class TMaskImage , class TSampler >
typedef TSampler otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerType

Definition at line 74 of file otbOGRDataToSamplePositionFilter.h.

◆ Self

template<class TInputImage , class TMaskImage , class TSampler >
typedef PersistentOGRDataToSamplePositionFilter otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Self

Standard Self typedef

Definition at line 58 of file otbOGRDataToSamplePositionFilter.h.

◆ Superclass

template<class TInputImage , class TMaskImage , class TSampler >
typedef PersistentSamplingFilterBase<TInputImage, TMaskImage> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Superclass

Definition at line 59 of file otbOGRDataToSamplePositionFilter.h.

Constructor & Destructor Documentation

◆ PersistentOGRDataToSamplePositionFilter() [1/2]

template<class TInputImage , class TMaskImage , class TSampler >
otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::PersistentOGRDataToSamplePositionFilter
protected

Constructor

Definition at line 31 of file otbOGRDataToSamplePositionFilter.hxx.

◆ ~PersistentOGRDataToSamplePositionFilter()

template<class TInputImage , class TMaskImage , class TSampler >
otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::~PersistentOGRDataToSamplePositionFilter ( )
inlineoverrideprotected

Destructor

Definition at line 129 of file otbOGRDataToSamplePositionFilter.h.

◆ PersistentOGRDataToSamplePositionFilter() [2/2]

template<class TInputImage , class TMaskImage , class TSampler >
otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::PersistentOGRDataToSamplePositionFilter ( const Self )
privatedelete

(internal) map associating a class name with a thread number

Member Function Documentation

◆ ClearOutputs()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ClearOutputs

Clear all output position containers

Definition at line 121 of file otbOGRDataToSamplePositionFilter.hxx.

◆ ComputeClassPartition()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ComputeClassPartition ( void  )
private

(internal) map associating a class name with a thread number

Definition at line 231 of file otbOGRDataToSamplePositionFilter.hxx.

◆ CreateAnother()

template<class TInputImage , class TMaskImage , class TSampler >
virtual::itk::LightObject::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::CreateAnother ( void  ) const

◆ DispatchInputVectors()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::DispatchInputVectors ( void  )
overrideprotectedvirtual

◆ FillOneOutput()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::FillOneOutput ( unsigned int  outIdx,
ogr::DataSource outDS,
bool  update 
)
overrideprotectedvirtual

◆ GetNameOfClass()

template<class TInputImage , class TMaskImage , class TSampler >
virtual const char* otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetNameOfClass ( ) const
virtual

Runtime information support.

Reimplemented from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >.

◆ GetNumberOfLevels()

template<class TInputImage , class TMaskImage , class TSampler >
unsigned int otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetNumberOfLevels

Get the number of sampling levels used in this filter.

Definition at line 115 of file otbOGRDataToSamplePositionFilter.hxx.

◆ GetOriginFieldName()

template<class TInputImage , class TMaskImage , class TSampler >
virtual std::string otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetOriginFieldName ( )
virtual

(internal) map associating a class name with a thread number

◆ GetOutputPositionContainer() [1/2]

template<class TInputImage , class TMaskImage , class TSampler >
otb::ogr::DataSource * otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetOutputPositionContainer ( unsigned int  level)

(internal) map associating a class name with a thread number

Definition at line 105 of file otbOGRDataToSamplePositionFilter.hxx.

◆ GetOutputPositionContainer() [2/2]

template<class TInputImage , class TMaskImage , class TSampler >
const otb::ogr::DataSource* otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetOutputPositionContainer ( unsigned int  level) const

Get the output position container of a given level

◆ GetSamplers()

template<class TInputImage , class TMaskImage , class TSampler >
PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerMapType & otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetSamplers ( unsigned int  level)

Get a reference to the internal samplers at a given level

Definition at line 75 of file otbOGRDataToSamplePositionFilter.hxx.

◆ MakeOutput()

template<class TInputImage , class TMaskImage , class TSampler >
itk::DataObject::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::MakeOutput ( DataObjectPointerArraySizeType  idx)
override

Make a DataObject of the correct type to be used as the specified output.

Definition at line 133 of file otbOGRDataToSamplePositionFilter.hxx.

References otb::ogr::DataSource::New().

◆ New()

template<class TInputImage , class TMaskImage , class TSampler >
static Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::operator= ( const Self )
privatedelete

(internal) map associating a class name with a thread number

◆ ProcessSample()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ProcessSample ( const ogr::Feature feature,
typename TInputImage::IndexType &  imgIndex,
typename TInputImage::PointType &  imgPoint,
itk::ThreadIdType &  threadid 
)
overrideprotectedvirtual

◆ Reset()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Reset ( void  )
overridevirtual

Reset method called before starting the streaming

Implements otb::PersistentImageFilter< TInputImage, TInputImage >.

Definition at line 39 of file otbOGRDataToSamplePositionFilter.hxx.

◆ SetOriginFieldName()

template<class TInputImage , class TMaskImage , class TSampler >
virtual void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SetOriginFieldName ( std::string  _arg)
virtual

Get/Set of the field name storing the original FID of each sample

◆ SetOutputPositionContainerAndRates()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SetOutputPositionContainerAndRates ( otb::ogr::DataSource data,
const SamplingRateCalculator::MapRateType map,
unsigned int  level 
)

Set an output container for sample position associated with corresponding rates, for a given level.

Definition at line 85 of file otbOGRDataToSamplePositionFilter.hxx.

◆ Synthetize()

template<class TInputImage , class TMaskImage , class TSampler >
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Synthetize ( void  )
inlineoverridevirtual

Synthesize the persistent data of the filter.

Implements otb::PersistentImageFilter< TInputImage, TInputImage >.

Definition at line 89 of file otbOGRDataToSamplePositionFilter.h.

Member Data Documentation

◆ m_ClassPartition

template<class TInputImage , class TMaskImage , class TSampler >
ClassPartitionType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::m_ClassPartition
private

(internal) map associating a class name with a thread number

Definition at line 152 of file otbOGRDataToSamplePositionFilter.h.

◆ m_OriginFieldName

template<class TInputImage , class TMaskImage , class TSampler >
std::string otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::m_OriginFieldName
private

Field name to store the FID of the geometry each sample comes from. When this name is empty, no FID is stored.

Definition at line 159 of file otbOGRDataToSamplePositionFilter.h.

◆ m_Samplers

template<class TInputImage , class TMaskImage , class TSampler >
std::vector<SamplerMapType> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::m_Samplers
private

Internal samplers

Definition at line 155 of file otbOGRDataToSamplePositionFilter.h.

◆ m_UseOriginField

template<class TInputImage , class TMaskImage , class TSampler >
bool otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::m_UseOriginField
private

Flag to enable/disable origin FID in outputs

Definition at line 162 of file otbOGRDataToSamplePositionFilter.h.


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