Repository navigation
fix(volume-rendering): upload a streamed volume to the GPU once - #1057
Merged
Merged
Conversation
❌ Deploy Preview for volview-dev failed.
|
PaulHax
force-pushed
the
volume-texture-single-upload
branch
3 times, most recently
from
November 28, 2026 20:45
06c10f9 to
d5b328c
Compare
A single DICOM file with several frames fills one slice per frame, but its chunk load reported only the first slice as updated. The 3D view patches its volume texture with the reported slices, so it showed a single frame until something uploaded the whole volume again.
The vtk.js volume mapper keys its scalar texture on the scalars' modified time. Streamed DICOM chunks patch that texture through updated extents, but the cached hash kept the time of the first, empty upload. The first rebuild after loading, such as the preset fit once the image statistics arrive or the first 3D rotation, then reallocated and uploaded the whole volume while the old texture was still alive. Record the current hash after each partial update in the vtk.js patch. That full upload also hid partial uploads of multi-component scalars, which read and sized each extent in voxels instead of values, so the patch now strides them by the component count.
PaulHax
force-pushed
the
volume-texture-single-upload
branch
from
November 29, 2026 02:39
d5b328c to
4f1d240
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a DICOM series streams into the 3D view, vtk.js allocates the volume texture and then patches it slice by slice through the volume property's updated extents. Those partial updates never refreshed the texture's stored hash, so the next time anything else rebuilt the mapper's buffers (a preset fit, a transfer function edit, interaction quality changes), vtk.js reallocated and uploaded the whole volume again. The new texture is allocated before the old one is freed, so GPU memory for the volume briefly doubles, which can exhaust integrated GPUs on large series.
Changes:
DicomChunkImagereports every frame of a multi-frame file as updated, not just the first. The full re-upload used to hide this too; without it, the 3D view showed a single frame.The new e2e spec counts full allocations of the volume texture for streamed CT and MR series and checks that a multi-frame file renders all its frames in 3D.
syntheticDicomgains a SOP Class UID option for the multi-frame case.The equivalent upstream vtk.js changes live on PaulHax/vtk-js branches
scalar-texture-streamed-hashandtexture-partial-upload-components; once they land, the next vtk.js upgrade can drop these hunks.