Skip to content

Commit 7f68dd9

Browse files
authored
bugfix/handle-tiff-i-dim (#445)
1 parent 8099b70 commit 7f68dd9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

aicsimageio/readers/tiff_reader.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
###############################################################################
2121

22-
# "Q" is used by Gohlke to say "unknown dimension"
23-
# https://github.com/cgohlke/tifffile/blob/master/tifffile/tifffile.py#L10840
24-
UNKNOWN_DIM_CHAR = "Q"
22+
# "Q" is used by tifffile to say "unknown dimension"
23+
# "I" is used to mean a generic image sequence
24+
UNKNOWN_DIM_CHARS = ["Q", "I"]
2525
TIFF_IMAGE_DESCRIPTION_TAG_INDEX = 270
2626

2727
###############################################################################
@@ -192,7 +192,7 @@ def _merge_dim_guesses(dims_from_meta: str, guessed_dims: str) -> str:
192192
best_guess = []
193193
for dim_from_meta in dims_from_meta:
194194
# Dim from meta is recognized, add it
195-
if dim_from_meta != UNKNOWN_DIM_CHAR:
195+
if dim_from_meta not in UNKNOWN_DIM_CHARS:
196196
best_guess.append(dim_from_meta)
197197

198198
# Dim from meta isn't recognized
@@ -220,7 +220,7 @@ def _guess_tiff_dim_order(self, tiff: TiffFile) -> List[str]:
220220
dims_from_meta = scene.pages.axes
221221

222222
# If all dims are known, simply return as list
223-
if UNKNOWN_DIM_CHAR not in dims_from_meta:
223+
if all(i not in UNKNOWN_DIM_CHARS for i in dims_from_meta):
224224
return [d for d in dims_from_meta]
225225

226226
# Otherwise guess the dimensions and return merge

0 commit comments

Comments
 (0)