code: def fromarray(data, innames, outnames):
      """Create an image from array `data`, and input/output coordinate names
  
      The mapping between the input and output coordinate names is the identity
      matrix.
  
      Please don't use this routine, but instead prefer::
  
          from nipy.core.api import Image, AffineTransform
          img = Image(data, AffineTransform(innames, outnames, np.eye(4)))
  
      where ``4`` is ``len(innames) + 1``.
  
      Parameters
      ----------
      data : numpy array
          A numpy array of three dimensions.
      innames : sequence
         a list of input axis names
      innames : sequence
         a list of output axis names
  
      Returns
      -------
      image : An `Image` object
  
      See Also
      --------
      load : function for loading images
      save : function for saving images
  
      Examples
      --------
      >>> img = fromarray(np.zeros((2,3,4)), 'ijk', 'xyz')
      >>> img.coordmap
      AffineTransform(
         function_domain=CoordinateSystem(coord_names=('i', 'j', 'k'), name='', coord_dtype=float64),
         function_range=CoordinateSystem(coord_names=('x', 'y', 'z'), name='', coord_dtype=float64),
         affine=array([[ 1.,  0.,  0.,  0.],
                       [ 0.,  1.,  0.,  0.],
                       [ 0.,  0.,  1.,  0.],
                       [ 0.,  0.,  0.,  1.]])
      )
      """
      warnings.warn(
          "fromarray is deprecated, please use the Image "
          "constructor instead",
          DeprecationWarning,
          stacklevel=2,
      )
      ndim = len(data.shape)
      coordmap = AffineTransform.from_start_step(
          innames, outnames, (0.0,) * ndim, (1.0,) * ndim
      )
      return Image(data, coordmap)
  
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 2 for calling a global function with example usage: fromarray(data, innames, outnames) and returns: Image