From 1241354169be191bb0ecdb5dd9b8ab540c5b1b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dimitri=20Fabr=C3=A8ges?= Date: Thu, 9 Oct 2025 14:49:06 +0200 Subject: [PATCH] Fix: always using `io.omread_3D` when `channel_axis` > 0 In CLI mode, when using 4D images, the image was always opened with `io.imread_3D` when `channel_axis` had a truthy value. The result was an unwanted swap between the last axis and the channel axis. --- cellpose/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellpose/__main__.py b/cellpose/__main__.py index 5ca07bbd..2237fbb0 100644 --- a/cellpose/__main__.py +++ b/cellpose/__main__.py @@ -210,7 +210,7 @@ def _evaluate_cellposemodel_cli(args, logger, imf, device, pretrained_model, nor logger.info('loading image as 3D zstack') # guess at channels/z axis if one is not provided - if channel_axis or z_axis is None: + if channel_axis is None or z_axis is None: image = io.imread_3D(image_name) else: image = io.imread(image_name) # Rely on transforms.convert_image() to move channels inside of .eval()