class_docstr: Class for affine transformation from domain to a range
  
  This class has an affine attribute, which is a matrix representing
  the affine transformation in homogeneous coordinates.  This matrix
  is used to evaluate the function, rather than having an explicit
  function (as is the case for a CoordinateMap).
  
  Examples
  --------
  >>> inp_cs = CoordinateSystem('ijk')
  >>> out_cs = CoordinateSystem('xyz')
  >>> cm = AffineTransform(inp_cs, out_cs, np.diag([1, 2, 3, 1]))
  >>> cm
  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.,  2.,  0.,  0.],
                   [ 0.,  0.,  3.,  0.],
                   [ 0.,  0.,  0.,  1.]])
  )
  
  >>> cm.affine
  array([[ 1.,  0.,  0.,  0.],
         [ 0.,  2.,  0.,  0.],
         [ 0.,  0.,  3.,  0.],
         [ 0.,  0.,  0.,  1.]])
  >>> cm([1,1,1])
  array([ 1.,  2.,  3.])
  >>> icm = cm.inverse()
  >>> icm([1,2,3])
  array([ 1.,  1.,  1.])
class_docstr_tok: ["Class","for","affine","transformation","from","domain","to","a","range","This","class","has","an","affine","attribute",",","which","is","a","matrix","representing","the","affine","transformation","in","homogeneous","coordinates",".","This","matrix","is","used","to","evaluate","the","function",",","rather","than","having","an","explicit","function","(","as","is","the","case","for","a","CoordinateMap",")",".","Examples","--","--","--","--",">",">",">","inp_cs","=","CoordinateSystem","(","'ijk","'",")",">",">",">","out_cs","=","CoordinateSystem","(","'xyz","'",")",">",">",">","cm","=","AffineTransform","(","inp_cs",",","out_cs",",","np.diag","(","[","1",",","2",",","3",",","1","]",")",")",">",">",">","cm","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.",",","2.",",","0.",",","0",".","]",",","[","0.",",","0.",",","3.",",","0",".","]",",","[","0.",",","0.",",","0.",",","1",".","]","]",")",")",">",">",">","cm.affine","array","(","[","[","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","2.",",","0.",",","0",".","]",",","[","0.",",","0.",",","3.",",","0",".","]",",","[","0.",",","0.",",","0.",",","1",".","]","]",")",">",">",">","cm","(","[","1,1,1","]",")","array","(","[","1.",",","2.",",","3",".","]",")",">",">",">","icm","=","cm.inverse","(",")",">",">",">","icm","(","[","1,2,3","]",")","array","(","[","1.",",","1.",",","1",".","]",")"]
docstr: Return an identity coordmap of the given shape
  
  Parameters
  ----------
  coord_names : sequence of str or str
     The names of the axes of the domain.  If str, then names
     given by ``list(coord_names)``
  name : str, optional
     Name of origin of coordinate system
  
  Returns
  -------
  cm : `CoordinateMap`
     ``CoordinateMap`` with ``CoordinateSystem`` domain and an
     identity transform, with identical domain and range.
  
  Examples
  --------
  >>> cm = AffineTransform.identity('ijk', 'somewhere')
  >>> cm.affine
  array([[ 1.,  0.,  0.,  0.],
         [ 0.,  1.,  0.,  0.],
         [ 0.,  0.,  1.,  0.],
         [ 0.,  0.,  0.,  1.]])
  >>> cm.function_domain
  CoordinateSystem(coord_names=('i', 'j', 'k'), name='somewhere', coord_dtype=float64)
  >>> cm.function_range
  CoordinateSystem(coord_names=('i', 'j', 'k'), name='somewhere', coord_dtype=float64)
docstr_tok: ["Return","an","identity","coordmap","of","the","given","shape","Parameters","--","--","--","--","--","coord_names",":","sequence","of","str","or","str","The","names","of","the","axes","of","the","domain",".","If","str",",","then","names","given","by","``","list","(","coord_names",")","``","name",":","str",",","optional","Name","of","origin","of","coordinate","system","Returns","--","--","--","-","cm",":","`","CoordinateMap","`","``","CoordinateMap","``","with","``","CoordinateSystem","``","domain","and","an","identity","transform",",","with","identical","domain","and","range",".","Examples","--","--","--","--",">",">",">","cm","=","AffineTransform.identity","(","'ijk","'",",","'somewhere","'",")",">",">",">","cm.affine","array","(","[","[","1.",",","0.",",","0.",",","0",".","]",",","[","0.",",","1.",",","0.",",","0",".","]",",","[","0.",",","0.",",","1.",",","0",".","]",",","[","0.",",","0.",",","0.",",","1",".","]","]",")",">",">",">","cm.function_domain","CoordinateSystem","(","coord_names=","(","'","i","'",",","'","j","'",",","'","k","'",")",",","name='somewhere","'",",","coord_dtype=float64",")",">",">",">","cm.function_range","CoordinateSystem","(","coord_names=","(","'","i","'",",","'","j","'",",","'","k","'",")",",","name='somewhere","'",",","coord_dtype=float64",")"]
code: def identity(coord_names, name=""):
      """Return an identity coordmap of the given shape
  
      Parameters
      ----------
      coord_names : sequence of str or str
         The names of the axes of the domain.  If str, then names
         given by ``list(coord_names)``
      name : str, optional
         Name of origin of coordinate system
  
      Returns
      -------
      cm : `CoordinateMap`
         ``CoordinateMap`` with ``CoordinateSystem`` domain and an
         identity transform, with identical domain and range.
  
      Examples
      --------
      >>> cm = AffineTransform.identity('ijk', 'somewhere')
      >>> cm.affine
      array([[ 1.,  0.,  0.,  0.],
             [ 0.,  1.,  0.,  0.],
             [ 0.,  0.,  1.,  0.],
             [ 0.,  0.,  0.,  1.]])
      >>> cm.function_domain
      CoordinateSystem(coord_names=('i', 'j', 'k'), name='somewhere', coord_dtype=float64)
      >>> cm.function_range
      CoordinateSystem(coord_names=('i', 'j', 'k'), name='somewhere', coord_dtype=float64)
      """
      return AffineTransform.from_start_step(
          coord_names,
          coord_names,
          [0] * len(coord_names),
          [1] * len(coord_names),
          name,
          name,
      )
  
imports: import warnings
  import numpy
  import numpy.linalg
  from nibabel import io_orientation
  from nibabel.affines import from_matvec, to_matvec
  from .coordinate_system import CoordinateSystem, is_coordsys, safe_dtype
  from .coordinate_system import product
label_desc: Use image node_id 5 for calling the AffineTransform obj's underlying member method code with example usage: obj.identity(coord_names, name) and returns: AffineTransform