title: Plot of a binary file in Python
body: <p>I have a binary file from which I have to read data. The file consists of a 128x128x243 matrix (hex-formatted) which I have read with the following code:</p>
  
  <pre><code>with open("zubal_voxel_man.dat", "rb") as fileHandle:
  
      dim_x = 128
      dim_y = 128
      dim_z = 243
  
      data = np.zeros((dim_x,dim_y,dim_z), dtype=np.int)
  
      for p in range(0, dim_x):
          for q in range (0, dim_y):
              for r in range(0, dim_z):
                  data[p][q][r] = ord(fileHandle.read(1))
  </code></pre>
  
  <p>How do I visualize these data with Python? Each x,y,z position has a value from 0 to 255 (grey scale) which I would like to render.</p>
  
  <p>Any help is greatly appreciated!</p>