Streaming dicomChunkImage fixes#789
Merged
PaulHax merged 6 commits intoKitware:mainfrom Sep 24, 2025
Merged
Conversation
…out-of-bounds error When loading remote DICOM files via manifest.json, chunks arrive incrementally due to parallel asynchronous processing in importDataSources. This creates a race condition where: 1. Initial chunks (e.g., 1-50) arrive and image is allocated for 50 slices 2. These chunks start loading their data 3. Additional chunks (51-100) arrive with some already having loaded data 4. Without fix: processNewChunks() attempts to write data at positions 51-100 into an array only allocated for 50 slices, causing "offset is out of bounds" 5. With fix: reallocateImage() runs first, expanding the array to accommodate all chunks before any data is written The fix ensures proper ordering: - Move reallocateImage() call before processNewChunks() - Fix index lookup in processNewChunks() to use actual chunk position instead of filtered array index This prevents RangeError when chunks arrive in multiple batches with pre-loaded data from parallel fetching.
…umberOfFrames=1 Fixed buffer overflow when loading DICOM series where each file has NumberOfFrames=1. The issue occurred when the code incorrectly used NumberOfFrames (1) instead of the actual chunk count for memory allocation, causing an offset out of bounds error when loading subsequent slices. Now correctly uses sortedChunks.length when multiple chunks are present, regardless of individual NumberOfFrames values. Also fixed z-spacing calculation to use the allocated slice count.
Trust server-provided Content-Type for JSON, DICOM, ZIP, and GZIP files instead of always using magic byte detection. Fixes manifest loading from URLs without .json extension.
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
c27bdc7 to
8333b04
Compare
8333b04 to
0367026
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.
Uh oh!
There was an error while loading. Please reload this page.