Skip to content

Commit

Permalink
Truncate expected axes to match tiff image shape
Browse files Browse the repository at this point in the history
  • Loading branch information
tddough98 committed Jan 4, 2021
1 parent 0f2995a commit 0b0571c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion browser/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ def _load_tiff(self):
tiff = tifffile.TiffFile(self._data)
img = tiff.asarray()
if img.ndim != len(self.axes):
raise ValueError(f'image dimensions {img.shape} do not match axes {self.axes}')
# Truncate the axes to match the image shape
self.axes = self.axes[:img.ndim]
# TODO: log this message to record that the image was reshaped
# raise ValueError(f'image dimensions {img.shape} do not match axes {self.axes}')
# Adjust Z dimension (TODO: may also be T, but Z & T not supported together)
zstack_axis = self.axes.find('Z')
if zstack_axis == -1:
Expand Down

0 comments on commit 0b0571c

Please sign in to comment.