From 62c07e66c56cd23aaa29c8cf06a4ccdc9831456c Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 18 Oct 2021 09:35:53 -0400 Subject: [PATCH 1/2] set series in _to_xarray --- aicsimageio/readers/bioformats_reader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aicsimageio/readers/bioformats_reader.py b/aicsimageio/readers/bioformats_reader.py index 1a2bce3e1..3bf9b00dd 100644 --- a/aicsimageio/readers/bioformats_reader.py +++ b/aicsimageio/readers/bioformats_reader.py @@ -165,6 +165,7 @@ def physical_pixel_sizes(self) -> types.PhysicalPixelSizes: def _to_xarray(self, delayed: bool = True) -> xr.DataArray: with BioFile(self._path, **self._bf_kwargs) as rdr: # type: ignore + rdr.set_series(self.current_scene_index) image_data = rdr.to_dask() if delayed else rdr.to_numpy() _, coords = metadata_utils.get_dims_and_coords_from_ome( ome=rdr.ome_metadata, From c45bc975e578e9ade6464503acb7d3ef44e04432 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Mon, 18 Oct 2021 10:29:05 -0400 Subject: [PATCH 2/2] change setter. --- aicsimageio/readers/bioformats_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aicsimageio/readers/bioformats_reader.py b/aicsimageio/readers/bioformats_reader.py index 3bf9b00dd..0363201f3 100644 --- a/aicsimageio/readers/bioformats_reader.py +++ b/aicsimageio/readers/bioformats_reader.py @@ -165,8 +165,8 @@ def physical_pixel_sizes(self) -> types.PhysicalPixelSizes: def _to_xarray(self, delayed: bool = True) -> xr.DataArray: with BioFile(self._path, **self._bf_kwargs) as rdr: # type: ignore - rdr.set_series(self.current_scene_index) - image_data = rdr.to_dask() if delayed else rdr.to_numpy() + f = rdr.to_dask if delayed else rdr.to_numpy + image_data = f(self.current_scene_index) _, coords = metadata_utils.get_dims_and_coords_from_ome( ome=rdr.ome_metadata, scene_index=self.current_scene_index,