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

Add support for non-finite float handling in DICOM JSON #615

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

chrisbll971
Copy link

We encountered a few unusual DICOM files that store NaN, inf, and -inf values in float tags. These values appear to be valid according to the DICOM Standard.

This pull request adds support for serializing non-finite float values to DICOM JSON. Previously, these values were serialized to null causing the values to dissapear.

Changes:

  • Added proper handling for non-finite float values (NaN, inf, -inf) during DICOM JSON serialization.

  • Added a test to verify deserialization logic correctly parses these values from their DICOM JSON representations.

Verification:

  • Tested with several DICOM files containing NaN, inf, and -inf values.

  • Ensured that all non-finite float values remain intact after serializing and deserializing them to and from DICOM JSON and DICOM.

@Enet4 Enet4 added bug This is a bug A-lib Area: library C-json Crate: dicom-json labels Dec 15, 2024
@Enet4 Enet4 self-requested a review December 15, 2024 10:24
Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your pull requests! I just added a few minor suggestions, things should be in order once they are resolved.

@chrisbll971
Copy link
Author

Released a new version to incorporate your feedback

Copy link
Owner

@Enet4 Enet4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK! Thanks!

@Enet4 Enet4 merged commit 4a5cd91 into Enet4:master Dec 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library bug This is a bug C-json Crate: dicom-json
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants