From b6dae36e05d1c5e7d0eab66e0b23a8af6bf617a6 Mon Sep 17 00:00:00 2001 From: ncullen93 Date: Wed, 15 May 2024 14:15:43 +0200 Subject: [PATCH] fix grid slice --- ants/viz/plot_grid.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ants/viz/plot_grid.py b/ants/viz/plot_grid.py index 9bc5e53b..e063417d 100644 --- a/ants/viz/plot_grid.py +++ b/ants/viz/plot_grid.py @@ -158,17 +158,17 @@ def reorient_slice(x, axis): def slice_image(img, axis, idx): if axis == 0: - return img[idx, :, :] + return img[idx, :, :].numpy() elif axis == 1: - return img[:, idx, :] + return img[:, idx, :].numpy() elif axis == 2: - return img[:, :, idx] + return img[:, :, idx].numpy() elif axis == -1: - return img[:, :, idx] + return img[:, :, idx].numpy() elif axis == -2: - return img[:, idx, :] + return img[:, idx, :].numpy() elif axis == -3: - return img[idx, :, :] + return img[idx, :, :].numpy() else: raise ValueError("axis %i not valid" % axis)