OTB
9.0.0
Orfeo Toolbox
|
#include <otbOGRDataToSamplePositionFilter.h>
Public Types | |
typedef std::map< std::string, unsigned int > | ClassPartitionType |
typedef itk::SmartPointer< const Self > | ConstPointer |
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< Self > | Pointer |
typedef InputImageType::PointType | PointType |
typedef InputImageType::RegionType | RegionType |
typedef std::map< std::string, SamplerPointerType > | SamplerMapType |
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 Self > | ConstPointer |
typedef TInputImage | InputImageType |
typedef TMaskImage | MaskImageType |
typedef ogr::DataSource::Pointer | OGRDataPointer |
typedef itk::SmartPointer< Self > | Pointer |
typedef TInputImage::RegionType | RegionType |
typedef PersistentSamplingFilterBase | Self |
typedef PersistentImageFilter< TInputImage, TInputImage > | Superclass |
Public Types inherited from otb::PersistentImageFilter< TInputImage, TInputImage > | |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef TInputImage | InputImageType |
typedef TInputImage | OutputImageType |
typedef itk::SmartPointer< Self > | Pointer |
typedef PersistentImageFilter | Self |
typedef itk::ImageToImageFilter< TInputImage, TInputImage > | Superclass |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
SamplerMapType & | GetSamplers (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::DataSource * | GetOGRData () |
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< SamplerMapType > | m_Samplers |
std::string | m_OriginFieldName |
bool | m_UseOriginField |
const otb::ogr::DataSource * | GetOutputPositionContainer (unsigned int level) const |
otb::ogr::DataSource * | GetOutputPositionContainer (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 ®ion, itk::ThreadIdType &threadid) |
virtual void | ProcessLine (const ogr::Feature &feature, OGRLineString *line, RegionType ®ion, itk::ThreadIdType &threadid) |
virtual void | ProcessPolygon (const ogr::Feature &feature, OGRPolygon *polygon, RegionType ®ion, 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) |
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.
typedef std::map<std::string, unsigned int> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ClassPartitionType |
Definition at line 79 of file otbOGRDataToSamplePositionFilter.h.
typedef itk::SmartPointer<const Self> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ConstPointer |
Definition at line 61 of file otbOGRDataToSamplePositionFilter.h.
typedef itk::DataObject::DataObjectPointerArraySizeType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::DataObjectPointerArraySizeType |
Definition at line 81 of file otbOGRDataToSamplePositionFilter.h.
typedef InputImageType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::InputImagePointer |
Definition at line 64 of file otbOGRDataToSamplePositionFilter.h.
typedef TInputImage otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::InputImageType |
Definition at line 63 of file otbOGRDataToSamplePositionFilter.h.
typedef MaskImageType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::MaskImagePointer |
Definition at line 69 of file otbOGRDataToSamplePositionFilter.h.
typedef TMaskImage otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::MaskImageType |
Definition at line 68 of file otbOGRDataToSamplePositionFilter.h.
typedef ogr::DataSource::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::OGRDataPointer |
Definition at line 72 of file otbOGRDataToSamplePositionFilter.h.
typedef ogr::DataSource otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::OGRDataType |
Definition at line 71 of file otbOGRDataToSamplePositionFilter.h.
typedef itk::SmartPointer<Self> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Pointer |
Definition at line 60 of file otbOGRDataToSamplePositionFilter.h.
typedef InputImageType::PointType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::PointType |
Definition at line 66 of file otbOGRDataToSamplePositionFilter.h.
typedef InputImageType::RegionType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::RegionType |
Definition at line 65 of file otbOGRDataToSamplePositionFilter.h.
typedef std::map<std::string, SamplerPointerType> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerMapType |
Definition at line 77 of file otbOGRDataToSamplePositionFilter.h.
typedef SamplerType::ParameterType otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerParameterType |
Definition at line 76 of file otbOGRDataToSamplePositionFilter.h.
typedef SamplerType::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerPointerType |
Definition at line 75 of file otbOGRDataToSamplePositionFilter.h.
typedef TSampler otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::SamplerType |
Definition at line 74 of file otbOGRDataToSamplePositionFilter.h.
typedef PersistentOGRDataToSamplePositionFilter otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Self |
Standard Self typedef
Definition at line 58 of file otbOGRDataToSamplePositionFilter.h.
typedef PersistentSamplingFilterBase<TInputImage, TMaskImage> otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::Superclass |
Definition at line 59 of file otbOGRDataToSamplePositionFilter.h.
|
protected |
Constructor
Definition at line 31 of file otbOGRDataToSamplePositionFilter.hxx.
|
inlineoverrideprotected |
Destructor
Definition at line 129 of file otbOGRDataToSamplePositionFilter.h.
|
privatedelete |
(internal) map associating a class name with a thread number
void otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::ClearOutputs |
Clear all output position containers
Definition at line 121 of file otbOGRDataToSamplePositionFilter.hxx.
|
private |
(internal) map associating a class name with a thread number
Definition at line 231 of file otbOGRDataToSamplePositionFilter.hxx.
virtual::itk::LightObject::Pointer otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::CreateAnother | ( | void | ) | const |
|
overrideprotectedvirtual |
Method to split the input OGRDataSource according to the class partition
Reimplemented from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >.
Definition at line 178 of file otbOGRDataToSamplePositionFilter.hxx.
References otb::ogr::Layer::begin(), otb::ogr::Layer::end(), otb::ogr::DataSource::GetLayer(), otb::ogr::Layer::GetLayerDefn(), otb::ogr::Feature::SetFID(), otb::ogr::Feature::SetFrom(), and otb::ogr::Layer::SetSpatialFilter().
|
overrideprotectedvirtual |
Fill the output vectors with a special ordering (class partition)
Reimplemented from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >.
Definition at line 281 of file otbOGRDataToSamplePositionFilter.hxx.
References otb::ogr::Layer::begin(), otb::ogr::Layer::CreateFeature(), otb::ogr::Layer::end(), otb::ogr::DataSource::GetLayer(), otb::ogr::Layer::GetLayerDefn(), otb::ogr::DataSource::GetLayersCount(), otb::ogr::Layer::ogr(), otb::ogr::Layer::SetFeature(), and otb::ogr::Feature::SetFrom().
|
virtual |
Runtime information support.
Reimplemented from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >.
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.
|
virtual |
(internal) map associating a class name with a thread number
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.
const otb::ogr::DataSource* otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >::GetOutputPositionContainer | ( | unsigned int | level | ) | const |
Get the output position container of a given level
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.
|
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().
|
static |
Method for creation through the object factory.
|
privatedelete |
(internal) map associating a class name with a thread number
|
overrideprotectedvirtual |
Call samplers on a current position, for a given class
Reimplemented from otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >.
Definition at line 150 of file otbOGRDataToSamplePositionFilter.hxx.
References otb::ogr::Layer::CreateFeature(), otb::ogr::Feature::GetFID(), otb::ogr::Layer::GetLayerDefn(), otb::ogr::Feature::ogr(), otb::ogr::Feature::SetFrom(), and otb::ogr::Feature::SetGeometry().
|
overridevirtual |
Reset method called before starting the streaming
Implements otb::PersistentImageFilter< TInputImage, TInputImage >.
Definition at line 39 of file otbOGRDataToSamplePositionFilter.hxx.
|
virtual |
Get/Set of the field name storing the original FID of each sample
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.
|
inlineoverridevirtual |
Synthesize the persistent data of the filter.
Implements otb::PersistentImageFilter< TInputImage, TInputImage >.
Definition at line 89 of file otbOGRDataToSamplePositionFilter.h.
|
private |
(internal) map associating a class name with a thread number
Definition at line 152 of file otbOGRDataToSamplePositionFilter.h.
|
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.
|
private |
Internal samplers
Definition at line 155 of file otbOGRDataToSamplePositionFilter.h.
|
private |
Flag to enable/disable origin FID in outputs
Definition at line 162 of file otbOGRDataToSamplePositionFilter.h.