Skip to content

Broken pixel_data fix: support parsing improperly closed encapsulated pixel data#607

Merged
Enet4 merged 2 commits intoEnet4:masterfrom
jmlaka:broken_pixel_data
Dec 7, 2024
Merged

Broken pixel_data fix: support parsing improperly closed encapsulated pixel data#607
Enet4 merged 2 commits intoEnet4:masterfrom
jmlaka:broken_pixel_data

Conversation

@jmlaka
Copy link
Copy Markdown
Contributor

@jmlaka jmlaka commented Nov 26, 2024

Hello @Enet4 .
So I stumbled upon some Dicom files produced on a new Siemens machine and was unable to open them with Dcmtk, Pydicom nor dicom-rs.

I found this (fix](fo-dicom/fo-dicom#1718)) that addressed the very same issue inside fo-dicom.

By reading your code and applying this little hack, I was able to get the files working.

Would you be willing to incorporate such a fix and document it please ?

This is a sample Dicom from the machine:
Anonymised.zip

Thank you

@jmlaka jmlaka marked this pull request as ready for review November 27, 2024 17:54
@Enet4 Enet4 added A-lib Area: library C-parser Crate: dicom-parser compatibility This concerns robustness to other DICOM implementations labels Dec 7, 2024
@Enet4 Enet4 changed the title Broken pixel_data fix Broken pixel_data fix: support parsing improperly closed encapsulated pixel data Dec 7, 2024
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.

From reading the other issues at fo-dicom and inspecting that DICOM file I interpret that the device is producing a non-standard way of delimiting the end of the pixel data. The proposed solution of gracefully ending the token stream when reaching EOF while in a pixel data fragment sequence is simple and does not seem to negatively affect anything else, so it is OK to incorporate this fix.

Much appreciated. 👍

@Enet4 Enet4 merged commit c4f57c7 into Enet4:master Dec 7, 2024
@jmlaka jmlaka deleted the broken_pixel_data branch December 26, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-lib Area: library C-parser Crate: dicom-parser compatibility This concerns robustness to other DICOM implementations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants