Efferent-Health / fo-dicom.Codecs

Cross-platform Dicom native codecs for fo-dicom
Other
65 stars 23 forks source link

Images Corrupted in Cornerstone After Updating to 5.14.2 #80

Closed enasbond closed 2 months ago

enasbond commented 2 months ago

I have encountered an issue after upgrading [fo-dicom.Codecs] from version 5.12.0 to 5.14.2. When I attempt to change the image compression, the resulting image cannot be viewed in my viewer.

My viewer is built using Cornerstone. You can simulate this issue by trying to load the new image generated from version 5.14.2 in this viewer: (https://www.cornerstonejs.org/live-examples/localcpu).

Please note that the same code and file worked fine using Cornerstone before and version 5.12.0.

This issue is critical for me because I need to use version 5.13.0 for speed optimizations, but I cannot view the images using Cornerstone, even though it worked before.

Sample image (before and after compression to jpeg 2000 lossless and none using version 5.14.2 )

sample mg.zip

Screenshots

image

image

Environment:

jaime-olivares commented 2 months ago

We are analyzing at this moment

cbeltran1306 commented 2 months ago

Hi @enasbond, this issue has been solved, please use the latest nuget version 5.14.3. https://www.nuget.org/packages/fo-dicom.Codecs/5.14.3

enasbond commented 2 months ago

That sounds great! I just tested it, and it worked perfectly. I'll go ahead and test it on all the remaining cases I have. Thank you so much!

enasbond commented 2 months ago

Hi @cbeltran1306 I tested the new update with my sample files, but unfortunately, most of them became corrupted when converting to JPEG 2000 lossless or even to implicit VR little endian. A new issue also emerged: these corrupted files can’t be opened by other well-known software, as seen in these images.

It's worth noting that all these files worked perfectly fine with version 5.12.0. Samples.zip

image image image

cbeltran1306 commented 2 months ago

Hi @enasbond, we found the issue, it was minor fix during the JPEG lossless decoding, please use the latest nuget version 5.14.4 => https://www.nuget.org/packages/fo-dicom.Codecs/5.14.4

enasbond commented 2 months ago

Thank you so much, @cbeltran1306 , for your quick response. I really appreciate it. I will review it and keep you updated. Thanks again!