Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::hdf5::HDF5TemporalVolumeLoader Class Reference

A VolumeLoader that reads one time-varying HDF5 dataset with rank >= 4, treating one dimension as the time axis and the remaining three as the volume axes. More...

#include <modules/hdf5/hdf5temporalvolumeloader.h>

+ Inheritance diagram for inviwo::hdf5::HDF5TemporalVolumeLoader:

Public Member Functions

 HDF5TemporalVolumeLoader (Handle handle, std::vector< Selection > selection, size_t timeDimension, Seconds dt, VolumeConfig config)
 
virtual std::shared_ptr< Volume > load (size_t index, std::shared_ptr< Volume > reuse, std::stop_token stop) const override
 
virtual VolumeConfig prototype () const override
 
virtual size_t size () const override
 Total number of frames.
 
virtual Seconds time (size_t index) const override
 
- Public Member Functions inherited from inviwo::TemporalVolumeLoader
TemporalVolumeLoader & operator= (const TemporalVolumeLoader &)=default
 
TemporalVolumeLoader & operator= (TemporalVolumeLoader &&)=default
 
 TemporalVolumeLoader (const TemporalVolumeLoader &)=default
 
 TemporalVolumeLoader (TemporalVolumeLoader &&)=default
 

Detailed Description

A VolumeLoader that reads one time-varying HDF5 dataset with rank >= 4, treating one dimension as the time axis and the remaining three as the volume axes.

selection must have one entry per dataset dimension in column major (Inviwo) order, i.e. [extraDims..., X, Y, Z], as returned by DimSelectionsProperty::getSelection(). The entry at timeDimension is re-targeted per frame; every other "extra" entry (i.e. every entry before the trailing X/Y/Z ones) must clamp to a single index, or construction throws.

Note
load() serializes all HDF5 access via an internal mutex since the underlying HDF5 C library is not guaranteed to be safe for concurrent use from the background thread pool that TemporalVolume may invoke load() from.

Constructor & Destructor Documentation

◆ HDF5TemporalVolumeLoader()

inviwo::hdf5::HDF5TemporalVolumeLoader::HDF5TemporalVolumeLoader ( Handle handle,
std::vector< Selection > selection,
size_t timeDimension,
Seconds dt,
VolumeConfig config )
Parameters
handleHDF5 handle already pointing at the dataset to read
selectionone Selection per dataset dimension, column major order
timeDimensionindex into selection designating the time axis
dttime between consecutive frames
configthe prototype VolumeConfig to use

Member Function Documentation

◆ load()

virtual std::shared_ptr< Volume > inviwo::hdf5::HDF5TemporalVolumeLoader::load ( size_t index,
std::shared_ptr< Volume > reuse,
std::stop_token stop ) const
overridevirtual

Load the volume at the given index. May be called from a background thread, hence implementations must be re-entrant and thread-safe.

Parameters
reusean optional volume whose storage may be reused to avoid reallocation. It may be null and must be ignored if its format or dimensions do not match the frame.
stopcancellation token. Implementations should poll stop.stop_requested() at natural checkpoints and return nullptr as soon as a stop is requested. A partially written reuse volume is discarded by the caller.
Returns
the loaded volume, or nullptr if the load was cancelled.

Implements inviwo::TemporalVolumeLoader.

◆ prototype()

virtual VolumeConfig inviwo::hdf5::HDF5TemporalVolumeLoader::prototype ( ) const
overridevirtual

A prototype VolumeConfig describing dimensions, format, basis, dataMap, and axes — but no voxel data. Used by downstream consumers that need metadata without triggering a load.

Implements inviwo::TemporalVolumeLoader.

◆ size()

virtual size_t inviwo::hdf5::HDF5TemporalVolumeLoader::size ( ) const
overridevirtual

Total number of frames.

Implements inviwo::TemporalVolumeLoader.

◆ time()

virtual Seconds inviwo::hdf5::HDF5TemporalVolumeLoader::time ( size_t index) const
overridevirtual

Physical time value for frame index. The values are expected to be sorted in ascending order.

Implements inviwo::TemporalVolumeLoader.


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