Skip to content

Commit c0d3f8f

Browse files
committed
Fix getting shape for single-channel TIF files during import
Use the array dimensions directly for this shape rather than the shape from the channel setup.
1 parent 7cc4364 commit c0d3f8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

magmap/io/importer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def import_multiplane_images(
11161116
# load TIF file
11171117
img5d = np_io.read_tif(img_path)
11181118
if img5d.img is not None:
1119-
img_raw = img5d.img[0] # assume first series
1119+
img_raw = img5d.img[0] # assume first time point
11201120

11211121
elif _is_raw(img_path):
11221122
# open image file as a RAW 3D array
@@ -1150,7 +1150,7 @@ def import_multiplane_images(
11501150
.format(t, z, chl_load), fn_feedback)
11511151
if img_raw is not None:
11521152
# access plane from RAW or TIF file
1153-
img = (img_raw[z, ..., chl_load] if len_shape_in >= 5
1153+
img = (img_raw[z, ..., chl_load] if img_raw.ndim >= 4
11541154
else img_raw[z])
11551155
else:
11561156
# read plane with Bioformats reader; chl_load may be

0 commit comments

Comments
 (0)