title: What is dimension order of numpy shape for image data?
body: <p>I am using <code>nibabel</code> lib to load data from nii file. I read the document of the lib at <a href="http://nipy.org/nibabel/gettingstarted.html" rel="noreferrer">http://nipy.org/nibabel/gettingstarted.html</a>, and found that</p>
  
  <blockquote>
    <p>This information is available without the need to load anything of the main image data into the memory. Of course there is also access to the image data as a NumPy array</p>
  </blockquote>
  
  <p>This is my code to load the data and it shapes</p>
  
  <pre><code>import nibabel as nib
  img = nib.load('example.nii')
  data = img.get_data()
  data = np.squeeze(data)
  data = np.copy(data, order="C")
  print data.shape
  </code></pre>
  
  <p>I got the result</p>
  
  <pre><code>128, 128, 64
  </code></pre>
  
  <p>What is order of data shape? Is it <code>WidthxHeightxDepth</code>? And my input must  arranged as <code>depth, height, width</code>. So I will use <code>input=data.transpose(2,0,1)</code>. Is it right? Thanks all</p>
  
  <p>Update: I found that the Numpy will read the image by order <code>Height x Width x Depth</code> as the reference <a href="http://www.python-course.eu/images/axis.jpeg" rel="noreferrer">http://www.python-course.eu/images/axis.jpeg</a></p>