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.
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 ofpydicom.pixel_array
would match the input into the encoding function. Now that we figured out why the color space ofpydicom.pixel_array
is incorrect (unexpected), we can resolve the mystery of why we had to convert the color space during encoding.