Skip to content

Commit

Permalink
Fix uint8 overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
vjf committed Oct 9, 2024
1 parent be14e07 commit 048395b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/lib/imports/gocad/volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,11 @@ def read_volume_binary_files(self):
prop_obj.assign_to_ijk((x_val, y_val, z_val), data_val)
# NB: Minimum is calculated assuming the spectrum is used for data, but
# assumes that red > green > blue, so that red colours indicate greater intensity etc.
if data_val[3] > 0 and data_val[0]*256*256+data_val[1]*256+data_val[2] < min_val[0]*256*256+min_val[1]*256+min_val[2]:
min_val = data_val
try:
if data_val[3] > 0 and int(data_val[0])*256*256+int(data_val[1])*256+int(data_val[2]) < min_val[0]*256*256+min_val[1]*256+min_val[2]:
min_val = data_val
except ValueError:
pass

fp_idx += 1
# If SGRID
Expand Down

0 comments on commit 048395b

Please sign in to comment.