NKI-AI / dlup

Dlup are the Deep Learning Utilities for Pathology developed at the Netherlands Cancer Institute
Apache License 2.0
25 stars 7 forks source link

Use vips.Image rather than PIL.Image.Image #226

Closed jonasteuwen closed 5 months ago

jonasteuwen commented 6 months ago

This PR implements the conversion of PIL.Image.Image to pyvips.Image as output of the image reading classes. This has the advantage that pyvips.Image, in contrast to PIL.Image.Image supports multichannel float images. This could be multiplex imaging, but also attention and/or probability maps as outputs (using a backend that supports this).

In addition, while testing the pyvips backend, a new bug was identified in the tiff writer, which is also fixed.

Also, the pyvips backend is modified so that we can leverage the on-demand loading