From: Michael Orlitzky Date: Tue, 30 Apr 2024 01:15:28 +0000 (-0400) Subject: util/view-mri-data.py: update for python3 X-Git-Tag: 1.0.2~2 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=42830c416e147bfe828863b2eb7fa12940ca2ad5;p=spline3.git util/view-mri-data.py: update for python3 --- diff --git a/util/view-mri-data.py b/util/view-mri-data.py index 96fbfa5..62ae9b7 100755 --- a/util/view-mri-data.py +++ b/util/view-mri-data.py @@ -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, "" + print(f"Usage: {binary} ") 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