class_docstr: Class to contain ND image as list of (N-1)D images 
docstr: Return data in ndarray with list dimension at position `axis`
  
  Parameters
  ----------
  axis : int
      `axis` specifies which axis of the output will take the role of the
      list dimension. For example, 0 will put the list dimension in the
      first axis of the result.
  
  Returns
  -------
  data : ndarray
      data in image list as array, with data across elements of the list
      concetenated at dimension `axis` of the array.
  
  Examples
  --------
  >>> from nipy.testing import funcfile
  >>> from nipy.io.api import load_image
  >>> funcim = load_image(funcfile)
  >>> ilist = ImageList.from_image(funcim, axis='t')
  >>> ilist.get_list_data(axis=0).shape
  (20, 17, 21, 3)
docstr_tok: ["Return","data","in","ndarray","with","list","dimension","at","position","`","axis","`","Parameters","--","--","--","--","--","axis",":","int","`","axis","`","specifies","which","axis","of","the","output","will","take","the","role","of","the","list","dimension",".","For","example",",","0","will","put","the","list","dimension","in","the","first","axis","of","the","result",".","Returns","--","--","--","-","data",":","ndarray","data","in","image","list","as","array",",","with","data","across","elements","of","the","list","concetenated","at","dimension","`","axis","`","of","the","array",".","Examples","--","--","--","--",">",">",">","from","nipy.testing","import","funcfile",">",">",">","from","nipy.io.api","import","load_image",">",">",">","funcim","=","load_image","(","funcfile",")",">",">",">","ilist","=","ImageList.from_image","(","funcim",",","axis='t","'",")",">",">",">","ilist.get_list_data","(","axis=0",")",".shape","(","20",",","17",",","21",",","3",")"]
code: def get_list_data(self, axis=None):
      """Return data in ndarray with list dimension at position `axis`
  
      Parameters
      ----------
      axis : int
          `axis` specifies which axis of the output will take the role of the
          list dimension. For example, 0 will put the list dimension in the
          first axis of the result.
  
      Returns
      -------
      data : ndarray
          data in image list as array, with data across elements of the list
          concetenated at dimension `axis` of the array.
  
      Examples
      --------
      >>> from nipy.testing import funcfile
      >>> from nipy.io.api import load_image
      >>> funcim = load_image(funcfile)
      >>> ilist = ImageList.from_image(funcim, axis='t')
      >>> ilist.get_list_data(axis=0).shape
      (20, 17, 21, 3)
      """
      if axis is None:
          raise ValueError(
              "Must specify which axis of the output will take "
              "the role of the list dimension, eg 0 will put "
              "the list dimension in the first axis of the "
              "result"
          )
      img_shape = self.list[0].shape
      ilen = len(self.list)
      out_dim = len(img_shape) + 1
      if axis >= out_dim or axis < -out_dim:
          raise ValueError(
              "I have only %d axes position, but axis %d asked "
              "for" % (out_dim - 1, axis)
          )
      # tmp_shape is the shape of the output if axis is 0
      tmp_shape = (ilen,) + img_shape
      v = np.empty(tmp_shape)
      # first put the data in an array, with list dimension in the first axis
      for i, im in enumerate(self.list):
          v[
              i
          ] = im.get_fdata()  # get_fdata method of an image has no axis
      # then roll (and rock?) the axis to have axis in the right place
      if axis < 0:
          axis += out_dim
      res = np.rollaxis(v, 0, axis + 1)
      # Check we got the expected shape
      target_shape = img_shape[0:axis] + (ilen,) + img_shape[axis:]
      if target_shape != res.shape:
          raise ValueError("We were not expecting this shape")
      return res
  
file_path: nipy/nipy/core/image/image_list.py
imports: import warnings
  import numpy
  from ..reference.coordinate_map import AxisError, drop_io_dim, io_axis_indices
  from .image import Image, is_image, iter_axis
label_desc: Use image node_id 6 for calling the ImageList obj's underlying member method code with example usage: obj.get_list_data(axis) and returns: res