cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

Fix: `io.omread_3D` used when `channel_axis` > 0

Open dimitri-fabreges opened this issue 2 months ago • 0 comments

In CLI mode, when using 4D images, the image is always opened with io.imread_3D when channel_axis has a truthy value. The result is an unwanted swap between the last axis and the channel axis.

With a ZCYX axis order, the CLI command will be run with --do_3D, --channel_axis 1 and --z_axis 0. Because channel_axis is truthy, the image will be opened with io.imread_3D causing a swap of the last axis and the channel axis. As a result, the opened image is changed to a ZXYC order, but the channel_axis variable is not updated. The later call to .eval() is therefore using the wrong channel axis (1, pointing to X), causing error in segmentation.

dimitri-fabreges avatar Oct 09 '25 12:10 dimitri-fabreges