Skip to content

Commit e5b26b9

Browse files
committed
fix #1153 img shape in gui
1 parent f4983ec commit e5b26b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cellpose/io.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ def imread_2D(img_file):
230230
"""
231231
img = imread(img_file)
232232

233+
# force XYC:
234+
if img.shape[0] < img.shape[-1]:
235+
# move channel to last dim:
236+
img = np.moveaxis(img, 0, -1)
237+
233238
if img.ndim == 3:
234239
if img.shape[2] == 3:
235240
# already has 3 channels

0 commit comments

Comments
 (0)