From 210da504477f2a1d4d0ee660c13e871d3345d2bc Mon Sep 17 00:00:00 2001 From: Leander van Eekelen <47320151+leandervaneekelen@users.noreply.github.com> Date: Mon, 5 Dec 2022 17:04:48 +0100 Subject: [PATCH 1/2] Add more compatibility try/excepts --- wholeslidedata/accessories/asap/imagewriter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wholeslidedata/accessories/asap/imagewriter.py b/wholeslidedata/accessories/asap/imagewriter.py index af0dcc1..d246a6d 100644 --- a/wholeslidedata/accessories/asap/imagewriter.py +++ b/wholeslidedata/accessories/asap/imagewriter.py @@ -165,16 +165,18 @@ def write(self, path, spacing, dimensions, tile_shape, jpeg_quality=80): self.openFile(self._path) self.setTileSize(self._tile_shape[0]) - self.setCompression(mir.JPEG) self.setJPEGQuality(jpeg_quality) - self.setInterpolation(mir.NearestNeighbor) try: self.setDataType(mir.DataType_UChar) self.setColorType(mir.ColorType_RGB) + self.setCompression(mir.Compression_JPEG) + self.setInterpolation(mir.Interpolation_NearestNeighbor) except: self.setDataType(mir.UChar) self.setColorType(mir.RGB) + self.setCompression(mir.JPEG) + self.setInterpolation(mir.NearestNeighbor) # set writing spacing pixel_size_vec = mir.vector_double() From 578b11e202860d2ad8bf26481e20ea22174dadb3 Mon Sep 17 00:00:00 2001 From: martvanrijthoven Date: Mon, 9 Jan 2023 11:44:13 +0100 Subject: [PATCH 2/2] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 874f9e6..c8ed707 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ "opencv-python-headless>=4.4.0", "scipy>=1.5.2", "scikit-image>=0.17.2", - "shapely>=1.7.1", + "shapely==1.7.1", "openslide-python>=1.1.1", "PyYAML>=5.4.1", "jsonschema>=4.4.0",