diff --git a/bioio/bio_image.py b/bioio/bio_image.py index 28f236a..4ea0724 100644 --- a/bioio/bio_image.py +++ b/bioio/bio_image.py @@ -904,11 +904,20 @@ def get_image_data( See `bioio_base.transforms.reshape_data` for more details. """ - # If no out orientation, simply return current data as dask array + + # Determine if image needs to be stitched + stitching_mosaic = ( + self._reconstruct_mosaic + and biob.dimensions.DimensionNames.MosaicTile in self.reader.dims.order + ) + # direct reader sub-region read for kwarg slice. The only accepted kwargs + # is slice definitions so we can assert directly on their presence. + if dimension_order_out is not None and kwargs and not stitching_mosaic: + return self.reader.get_image_data(dimension_order_out, **kwargs) + + # Otherwise read the full image: return it as-is, or reshape/slice it. if dimension_order_out is None and not kwargs: return self.data - - # Transform and return return biob.transforms.reshape_data( data=self.data, given_dims=self.dims.order, diff --git a/pyproject.toml b/pyproject.toml index 874dbcd..445d6ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dynamic = ["version"] dependencies = [ # We always pin a specific version of bioio-base with # each release so that we avoid bioio + bioio-base misalignment. - "bioio-base~=3.3.0", + "bioio-base~=3.4.0", "dask[array]>=2021.4.1", "numpy>=1.21.0", "ome-types[lxml]>=0.4.0",