ImagingDataCommons / highdicom

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

Make pylibjpeg-libjpeg optional #201

Closed CPBridge closed 1 year ago

CPBridge commented 1 year ago

Highdicom is licensed under the permissive MIT license to allow users to use in their own applications, regardless of licence.

Unfortunately, it currently depends on pylibjpeg-libjpeg, which is GPL v3 licensed. This effectively means that many users cannot use highdicom. Luckily highdicom only uses pylibjpeg-libjpeg indirectly through pydicom and only in a few specific cases (decoding pixel data with a few specific transfer syntaxes).

This PR moves pylibjpeg-libjpeg to an optional dependency, that users may install with pip install highdicom[libjpeg], and adds documentation to this effect.

It also alters the tests so that the relevant tests are automatically skipped if pylibjpeg-libjpeg is not installed. This necessitated a (long overdue) restructuring of the segmentation tests to split for loops within a single test to parameterized tests (using fixtures).

CPBridge commented 1 year ago

I also expanded the CI tests to run the test suite with and without pylibjpeg-libjpeg. With it, the full tests are run. Without it, tests that depend on it are skipped.