From d29ee698f33ebdd7929ef88ce487f6057160880e Mon Sep 17 00:00:00 2001 From: cooperlab Date: Tue, 10 Oct 2023 13:52:51 -0500 Subject: [PATCH] try to use tiff source first --- histomics_stream/configure.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/histomics_stream/configure.py b/histomics_stream/configure.py index 28c5504..e311b31 100644 --- a/histomics_stream/configure.py +++ b/histomics_stream/configure.py @@ -184,10 +184,14 @@ def __call__(self, slide): # Do the work. if not re.compile(r"\.zarr$").search(filename): - import large_image - - # read whole-slide image file and create large_image object - ts = large_image.open(filename) + + # create large_image, prioritizing tiff source over openslide + try: + import large_image_source_tiff + ts = large_image_source_tiff.open(filename) + except: + import large_image + ts = large_image.open(filename) # scan_magnification = highest available magnification from source scan_magnification = float(ts.getNativeMagnification()["magnification"])