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: Create `AffineTransform` from `innames` and `outnames`
  
  Parameters
  ----------
  innames : sequence of str or str
     The names of the axes of the domain.  If str, then names
     given by ``list(innames)``
  outnames : sequence of str or str
     The names of the axes of the range. If str, then names
     given by ``list(outnames)``
  params : AffineTransform, array or (array, array)
     An affine function between the domain and range.
     This can be represented either by a single
     ndarray (which is interpreted as the representation of the
     function in homogeneous coordinates) or an (A,b) tuple.
  domain_name : str, optional
     Name of domain CoordinateSystem
  range_name : str, optional
     Name of range CoordinateSystem
  
  Returns
  -------
  aff : ``AffineTransform``
  
  Notes
  -----
  :Precondition: ``len(shape) == len(names)``
  :Raises ValueError: ``if len(shape) != len(names)``
docstr_tok: ["Create","`","AffineTransform","`","from","`","innames","`","and","`","outnames","`","Parameters","--","--","--","--","--","innames",":","sequence","of","str","or","str","The","names","of","the","axes","of","the","domain",".","If","str",",","then","names","given","by","``","list","(","innames",")","``","outnames",":","sequence","of","str","or","str","The","names","of","the","axes","of","the","range",".","If","str",",","then","names","given","by","``","list","(","outnames",")","``","params",":","AffineTransform",",","array","or","(","array",",","array",")","An","affine","function","between","the","domain","and","range",".","This","can","be","represented","either","by","a","single","ndarray","(","which","is","interpreted","as","the","representation","of","the","function","in","homogeneous","coordinates",")","or","an","(","A",",","b",")","tuple",".","domain_name",":","str",",","optional","Name","of","domain","CoordinateSystem","range_name",":","str",",","optional","Name","of","range","CoordinateSystem","Returns","--","--","--","-","aff",":","``","AffineTransform","``","Notes","--","--","-",":","Precondition",":","``","len","(","shape",")","==","len","(","names",")","``",":","Raises","ValueError",":","``","if","len","(","shape",")","!","=","len","(","names",")","``"]
code: def from_params(
      innames, outnames, params, domain_name="", range_name=""
  ):
      """Create `AffineTransform` from `innames` and `outnames`
  
      Parameters
      ----------
      innames : sequence of str or str
         The names of the axes of the domain.  If str, then names
         given by ``list(innames)``
      outnames : sequence of str or str
         The names of the axes of the range. If str, then names
         given by ``list(outnames)``
      params : AffineTransform, array or (array, array)
         An affine function between the domain and range.
         This can be represented either by a single
         ndarray (which is interpreted as the representation of the
         function in homogeneous coordinates) or an (A,b) tuple.
      domain_name : str, optional
         Name of domain CoordinateSystem
      range_name : str, optional
         Name of range CoordinateSystem
  
      Returns
      -------
      aff : ``AffineTransform``
  
      Notes
      -----
      :Precondition: ``len(shape) == len(names)``
      :Raises ValueError: ``if len(shape) != len(names)``
      """
      if type(params) == type(()):
          A, b = params
          params = from_matvec(A, b)
      ndim = (len(innames) + 1, len(outnames) + 1)
      if params.shape != ndim[::-1]:
          raise ValueError(
              "shape and number of axis names do not agree"
          )
      function_domain = CoordinateSystem(innames, domain_name)
      function_range = CoordinateSystem(outnames, range_name)
      return AffineTransform(function_domain, function_range, params)
  
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 3 for calling the AffineTransform obj's underlying member method code with example usage: obj.from_params(innames, outnames, params, domain_name, range_name) and returns: AffineTransform