]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
util/view-mri-data.py: update for python3
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 30 Apr 2024 01:15:28 +0000 (21:15 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 30 Apr 2024 01:15:28 +0000 (21:15 -0400)
util/view-mri-data.py

index 96fbfa57b23b0d07333f541ded8832c16b947dff..62ae9b77e8c8302f82240491509d59bcc4d6d3f4 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
 
 """
 Display volumetric data from the Stanford Volume Data Archive. The
@@ -11,7 +11,7 @@ import sys
 
 def usage():
     binary = sys.argv[0]
-    print "Usage:", binary, "<data file>"
+    print(f"Usage: {binary} <data file>")
 
 if len(sys.argv) < 2:
     usage()
@@ -34,7 +34,7 @@ import numpy as np
 data = np.fromfile(sys.argv[1], dtype='>u2')
 
 original_data_length = 7143424
-multiplier = cube_root(len(data) / original_data_length)
+multiplier = cube_root(len(data) // original_data_length)
 data.shape = (109*multiplier, 256*multiplier, 256*multiplier)
 data = data.T