ImFusion C++ SDK 4.5.0
ImFusion::DataSource Struct Reference

#include <ImFusionLabels/lib/include/ImFusion/Labels/Core/DataSource.h>

Holds information about where and how data can be loaded. More...

Detailed Description

Holds information about where and how data can be loaded.

Public Member Functions

bool isOwnedByProject (const Project &p) const
 Returns whether this DataSource is stored directly in the project.
void configure (const Properties &p)
void configuration (Properties &p) const

Static Public Member Functions

static std::optional< DataSourcefromJson (const QJsonObject &json)
static std::optional< DataSourcefromImage (const SharedImageSet &sis, bool storedInProject)
 Generates a DataSource from the DataSourceComponent of the given image.

Public Attributes

std::optional< int > m_externalId
 Whether the data is stored on some external server (remote project only at the moment).
std::string m_path
 Specifies where the data can be (down)loaded from.
std::string m_loader
 Specifies how the data can be loaded into an image (i.e.
Properties m_loaderOptions
 Additional options for the loader (i.e. the configuration of the IoAlgorithm).
size_t m_imageIndex = 0
 The index of the image in case loading the path results in multiple images.
std::optional< uint64_t > m_hash
 Expected Murmur64 hash of the file.

Member Function Documentation

◆ isOwnedByProject()

bool ImFusion::DataSource::isOwnedByProject ( const Project & p) const

Returns whether this DataSource is stored directly in the project.

For local projects that means the file is part of the project directory. For remote projects the file can be directly downloaded from the Labels server.

◆ fromImage()

std::optional< DataSource > ImFusion::DataSource::fromImage ( const SharedImageSet & sis,
bool storedInProject )
static

Generates a DataSource from the DataSourceComponent of the given image.

If storedInProject is true and DataSourceComponent is missing (e.g. when the image was not loaded from a file) a default DataSource for an ImFusionFile is returned.

Member Data Documentation

◆ m_path

std::string ImFusion::DataSource::m_path

Specifies where the data can be (down)loaded from.

If empty, the file can be downloaded directly from the server or loaded directly from the filesystem inside the project path. Use DataDescriptor::absoluteDataSourcePath to get the final path. The path can also be a URL.

◆ m_loader

std::string ImFusion::DataSource::m_loader

Specifies how the data can be loaded into an image (i.e.

the id of the IoAlgorithm) If empty, loading will guess which IoAlgorithm to use which is not recommended because the same data might be loaded differently depending on the available plugins.


The documentation for this struct was generated from the following file:
  • ImFusionLabels/lib/include/ImFusion/Labels/Core/DataSource.h
Search Tab / S to search, Esc to close