class_docstr: The `Image` class provides the core object type used in nipy.
  
  An `Image` represents a volumetric brain image and provides means
  for manipulating the image data.  Most functions in the image module
  operate on `Image` objects.
  
  Notes
  -----
  Images can be created through the module functions.  See nipy.io for
  image IO such as ``load`` and ``save``
  
  Examples
  --------
  Load an image from disk
  
  >>> from nipy.testing import anatfile
  >>> from nipy.io.api import load_image
  >>> img = load_image(anatfile)
  
  Make an image from an array.  We need to make a meaningful coordinate map
  for the image.
  
  >>> arr = np.zeros((21,64,64), dtype=np.int16)
  >>> cmap = AffineTransform('kji', 'zxy', np.eye(4))
  >>> img = Image(arr, cmap)
docstr: Return a new Image with reordered input coordinates.
  
  This transposes the data as well.
  
  Parameters
  ----------
  order : None, sequence, optional
      Sequence of int (giving indices) or str (giving names) - expressing
      new order of coordmap output coordinates.  None (the default)
      results in reversed ordering.
  
  Returns
  -------
  r_img : object
      Image of same class as `self`, with reordered output coordinates.
  
  Examples
  --------
  >>> cmap = AffineTransform.from_start_step(
  ...             'ijk', 'xyz', [1, 2, 3], [4, 5, 6], 'domain', 'range')
  >>> cmap
  AffineTransform(
     function_domain=CoordinateSystem(coord_names=('i', 'j', 'k'), name='domain', coord_dtype=float64),
     function_range=CoordinateSystem(coord_names=('x', 'y', 'z'), name='range', coord_dtype=float64),
     affine=array([[ 4.,  0.,  0.,  1.],
                   [ 0.,  5.,  0.,  2.],
                   [ 0.,  0.,  6.,  3.],
                   [ 0.,  0.,  0.,  1.]])
  )
  >>> im = Image(np.empty((30,40,50)), cmap)
  >>> im_reordered = im.reordered_axes([2,0,1])
  >>> im_reordered.shape
  (50, 30, 40)
  >>> im_reordered.coordmap
  AffineTransform(
     function_domain=CoordinateSystem(coord_names=('k', 'i', 'j'), name='domain', coord_dtype=float64),
     function_range=CoordinateSystem(coord_names=('x', 'y', 'z'), name='range', coord_dtype=float64),
     affine=array([[ 0.,  4.,  0.,  1.],
                   [ 0.,  0.,  5.,  2.],
                   [ 6.,  0.,  0.,  3.],
                   [ 0.,  0.,  0.,  1.]])
  )
code: def reordered_axes(self, order=None):
      """Return a new Image with reordered input coordinates.
  
      This transposes the data as well.
  
      Parameters
      ----------
      order : None, sequence, optional
          Sequence of int (giving indices) or str (giving names) - expressing
          new order of coordmap output coordinates.  None (the default)
          results in reversed ordering.
  
      Returns
      -------
      r_img : object
          Image of same class as `self`, with reordered output coordinates.
  
      Examples
      --------
      >>> cmap = AffineTransform.from_start_step(
      ...             'ijk', 'xyz', [1, 2, 3], [4, 5, 6], 'domain', 'range')
      >>> cmap
      AffineTransform(
         function_domain=CoordinateSystem(coord_names=('i', 'j', 'k'), name='domain', coord_dtype=float64),
         function_range=CoordinateSystem(coord_names=('x', 'y', 'z'), name='range', coord_dtype=float64),
         affine=array([[ 4.,  0.,  0.,  1.],
                       [ 0.,  5.,  0.,  2.],
                       [ 0.,  0.,  6.,  3.],
                       [ 0.,  0.,  0.,  1.]])
      )
      >>> im = Image(np.empty((30,40,50)), cmap)
      >>> im_reordered = im.reordered_axes([2,0,1])
      >>> im_reordered.shape
      (50, 30, 40)
      >>> im_reordered.coordmap
      AffineTransform(
         function_domain=CoordinateSystem(coord_names=('k', 'i', 'j'), name='domain', coord_dtype=float64),
         function_range=CoordinateSystem(coord_names=('x', 'y', 'z'), name='range', coord_dtype=float64),
         affine=array([[ 0.,  4.,  0.,  1.],
                       [ 0.,  0.,  5.,  2.],
                       [ 6.,  0.,  0.,  3.],
                       [ 0.,  0.,  0.,  1.]])
      )
      """
      if order is None:
          order = list(range(self.ndim))[::-1]
      elif type(order[0]) == str:
          order = [self.axes.index(s) for s in order]
      new_cmap = self.coordmap.reordered_domain(order)
      # Only transpose if we have to so as to avoid calling
      # self.get_fdata
      if order != list(range(self.ndim)):
          new_data = np.transpose(self.get_fdata(), order)
      else:
          new_data = self._data
      return self.__class__.from_image(
          self, data=new_data, coordmap=new_cmap
      )
  
imports: import warnings
  from copy import copy
  from itertools import chain
  import numpy
  from nibabel.onetime import auto_attr
  from ..reference.array_coords import ArrayCoordMap
  from ..reference.coordinate_map import AffineTransform, CoordinateSystem, input_axis_index
label_desc: Use image node_id 10 for calling the Image obj's underlying member method code with example usage: obj.reordered_axes(order) and returns: self