class_docstr: A set of domain and range CoordinateSystems and a function between them.
  
  For example, the function may represent the mapping of a voxel (the
  domain of the function) to real space (the range).  The function may
  be an affine or non-affine transformation.
  
  Attributes
  ----------
  function_domain : :class:`CoordinateSystem` instance
     The input coordinate system.
  function_range : :class:`CoordinateSystem` instance
     The output coordinate system.
  function : callable
     A callable that maps the function_domain to the function_range.
  inverse_function : None or callable
     A callable that maps the function_range to the function_domain.
     Not all functions have an inverse, in which case inverse_function
     is None.
  
  Examples
  --------
  >>> function_domain = CoordinateSystem('ijk', 'voxels')
  >>> function_range = CoordinateSystem('xyz', 'world')
  >>> mni_orig = np.array([-90.0, -126.0, -72.0])
  >>> function = lambda x: x + mni_orig
  >>> inv_function = lambda x: x - mni_orig
  >>> cm = CoordinateMap(function_domain, function_range, function, inv_function)
  
  Map the first 3 voxel coordinates, along the x-axis, to mni space:
  
  >>> x = np.array([[0,0,0], [1,0,0], [2,0,0]])
  >>> cm.function(x)
  array([[ -90., -126.,  -72.],
         [ -89., -126.,  -72.],
         [ -88., -126.,  -72.]])
  
  >>> x = CoordinateSystem('x')
  >>> y = CoordinateSystem('y')
  >>> m = CoordinateMap(x, y, np.exp, np.log)
  >>> m
  CoordinateMap(
     function_domain=CoordinateSystem(coord_names=('x',), name='', coord_dtype=float64),
     function_range=CoordinateSystem(coord_names=('y',), name='', coord_dtype=float64),
     function=<ufunc 'exp'>,
     inverse_function=<ufunc 'log'>
    )
  >>> m.inverse()
  CoordinateMap(
     function_domain=CoordinateSystem(coord_names=('y',), name='', coord_dtype=float64),
     function_range=CoordinateSystem(coord_names=('x',), name='', coord_dtype=float64),
     function=<ufunc 'log'>,
     inverse_function=<ufunc 'exp'>
    )
class_docstr_tok: ["A","set","of","domain","and","range","CoordinateSystems","and","a","function","between","them",".","For","example",",","the","function","may","represent","the","mapping","of","a","voxel","(","the","domain","of","the","function",")","to","real","space","(","the","range",")",".","The","function","may","be","an","affine","or","non-affine","transformation",".","Attributes","--","--","--","--","--","function_domain",":",":","class",":","`","CoordinateSystem","`","instance","The","input","coordinate","system",".","function_range",":",":","class",":","`","CoordinateSystem","`","instance","The","output","coordinate","system",".","function",":","callable","A","callable","that","maps","the","function_domain","to","the","function_range",".","inverse_function",":","None","or","callable","A","callable","that","maps","the","function_range","to","the","function_domain",".","Not","all","functions","have","an","inverse",",","in","which","case","inverse_function","is","None",".","Examples","--","--","--","--",">",">",">","function_domain","=","CoordinateSystem","(","'ijk","'",",","'voxels","'",")",">",">",">","function_range","=","CoordinateSystem","(","'xyz","'",",","'world","'",")",">",">",">","mni_orig","=","np.array","(","[","-90.0",",","-126.0",",","-72.0","]",")",">",">",">","function","=","lambda","x",":","x","+","mni_orig",">",">",">","inv_function","=","lambda","x",":","x","-","mni_orig",">",">",">","cm","=","CoordinateMap","(","function_domain",",","function_range",",","function",",","inv_function",")","Map","the","first","3","voxel","coordinates",",","along","the","x-axis",",","to","mni","space",":",">",">",">","x","=","np.array","(","[","[","0,0,0","]",",","[","1,0,0","]",",","[","2,0,0","]","]",")",">",">",">","cm.function","(","x",")","array","(","[","[","-90.",",","-126.",",","-72",".","]",",","[","-89.",",","-126.",",","-72",".","]",",","[","-88.",",","-126.",",","-72",".","]","]",")",">",">",">","x","=","CoordinateSystem","(","'","x","'",")",">",">",">","y","=","CoordinateSystem","(","'","y","'",")",">",">",">","m","=","CoordinateMap","(","x",",","y",",","np.exp",",","np.log",")",">",">",">","m","CoordinateMap","(","function_domain=CoordinateSystem","(","coord_names=","(","'","x","'",",",")",",","name=","''",",","coord_dtype=float64",")",",","function_range=CoordinateSystem","(","coord_names=","(","'","y","'",",",")",",","name=","''",",","coord_dtype=float64",")",",","function=","<","ufunc","'exp","'",">",",","inverse_function=","<","ufunc","'log","'",">",")",">",">",">","m.inverse","(",")","CoordinateMap","(","function_domain=CoordinateSystem","(","coord_names=","(","'","y","'",",",")",",","name=","''",",","coord_dtype=float64",")",",","function_range=CoordinateSystem","(","coord_names=","(","'","x","'",",",")",",","name=","''",",","coord_dtype=float64",")",",","function=","<","ufunc","'log","'",">",",","inverse_function=","<","ufunc","'exp","'",">",")"]
docstr: New CoordinateMap with function_domain renamed
  
  Parameters
  ----------
  newnames : dict
     A dictionary whose keys are integers or are in
     mapping.function_domain.coord_names and whose values are the
     new names.
  
  Returns
  -------
  newmaping : CoordinateMap
     A new CoordinateMap with renamed function_domain.
  
  Examples
  --------
  >>> domain = CoordinateSystem('ijk')
  >>> range = CoordinateSystem('xyz')
  >>> cm = CoordinateMap(domain, range, lambda x:x+1)
  
  >>> new_cm = cm.renamed_domain({'i':'phase','k':'freq','j':'slice'})
  >>> new_cm.function_domain
  CoordinateSystem(coord_names=('phase', 'slice', 'freq'), name='', coord_dtype=float64)
  
  >>> new_cm = cm.renamed_domain({'i':'phase','k':'freq','l':'slice'})
  Traceback (most recent call last):
     ...
  ValueError: no domain coordinate named l
docstr_tok: ["New","CoordinateMap","with","function_domain","renamed","Parameters","--","--","--","--","--","newnames",":","dict","A","dictionary","whose","keys","are","integers","or","are","in","mapping.function_domain.coord_names","and","whose","values","are","the","new","names",".","Returns","--","--","--","-","newmaping",":","CoordinateMap","A","new","CoordinateMap","with","renamed","function_domain",".","Examples","--","--","--","--",">",">",">","domain","=","CoordinateSystem","(","'ijk","'",")",">",">",">","range","=","CoordinateSystem","(","'xyz","'",")",">",">",">","cm","=","CoordinateMap","(","domain",",","range",",","lambda","x",":","x+1",")",">",">",">","new_cm","=","cm.renamed_domain","(","{","'","i","'",":","'phase","'",",","'","k","'",":","'freq","'",",","'","j","'",":","'slice","'","}",")",">",">",">","new_cm.function_domain","CoordinateSystem","(","coord_names=","(","'phase","'",",","'slice","'",",","'freq","'",")",",","name=","''",",","coord_dtype=float64",")",">",">",">","new_cm","=","cm.renamed_domain","(","{","'","i","'",":","'phase","'",",","'","k","'",":","'freq","'",",","'","l","'",":","'slice","'","}",")","Traceback","(","most","recent","call","last",")",":","...","ValueError",":","no","domain","coordinate","named","l"]
code: def renamed_domain(self, newnames, name=""):
      """New CoordinateMap with function_domain renamed
  
      Parameters
      ----------
      newnames : dict
         A dictionary whose keys are integers or are in
         mapping.function_domain.coord_names and whose values are the
         new names.
  
      Returns
      -------
      newmaping : CoordinateMap
         A new CoordinateMap with renamed function_domain.
  
      Examples
      --------
      >>> domain = CoordinateSystem('ijk')
      >>> range = CoordinateSystem('xyz')
      >>> cm = CoordinateMap(domain, range, lambda x:x+1)
  
      >>> new_cm = cm.renamed_domain({'i':'phase','k':'freq','j':'slice'})
      >>> new_cm.function_domain
      CoordinateSystem(coord_names=('phase', 'slice', 'freq'), name='', coord_dtype=float64)
  
      >>> new_cm = cm.renamed_domain({'i':'phase','k':'freq','l':'slice'})
      Traceback (most recent call last):
         ...
      ValueError: no domain coordinate named l
      """
      return renamed_domain(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 5 for calling the CoordinateMap obj's underlying member method code with example usage: obj.renamed_domain(newnames, name) and returns: renamed_domain