![]() |
OTB
10.0.0
Orfeo Toolbox
|
#include <otbPersistentSamplingFilterBase.h>
Classes | |
struct | SimpleFieldDefn |
struct | VectorThreadStruct |
Public Types | |
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 |
![]() | |
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 | |
const TMaskImage * | GetMask () |
virtual const char * | GetNameOfClass () const |
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 | Reset (void)=0 |
virtual void | Synthetize (void)=0 |
std::string | m_FieldName |
int | m_FieldIndex |
int | m_LayerIndex |
std::string | m_OutLayerName |
std::vector< std::string > | m_OGRLayerCreationOptions |
std::vector< SimpleFieldDefn > | m_AdditionalFields |
std::vector< OGRDataPointer > | m_InMemoryInputs |
std::vector< std::vector< OGRDataPointer > > | m_InMemoryOutputs |
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 () |
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 | ProcessSample (const ogr::Feature &feature, typename TInputImage::IndexType &imgIndex, typename TInputImage::PointType &imgPoint, 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 | DispatchInputVectors (void) |
virtual void | GatherOutputVectors (void) |
virtual void | FillOneOutput (unsigned int outIdx, ogr::DataSource *outDS, bool update) |
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) |
static itk::ITK_THREAD_RETURN_TYPE | VectorThreaderCallback (void *arg) |
PersistentSamplingFilterBase (const Self &)=delete | |
void | operator= (const Self &)=delete |
Additional Inherited Members | |
![]() | |
PersistentImageFilter () | |
void | PrintSelf (std::ostream &os, itk::Indent indent) const override |
virtual void | VerifyInputInformation () const |
~PersistentImageFilter () override | |
Base class for persistent filter doing sampling tasks.
Definition at line 43 of file otbPersistentSamplingFilterBase.h.
typedef itk::SmartPointer<const Self> otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::ConstPointer |
Definition at line 50 of file otbPersistentSamplingFilterBase.h.
typedef TInputImage otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::InputImageType |
Template parameters typedefs
Definition at line 56 of file otbPersistentSamplingFilterBase.h.
typedef TMaskImage otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::MaskImageType |
Definition at line 57 of file otbPersistentSamplingFilterBase.h.
typedef ogr::DataSource::Pointer otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::OGRDataPointer |
Definition at line 61 of file otbPersistentSamplingFilterBase.h.
typedef itk::SmartPointer<Self> otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::Pointer |
Definition at line 49 of file otbPersistentSamplingFilterBase.h.
typedef TInputImage::RegionType otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::RegionType |
Definition at line 59 of file otbPersistentSamplingFilterBase.h.
typedef PersistentSamplingFilterBase otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::Self |
Standard typedefs
Definition at line 47 of file otbPersistentSamplingFilterBase.h.
typedef PersistentImageFilter<TInputImage, TInputImage> otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::Superclass |
Definition at line 48 of file otbPersistentSamplingFilterBase.h.
|
protected |
Constructor
Definition at line 37 of file otbPersistentSamplingFilterBase.hxx.
|
inlineoverrideprotected |
Destructor
Definition at line 105 of file otbPersistentSamplingFilterBase.h.
|
privatedelete |
Field name containing the class name
|
overrideprotected |
Allocate in-memory layers for input and outputs
Definition at line 178 of file otbPersistentSamplingFilterBase.hxx.
|
protected |
Clear current additional fields
Definition at line 758 of file otbPersistentSamplingFilterBase.hxx.
|
protected |
Create a new additional field
Definition at line 764 of file otbPersistentSamplingFilterBase.hxx.
References otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SimpleFieldDefn::Name, otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SimpleFieldDefn::Precision, otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SimpleFieldDefn::Type, and otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SimpleFieldDefn::Width.
|
protectedvirtual |
Method to split the input OGRDataSource between several containers for each thread. Default is to put the same number of features for each thread.
Reimplemented in otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >.
Definition at line 620 of file otbPersistentSamplingFilterBase.hxx.
References otb::ogr::Layer::begin(), otb::ogr::Layer::end(), otb::ogr::Layer::GetFeatureCount(), otb::ogr::DataSource::GetLayer(), otb::ogr::Layer::GetLayerDefn(), otb::ogr::Feature::SetFID(), otb::ogr::Feature::SetFrom(), and otb::ogr::Layer::SetSpatialFilter().
|
protected |
Process a geometry, recursive method when the geometry is a collection
Definition at line 349 of file otbPersistentSamplingFilterBase.hxx.
References otbWarningMacro.
|
protected |
Get the region bounding a set of features
Definition at line 581 of file otbPersistentSamplingFilterBase.hxx.
|
protectedvirtual |
Fill output vectors for a particular output
Reimplemented in otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >.
Definition at line 273 of file otbPersistentSamplingFilterBase.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().
|
protectedvirtual |
Gather the content of in-memory output layer into the filter outputs
Definition at line 248 of file otbPersistentSamplingFilterBase.hxx.
References otb::Stopwatch::GetElapsedMilliseconds(), otbMsgDebugMacro, otb::Stopwatch::StartNew(), and otb::Stopwatch::Stop().
|
overrideprotected |
Generate data should thread over
Definition at line 150 of file otbPersistentSamplingFilterBase.hxx.
|
overrideprotected |
Use an empty region to input image (pixel values not needed) and set the requested region for the mask
Definition at line 131 of file otbPersistentSamplingFilterBase.hxx.
|
overrideprotected |
Use the same output information as input image, check the field index and the mask footprint
Definition at line 97 of file otbPersistentSamplingFilterBase.hxx.
|
protected |
Get a reference over the additional fields
Definition at line 776 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Get macro for the field index (deduced from the field name)
|
virtual |
Field name containing the class name
|
protected |
Give access to in-memory input layers
Definition at line 801 of file otbPersistentSamplingFilterBase.hxx.
|
protected |
Give access to in-memory output layers
Definition at line 811 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Field name containing the class name
const TMaskImage * otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::GetMask |
Get the input mask (may be null)
Definition at line 74 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Creation through object factory macro
Reimplemented from otb::PersistentImageFilter< TInputImage, TInputImage >.
Reimplemented in otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >, otb::PersistentOGRDataToClassStatisticsFilter< TInputImage, TMaskImage >, and otb::PersistentImageSampleExtractorFilter< TInputImage >.
const otb::ogr::DataSource * otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::GetOGRData |
Get the input OGRDataSource with sampling regions
Definition at line 58 of file otbPersistentSamplingFilterBase.hxx.
const std::vector< std::string > & otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::GetOGRLayerCreationOptions | ( | void | ) |
Get the OGR layer creation options
Definition at line 91 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Field name containing the class name
|
protectedvirtual |
Utility method to add new fields on an output layer
Definition at line 683 of file otbPersistentSamplingFilterBase.hxx.
References otb::ogr::Layer::CreateField(), otb::ogr::DataSource::CreateLayer(), otb::ogr::DataSource::GetLayer(), otb::ogr::Layer::GetLayerDefn(), otb::ogr::FieldDefn::GetName(), otb::ogr::Layer::GetName(), otb::ogr::Layer::GetProjectionRef(), and otb::ogr::FieldDefn::GetType().
|
inlineprotected |
Common function to test if a point is inside a polygon
Definition at line 550 of file otbPersistentSamplingFilterBase.hxx.
|
inlineprotected |
Common function to test if a pixel crosses the line
Definition at line 568 of file otbPersistentSamplingFilterBase.hxx.
|
privatedelete |
Field name containing the class name
|
protectedvirtual |
Generic method called once before processing each feature
Reimplemented in otb::PersistentOGRDataToClassStatisticsFilter< TInputImage, TMaskImage >.
Definition at line 544 of file otbPersistentSamplingFilterBase.hxx.
|
protectedvirtual |
Process a line string : use pixels that cross the line
Definition at line 427 of file otbPersistentSamplingFilterBase.hxx.
|
protectedvirtual |
Process a polygon : use pixels inside the polygon
Definition at line 486 of file otbPersistentSamplingFilterBase.hxx.
|
protectedvirtual |
Generic method called for each matching pixel position (NOT IMPLEMENTED)
Reimplemented in otb::PersistentOGRDataToSamplePositionFilter< TInputImage, TMaskImage, TSampler >, and otb::PersistentOGRDataToClassStatisticsFilter< TInputImage, TMaskImage >.
Definition at line 537 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Set/Get macro for the field name containing class names in the input vectors.
|
virtual |
Set/Get macro for the layer index containing the sampling areas
void otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SetMask | ( | const TMaskImage * | mask | ) |
Set an input mask (optional)
Definition at line 68 of file otbPersistentSamplingFilterBase.hxx.
void otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SetOGRData | ( | const ogr::DataSource * | vector | ) |
Set the input OGRDataSource that contains sampling areas for each class
Definition at line 52 of file otbPersistentSamplingFilterBase.hxx.
void otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::SetOGRLayerCreationOptions | ( | const std::vector< std::string > & | options | ) |
Set the OGR layer creation options
Definition at line 84 of file otbPersistentSamplingFilterBase.hxx.
|
virtual |
Set/Get macro for the layer name
|
protectedvirtual |
Start of main processing loop
Reimplemented in otb::PersistentImageSampleExtractorFilter< TInputImage >.
Definition at line 322 of file otbPersistentSamplingFilterBase.hxx.
References otb::ogr::Layer::begin(), otb::ogr::Layer::end(), and otb::ogr::Layer::GetFeatureCount().
|
staticprotected |
Callback function to launch VectorThreadedGenerateData in each thread
Definition at line 784 of file otbPersistentSamplingFilterBase.hxx.
References otb::PersistentSamplingFilterBase< TInputImage, TMaskImage >::VectorThreadStruct::Filter.
|
private |
Additional field definitions to add in output data sources
Definition at line 217 of file otbPersistentSamplingFilterBase.h.
|
private |
Field index corresponding to the field name m_FieldName
Definition at line 205 of file otbPersistentSamplingFilterBase.h.
|
private |
Field name containing the class name
Definition at line 202 of file otbPersistentSamplingFilterBase.h.
|
private |
In-memory containers storing input geometries for each thread
Definition at line 220 of file otbPersistentSamplingFilterBase.h.
|
private |
In-memory containers storing position during iteration loop
Definition at line 223 of file otbPersistentSamplingFilterBase.h.
|
private |
Layer to use in the input vector file, default to 0
Definition at line 208 of file otbPersistentSamplingFilterBase.h.
|
private |
Creation option for output layers
Definition at line 214 of file otbPersistentSamplingFilterBase.h.
|
private |
name of the output layers
Definition at line 211 of file otbPersistentSamplingFilterBase.h.