Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other double as explicit value representation #399

Conversation

craigberry1
Copy link
Contributor

Add reserved 2 byte padding to OtherDouble read logic and read value length as 32 bit integer per spec.

Specifically section 7.1.2 that states:
for VRs of AE, AS, AT, CS, DA, DS, DT, FL, FD, IS, LO, LT, PN, SH, SL, SS, ST, TM, UI, UL and US the Value Length Field is the 16-bit unsigned integer following the two byte VR Field. The value of the Value Length Field shall equal the length of the Value Field.

Meaning OD should be treated as:
for all other VRs the 16 bits following the two byte VR Field are reserved for use by later versions of the DICOM Standard. These reserved bytes shall be set to 0000H and shall not be used or decoded. The Value Length Field is a 32-bit unsigned integer.

@craigberry1
Copy link
Contributor Author

Not doing this causes data elements after the first OD tag to be corrupted. This means reading and writing a file with OD will not produce a valid DICOM file:

image

Copy link

netlify bot commented Aug 12, 2024

Deploy Preview for dcmjs2 ready!

Name Link
🔨 Latest commit ec823b8
🔍 Latest deploy log https://app.netlify.com/sites/dcmjs2/deploys/66ba844dad15cf0008d2212e
😎 Deploy Preview https://deploy-preview-399--dcmjs2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pieper
Copy link
Collaborator

pieper commented Aug 12, 2024

Thanks for working on this 👍

Even though it's a small file, let's put it in as a data release asset for consistency. Can you update the test, remove the dcm file and update the PR?

https://github.com/dcmjs-org/data/releases/tag/od-encoding-data

@craigberry1
Copy link
Contributor Author

Thanks for working on this 👍

Even though it's a small file, let's put it in as a data release asset for consistency. Can you update the test, remove the dcm file and update the PR?

https://github.com/dcmjs-org/data/releases/tag/od-encoding-data

Done 👍

@pieper pieper merged commit 117e3be into dcmjs-org:master Aug 12, 2024
13 checks passed
Copy link

🎉 This PR is included in version 0.34.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@craigberry1 craigberry1 deleted the other-double-as-explicit-value-representation branch September 5, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants