Skip to content
Snippets Groups Projects
Commit bb55cc33 authored by Johannes Stelzer's avatar Johannes Stelzer
Browse files

floats as index aint no good

parent 2798f7d8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment