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: New AffineTransform with renamed function_domain
  
  Parameters
  ----------
  newnames : dict
     A dictionary whose keys are integers or are in
     mapping.function_range.coord_names and whose values are the
     new names.
  
  Returns
  -------
  newmapping : AffineTransform
     A new AffineTransform with renamed function_range.
  
  Examples
  --------
  >>> affine_domain = CoordinateSystem('ijk')
  >>> affine_range = CoordinateSystem('xyz')
  >>> affine_matrix = np.identity(4)
  >>> affine_mapping = AffineTransform(affine_domain, affine_range, affine_matrix)
  
  >>> new_affine_mapping = affine_mapping.renamed_range({'x':'u'})
  >>> new_affine_mapping.function_range
  CoordinateSystem(coord_names=('u', 'y', 'z'), name='', coord_dtype=float64)
  
  >>> new_affine_mapping = affine_mapping.renamed_range({'w':'u'})
  Traceback (most recent call last):
     ...
  ValueError: no range coordinate named w
docstr_tok: ["New","AffineTransform","with","renamed","function_domain","Parameters","--","--","--","--","--","newnames",":","dict","A","dictionary","whose","keys","are","integers","or","are","in","mapping.function_range.coord_names","and","whose","values","are","the","new","names",".","Returns","--","--","--","-","newmapping",":","AffineTransform","A","new","AffineTransform","with","renamed","function_range",".","Examples","--","--","--","--",">",">",">","affine_domain","=","CoordinateSystem","(","'ijk","'",")",">",">",">","affine_range","=","CoordinateSystem","(","'xyz","'",")",">",">",">","affine_matrix","=","np.identity","(","4",")",">",">",">","affine_mapping","=","AffineTransform","(","affine_domain",",","affine_range",",","affine_matrix",")",">",">",">","new_affine_mapping","=","affine_mapping.renamed_range","(","{","'","x","'",":","'","u","'","}",")",">",">",">","new_affine_mapping.function_range","CoordinateSystem","(","coord_names=","(","'","u","'",",","'","y","'",",","'","z","'",")",",","name=","''",",","coord_dtype=float64",")",">",">",">","new_affine_mapping","=","affine_mapping.renamed_range","(","{","'","w","'",":","'","u","'","}",")","Traceback","(","most","recent","call","last",")",":","...","ValueError",":","no","range","coordinate","named","w"]
code: def renamed_range(self, newnames, name=""):
      """New AffineTransform with renamed function_domain
  
      Parameters
      ----------
      newnames : dict
         A dictionary whose keys are integers or are in
         mapping.function_range.coord_names and whose values are the
         new names.
  
      Returns
      -------
      newmapping : AffineTransform
         A new AffineTransform with renamed function_range.
  
      Examples
      --------
      >>> affine_domain = CoordinateSystem('ijk')
      >>> affine_range = CoordinateSystem('xyz')
      >>> affine_matrix = np.identity(4)
      >>> affine_mapping = AffineTransform(affine_domain, affine_range, affine_matrix)
  
      >>> new_affine_mapping = affine_mapping.renamed_range({'x':'u'})
      >>> new_affine_mapping.function_range
      CoordinateSystem(coord_names=('u', 'y', 'z'), name='', coord_dtype=float64)
  
      >>> new_affine_mapping = affine_mapping.renamed_range({'w':'u'})
      Traceback (most recent call last):
         ...
      ValueError: no range coordinate named w
      """
      return renamed_range(self, newnames)
  
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 9 for calling the AffineTransform obj's underlying member method code with example usage: obj.renamed_range(newnames, name) and returns: renamed_range