Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compress the output DICOM files (lossless) #30

Open
1 of 8 tasks
howff opened this issue Nov 28, 2024 · 3 comments · May be fixed by #31
Open
1 of 8 tasks

Compress the output DICOM files (lossless) #30

howff opened this issue Nov 28, 2024 · 3 comments · May be fixed by #31
Assignees
Labels
enhancement New feature or request

Comments

@howff
Copy link
Collaborator

howff commented Nov 28, 2024

The output files should be compressed losslessly, although

  • need to ensure either pyjpegls or pylibjpeg_openjpeg package is available for Python 3.6 (or use a newer Python inside the NSH)
  • need to check the UID for JPEGLossless (it's changed, see below)
  • need to ensure that IsIdentifiable can handle the compression scheme
  • need to ensure that all kinds of overlay and frame are handled (as well as mono, colour, etc)
  • need to check that PhotometricInterpretation is handled properly
  • need to check that PlanarConfiguration is handled properly
  • need to ensure that it doesn't break any of the different types of images we hold in the archive
  • need to check that the viewers which eDRIS use can handle it (surely, it's been in the standard for a long time)

See https://pydicom.github.io/pydicom/stable/guides/encoding/jpeg_ls.html
and https://pydicom.github.io/pydicom/stable/guides/encoding/jpeg_2k.html

@howff howff self-assigned this Nov 28, 2024
@howff howff added the enhancement New feature or request label Nov 28, 2024
@howff howff linked a pull request Nov 28, 2024 that will close this issue
@howff howff linked a pull request Nov 28, 2024 that will close this issue
@howff
Copy link
Collaborator Author

howff commented Nov 28, 2024

Python 3.6 doesn't have jpegls but does have openjpeg, so use JPEG2000 compression (although check its support for various image types). The NSH-2.0 environment isn't limited to Python 3.6 so can use either compression scheme.

@rkm
Copy link
Member

rkm commented Nov 28, 2024

Python 3.10 is now our current minimum version in the NSH

@howff
Copy link
Collaborator Author

howff commented Dec 9, 2024

See breaking changes in pydicom v3:
https://pydicom.github.io/pydicom/dev/release_notes/index.html#version-3-0-0
in particular:

  • The value for JPEGLossless has changed to 1.2.840.10008.1.2.4.57.

  • The encoding used when saving datasets defaults to the set Transfer Syntax UID.

  • Dataset.pixel_array will convert YCbCr Pixel Data to RGB by default when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants