fix(dicom): build valid DICOM when reading tags#737
Merged
Conversation
Contributor
floryst
commented
May 9, 2025
- dicom parser now exposes element hooks
- extract implicit or explicit VR
- build an empty PixelData tag for metadata parsing
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
PaulHax
approved these changes
May 12, 2025
Comment on lines
+88
to
+92
| // itk.wasm/GDCM requires valid pixel data to be present, so we need to | ||
| // generate fake pixel data. Valid means valid length and VR. | ||
| // It turns out that encapsulated pixel data structures are parsed, even if | ||
| // the pixel data itself is not touched. This does not work well with | ||
| // metadata streaming. |
Collaborator
There was a problem hiding this comment.
Nice, how did you put your finger on this? Debug into WASM?
Contributor
Author
There was a problem hiding this comment.
A mix of debugging WASM and looking at GDCM source. In particular, I found that GDCM requires the PixelData tag (https://github.com/InsightSoftwareConsortium/ITK/blob/b3f104ddae4061de221dd5dfb23d51a98d4b2092/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmSerieHelper.cxx#L137C3-L140C23) and that ImageReader was crashing on parsing an incomplete Encapsulated Pixel Data value.
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.