From bb55cc33de35b673776ecb07d2f11af8b760d6d1 Mon Sep 17 00:00:00 2001 From: Johannes Stelzer <johannes.stelzer@tuebingen.mpg.de> Date: Thu, 15 Feb 2018 10:26:24 +0100 Subject: [PATCH] floats as index aint no good --- vviewer/Image4D.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vviewer/Image4D.py b/vviewer/Image4D.py index 2b6137c..33b5996 100644 --- a/vviewer/Image4D.py +++ b/vviewer/Image4D.py @@ -93,6 +93,7 @@ class Image4D(Image): """ if self.playing == False: if coord is not None: + coord = map(lambda x: int(x),coord) return self.image_res[coord[0],coord[1],coord[2]] else: return self.image_res[self.coord[0],self.coord[1],self.coord[2]] @@ -393,7 +394,7 @@ class Image4D(Image): """ if self.affine_res_inv is not None and self.timeseries is not None: xyz = np.array([self.coord[0], self.coord[1], self.coord[2], 1]) - map_xyz = np.dot(self.affine_res_inv, xyz) + map_xyz = np.dot(self.affine_res_inv, xyz).astype(np.int32) shp = self.image.get_data().shape # TODO: make this a shorter comparison if (map_xyz[0] >= 0 and map_xyz[0] < shp[0] and -- GitLab