Skip to content

Commit

Permalink
Address deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
danielballan committed Sep 19, 2024
1 parent f285f3c commit c54e796
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tiled/adapters/tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ def read(self, slice: Optional[NDSlice] = ...) -> NDArray[Any]:
return self._seq.asarray()
if isinstance(slice, int):
# e.g. read(slice=0) -- return an entire image
return tifffile.TiffFile(self._seq.files[slice]).asarray()
return tifffile.TiffFile(self._seq[slice]).asarray()
if isinstance(slice, builtins.slice):
# e.g. read(slice=(...)) -- return a slice along the image axis
return tifffile.TiffSequence(self._seq.files[slice]).asarray()
return tifffile.TiffSequence(self._seq[slice]).asarray()
if isinstance(slice, tuple):
if len(slice) == 0:
return self._seq.asarray()
Expand All @@ -255,10 +255,10 @@ def read(self, slice: Optional[NDSlice] = ...) -> NDArray[Any]:
# Could be int or slice (0, slice(...)) or (0,....); the_rest is converted to a list
if isinstance(image_axis, int):
# e.g. read(slice=(0, ....))
arr = tifffile.TiffFile(self._seq.files[image_axis]).asarray()
arr = tifffile.TiffFile(self._seq[image_axis]).asarray()
elif image_axis is Ellipsis:
# Return all images
arr = tifffile.TiffSequence(self._seq.files).asarray()
arr = tifffile.TiffSequence(self._seq).asarray()
the_rest.insert(0, Ellipsis) # Include any leading dimensions
elif isinstance(image_axis, builtins.slice):
arr = self.read(slice=image_axis)
Expand Down

0 comments on commit c54e796

Please sign in to comment.