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

Trim \0 characters from photometric interpretation #451

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

dougyau
Copy link
Contributor

@dougyau dougyau commented Jan 15, 2024

trim() does not remove \0 characters, it needs to be done using trim_matches.

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.

The presence of null characters in this element value is not fully compliant, but we can accommodate this the same way we already did for a few other values such as UIDs.

We can use the same condition too.

pixeldata/src/attribute.rs Outdated Show resolved Hide resolved
@Enet4 Enet4 added enhancement A-lib Area: library C-pixeldata Crate: dicom-pixeldata labels Jan 16, 2024
Trim the whitestpaces and null characters in 1 go

Co-authored-by: Eduardo Pinho <enet4mikeenet@gmail.com>
@dougyau
Copy link
Contributor Author

dougyau commented Jan 16, 2024

Yes, null characters should not be there, but I have found a specific case, and Osko Xmaru Series CR which sends it that way.

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. 👍

@Enet4 Enet4 merged commit 7cc9689 into Enet4:master Jan 17, 2024
4 checks passed
@dougyau dougyau deleted the photometric_interpretation_trim branch September 16, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lib Area: library C-pixeldata Crate: dicom-pixeldata enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants