From 70e66c69bdd82b97a4c48ee583eed2f583b972b7 Mon Sep 17 00:00:00 2001 From: nickeener <36525811+nickeener@users.noreply.github.com> Date: Thu, 6 Apr 2023 12:35:41 -0700 Subject: [PATCH] Fix channel_axis bug in transforms.py --- cellpose/transforms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cellpose/transforms.py b/cellpose/transforms.py index 45547335..7a992662 100644 --- a/cellpose/transforms.py +++ b/cellpose/transforms.py @@ -258,7 +258,7 @@ def convert_image(x, channels, channel_axis=None, z_axis=None, x = x.squeeze() # put z axis first - if z_axis is not None and x.ndim > 2: + if z_axis is not None and x.ndim > 2 and z_axis != 0: x = move_axis(x, m_axis=z_axis, first=True) if channel_axis is not None: channel_axis += 1 @@ -770,4 +770,4 @@ def random_rotate_and_resize(X, Y=None, scale_range=1., xy = (224,224), lbl[n,1] = (-v1 * np.sin(-theta) + v2*np.cos(-theta)) lbl[n,2] = (v1 * np.cos(-theta) + v2*np.sin(-theta)) - return imgi, lbl, scale \ No newline at end of file + return imgi, lbl, scale