Skip to content

feat: Support for VR type "UV" (Unsigned 64-bit Very Long)#280

Open
PolarsBear wants to merge 7 commits intocornerstonejs:masterfrom
PolarsBear:implement-uv-vr
Open

feat: Support for VR type "UV" (Unsigned 64-bit Very Long)#280
PolarsBear wants to merge 7 commits intocornerstonejs:masterfrom
PolarsBear:implement-uv-vr

Conversation

@PolarsBear
Copy link
Copy Markdown

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant