Skip to content

Commit 18ea540

Browse files
committed
allow 3d shape guessing if channel_axis or z_axis not provided in cli
1 parent 79183d5 commit 18ea540

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(image_name) # Rely on transforms.convert_image() to move channels inside of .eval()
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)