Skip to content

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

Merged
Enet4 merged 2 commits intoEnet4:masterfrom
chrisbll971:non_finite_float_handling
Dec 23, 2024
Merged

Add support for non-finite float handling in DICOM JSON#615
Enet4 merged 2 commits intoEnet4:masterfrom
chrisbll971:non_finite_float_handling

Conversation

@chrisbll971
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Author

Released a new version to incorporate your feedback

Copy link
Copy Markdown
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
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