feat: Support for VR type "UV" (Unsigned 64-bit Very Long)#280
Open
PolarsBear wants to merge 7 commits intocornerstonejs:masterfrom
Open
feat: Support for VR type "UV" (Unsigned 64-bit Very Long)#280PolarsBear wants to merge 7 commits intocornerstonejs:masterfrom
PolarsBear wants to merge 7 commits intocornerstonejs:masterfrom
Conversation
This may introduce issues with older versions of browsers or NodeJS, that don't support BigInt
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.
In accordance with the (not so) new DICOM metadata standards, since 2019a, as stated in PS3.5, section 6.2 (see here), the VR type "UV", or "Unsigned 64-bit Very Long" describes, as one would expect, a 64 bit unsigned integer.
There was an issue wherein upon encountering a value of VR type "UV", the reading process would be forever slightly offset, and perform incorrect reads on all further data.
To comply with these standards and avoid derailing the entire parsing process due to an incorrect read on the length value ("UV" has a 32-bit length), I offer this contribution.
I did have to use
BigInts for the 64-bit uint representation. These primitives were added only in ES2020 (as far as I'm aware), so they might break on older versions of NodeJS (before NodeJS 12) or prehistoric browser versions.Would this be a serious issue? If there is any demand for backwards compatibility, I can attempt to find a solution. Maybe a specific library for higher precision integer support?