dicom-rs icon indicating copy to clipboard operation
dicom-rs copied to clipboard

Encoding to JPEG transfer syntaxes

Open Enet4 opened this issue 3 years ago • 2 comments

Decoding JPEG-based transfer syntaxes is already supported, but support for encoding a native DICOM object to JPEG would be good to have.

In a first phase, this amounts to implementing the encode method of the PixelRWAdapter implementation for JPEGAdapter.

  • [x] Encode to JPEG baseline (done via #303)
  • [ ] Encode to JPEG extended (12-bit)
  • [ ] Encode to JPEG lossless
  • [x] Encode to JPEG-LS (#573)
  • [ ] Encode to JPEG 2000
  • [ ] Encode to HTJ2K
  • [x] Encode to JPEG XL (#571 via zune-jpegxl, lossless encoding only)

Enet4 avatar Oct 02 '22 14:10 Enet4

I think I can take this issue.

Is there a way to test this new implementation after it is finished?

Almeida-a avatar Oct 25 '22 11:10 Almeida-a

Great!

Is there a way to test this new implementation after it is finished?

By lack of a proper transcoding module (efforts are ongoing!), we can test the adapter in isolation by encoding one of the test files, reading the output as a JPEG file using the decoder and checking whether some meta-properties are correct (width, height...). Pixel data check could be done too, but we would need to allow an error margin to account for loss.

Enet4 avatar Oct 25 '22 11:10 Enet4