Commit 76b791fa199be27434ce7dd98470ddf15c98e5c2
1 parent
57423e14
Exists in
master
and in
35 other branches
Forcing project scalar_range to python int to avoid overflow errors because of numpy types
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
invesalius/control.py
... | ... | @@ -433,8 +433,8 @@ class Controller(): |
433 | 433 | else: |
434 | 434 | proj.original_orientation = const.SAGITAL |
435 | 435 | |
436 | - proj.threshold_range = (header['glmin'], | |
437 | - header['glmax']) | |
436 | + proj.threshold_range = (int(header['glmin']), | |
437 | + int(header['glmax'])) | |
438 | 438 | proj.window = proj.threshold_range[1] - proj.threshold_range[0] |
439 | 439 | proj.level = (0.5 * (proj.threshold_range[1] + proj.threshold_range[0])) |
440 | 440 | proj.spacing = header['pixdim'][1:4] |
... | ... | @@ -567,7 +567,7 @@ class Controller(): |
567 | 567 | self.Slice.window_level = wl |
568 | 568 | self.Slice.window_width = ww |
569 | 569 | |
570 | - scalar_range = self.matrix.min(), self.matrix.max() | |
570 | + scalar_range = int(self.matrix.min()), int(self.matrix.max()) | |
571 | 571 | |
572 | 572 | Publisher.sendMessage('Update threshold limits list', scalar_range) |
573 | 573 | ... | ... |