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()