Skip to content

Trim \0 characters from photometric interpretation#451

Merged
Enet4 merged 2 commits intoEnet4:masterfrom
dougyau:photometric_interpretation_trim
Jan 17, 2024
Merged

Trim \0 characters from photometric interpretation#451
Enet4 merged 2 commits intoEnet4:masterfrom
dougyau:photometric_interpretation_trim

Conversation

@dougyau
Copy link
Copy Markdown
Contributor

@dougyau dougyau commented Jan 15, 2024

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

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.

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.

@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
Copy Markdown
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
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. 👍

@Enet4 Enet4 merged commit 7cc9689 into Enet4:master Jan 17, 2024
@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