]> gitweb.michael.orlitzky.com - spline3.git/commitdiff
util/view-mri-data.py: minor tweaks
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 30 Apr 2024 01:30:24 +0000 (21:30 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 30 Apr 2024 01:31:05 +0000 (21:31 -0400)
util/view-mri-data.py

index 62ae9b77e8c8302f82240491509d59bcc4d6d3f4..01bddbdcfc8d91aa24f6ae3156a5d57ccb985a69 100755 (executable)
@@ -33,18 +33,19 @@ def cube_root(n):
 import numpy as np
 data = np.fromfile(sys.argv[1], dtype='>u2')
 
-original_data_length = 7143424
+original_data_length = 109*256*256
 multiplier = cube_root(len(data) // original_data_length)
 data.shape = (109*multiplier, 256*multiplier, 256*multiplier)
 data = data.T
 
 # Display the data
-mlab.figure(bgcolor=(0, 0, 0), size=(1000, 1000))
+mlab.figure( bgcolor=(0,0,0), size=(1000,1000) )
 
+# Our data is scalar (grayscale), but not equally spaced in all
+# directions.
 src = mlab.pipeline.scalar_field(data)
-
-# Our data is not equally spaced in all directions:
 src.spacing = [1, 1, 1.5]
 src.update_image_data = True
-v = mlab.pipeline.volume(src, vmax=2500, vmin=1400)
+
+mlab.pipeline.volume(src, vmin=1400, vmax=2500)
 mlab.show()