From 1239b41cbdf404f68c0f3a6e069e1bedcec1fbd4 Mon Sep 17 00:00:00 2001 From: Victor Hugo Souza Date: Thu, 14 Oct 2021 15:51:40 +0300 Subject: [PATCH] FIX: Add pixel spacing in inv to voxel coordinate transformation (#385) --- invesalius/data/imagedata_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invesalius/data/imagedata_utils.py b/invesalius/data/imagedata_utils.py index 7e10efe..49390c8 100644 --- a/invesalius/data/imagedata_utils.py +++ b/invesalius/data/imagedata_utils.py @@ -606,7 +606,7 @@ def convert_invesalius_to_voxel(position): :return: a vector of 3 coordinates in the voxel space """ slice = sl.Slice() - return np.array((position[0], slice.matrix.shape[1] - position[1] - 1, position[2])) + return np.array((position[0], slice.spacing[1]*(slice.matrix.shape[1] - 1) - position[1], position[2])) def convert_invesalius_to_world(position, orientation): -- libgit2 0.21.2