From 76b791fa199be27434ce7dd98470ddf15c98e5c2 Mon Sep 17 00:00:00 2001 From: Thiago Franco de Moraes Date: Tue, 16 Jun 2015 10:45:14 -0300 Subject: [PATCH] Forcing project scalar_range to python int to avoid overflow errors because of numpy types --- invesalius/control.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/invesalius/control.py b/invesalius/control.py index 84a0f08..c94d0dc 100644 --- a/invesalius/control.py +++ b/invesalius/control.py @@ -433,8 +433,8 @@ class Controller(): else: proj.original_orientation = const.SAGITAL - proj.threshold_range = (header['glmin'], - header['glmax']) + proj.threshold_range = (int(header['glmin']), + int(header['glmax'])) proj.window = proj.threshold_range[1] - proj.threshold_range[0] proj.level = (0.5 * (proj.threshold_range[1] + proj.threshold_range[0])) proj.spacing = header['pixdim'][1:4] @@ -567,7 +567,7 @@ class Controller(): self.Slice.window_level = wl self.Slice.window_width = ww - scalar_range = self.matrix.min(), self.matrix.max() + scalar_range = int(self.matrix.min()), int(self.matrix.max()) Publisher.sendMessage('Update threshold limits list', scalar_range) -- libgit2 0.21.2