Skip to content

Commit ed035ef

Browse files
authored
Merge pull request #1258 from MouseLand/fix_3d_reading_cli
Fix 3d reading cli
2 parents b9d3842 + 18ea540 commit ed035ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cellpose/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ def _evaluate_cellposemodel_cli(args, logger, imf, device, pretrained_model, nor
208208
for image_name in tqdm(image_names, file=tqdm_out):
209209
if args.do_3D or args.stitch_threshold > 0.:
210210
logger.info('loading image as 3D zstack')
211-
image = io.imread_3D(image_name)
211+
212+
# guess at channels/z axis if one is not provided
213+
if channel_axis or z_axis is None:
214+
image = io.imread_3D(image_name)
215+
else:
216+
image = io.imread(image_name) # Rely on transforms.convert_image() to move channels inside of .eval()
212217
if channel_axis is None:
213218
channel_axis = 3
214219
if z_axis is None:

0 commit comments

Comments
 (0)