--- /dev/null
+#!/usr/bin/python2
+
+"""
+Display volumetric data from the Stanford Volume Data Archive. The
+data (layers) are expected to be concatenated together.
+"""
+
+from mayavi import mlab
+import os
+import sys
+
+def usage():
+ binary = sys.argv[0]
+ print "Usage:", binary, "<data file>"
+
+if len(sys.argv) < 2:
+ usage()
+ raise SystemExit
+
+
+def cube_root(n):
+ """
+ For integers, this probably even works.
+ """
+ for x in range(0,n+1):
+ if x**3 == n:
+ return x
+
+ return None
+
+
+# Read the data in a numpy 3D array
+import numpy as np
+data = np.fromfile(sys.argv[1], dtype='>u2')
+
+original_data_length = 7143424
+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))
+
+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.show()