|
19 | 19 |
|
20 | 20 | ###############################################################################
|
21 | 21 |
|
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"] |
25 | 25 | TIFF_IMAGE_DESCRIPTION_TAG_INDEX = 270
|
26 | 26 |
|
27 | 27 | ###############################################################################
|
@@ -192,7 +192,7 @@ def _merge_dim_guesses(dims_from_meta: str, guessed_dims: str) -> str:
|
192 | 192 | best_guess = []
|
193 | 193 | for dim_from_meta in dims_from_meta:
|
194 | 194 | # 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: |
196 | 196 | best_guess.append(dim_from_meta)
|
197 | 197 |
|
198 | 198 | # Dim from meta isn't recognized
|
@@ -220,7 +220,7 @@ def _guess_tiff_dim_order(self, tiff: TiffFile) -> List[str]:
|
220 | 220 | dims_from_meta = scene.pages.axes
|
221 | 221 |
|
222 | 222 | # 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): |
224 | 224 | return [d for d in dims_from_meta]
|
225 | 225 |
|
226 | 226 | # Otherwise guess the dimensions and return merge
|
|
0 commit comments