Skip to content

Commit 05eb94e

Browse files
authored
Handle the case of a single TIFF image
1 parent 54c3664 commit 05eb94e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

nanshe/io/xtiff.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ def get_standard_tiff_data(new_tiff_filename,
307307
elif (new_tiff_array.ndim == 4):
308308
# Has no z. So, add this.
309309
new_tiff_array = xnumpy.add_singleton_axis_beginning(new_tiff_array)
310+
elif (new_tiff_array.ndim == 2):
311+
# Has no z, channel or time. So, add these.
312+
new_tiff_array = xnumpy.add_singleton_axis_beginning(new_tiff_array)
313+
new_tiff_array = xnumpy.add_singleton_axis_end(new_tiff_array)
314+
new_tiff_array = xnumpy.add_singleton_axis_end(new_tiff_array)
310315
else:
311316
raise Exception(
312317
"Invalid dimensionality for TIFF. Found shape to be \"" +

0 commit comments

Comments
 (0)