Skip to content

Commit

Permalink
fix grid slice
Browse files Browse the repository at this point in the history
  • Loading branch information
ncullen93 committed May 15, 2024
1 parent 631974b commit b6dae36
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ants/viz/plot_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit b6dae36

Please sign in to comment.