Add a basic API to Volume to track what data is currently needed to draw the image given the state of the viewer, and use it to enable context-aware single-slice loading (!!).
Volume gets new properties: loader, channelLoadCallback, and loadSpecRequired. The first two of these allow Volumes to issue load requests all by themselves. loadSpecRequired is a second loadSpec that tracks the subset of data which is necessary to display the current image.
Volume gets a new method: updateRequiredData. This applies changes to loadSpecRequired, and issues a load request when new data is needed.
View3d's setTime method now makes use of updateRequiredData
VolumeRenderImpls call updateRequiredData to allow single-slice loading: Atlas2DSlice calls it on construction and when z-slice changes to request a single z-slice, and all other implementations call it on construction to reset the required data to the full extent of the volume.
To accommodate Volume's new data loading responsibilities, IVolumeLoader gets a new API: callbacks for when single channels load are passed into createVolume, rather than loadVolumeData, so that Volume can store them. It is still possible to pass a callback to loadVolumeData, in which case both will run. But only the callback passed to createVolume will be run when a volume decides to load new data via updateRequiredData, which should almost always be the right behavior for such a callback.
Add a basic API to
Volume
to track what data is currently needed to draw the image given the state of the viewer, and use it to enable context-aware single-slice loading (!!).Volume
gets new properties:loader
,channelLoadCallback
, andloadSpecRequired
. The first two of these allowVolume
s to issue load requests all by themselves.loadSpecRequired
is a secondloadSpec
that tracks the subset of data which is necessary to display the current image.Volume
gets a new method:updateRequiredData
. This applies changes toloadSpecRequired
, and issues a load request when new data is needed.View3d
'ssetTime
method now makes use ofupdateRequiredData
VolumeRenderImpl
s callupdateRequiredData
to allow single-slice loading:Atlas2DSlice
calls it on construction and when z-slice changes to request a single z-slice, and all other implementations call it on construction to reset the required data to the full extent of the volume.Volume
's new data loading responsibilities,IVolumeLoader
gets a new API: callbacks for when single channels load are passed intocreateVolume
, rather thanloadVolumeData
, so thatVolume
can store them. It is still possible to pass a callback toloadVolumeData
, in which case both will run. But only the callback passed tocreateVolume
will be run when a volume decides to load new data viaupdateRequiredData
, which should almost always be the right behavior for such a callback.