ImagingDataCommons / highdicom

High-level DICOM abstractions for the Python programming language
https://highdicom.readthedocs.io
MIT License
168 stars 35 forks source link

Fix JPEG encoding of frames #157

Closed hackermd closed 2 years ago

hackermd commented 2 years ago

With https://github.com/herrmannlab/highdicom/pull/152 we fixed the decoding of JPEG compressed frames. I just realized, however, that the encoding has also been wrong. We previously assumed that pydicom.pixel_array would decode the data correctly and thus tweaked the encoding such that the output of pydicom.pixel_array would match the input into the encoding function. Now that we figured out why the color space of pydicom.pixel_array is incorrect (unexpected), we can resolve the mystery of why we had to convert the color space during encoding.