code: def btens_to_params(btens, ztol=1e-10):
      r"""Compute trace, anisotropy and asymmetry parameters from b-tensors.
  
      Parameters
      ----------
      btens : (3, 3) OR (N, 3, 3) numpy.ndarray
          input b-tensor, or b-tensors, where N = number of b-tensors
      ztol : float
          Any parameters smaller than this value are considered to be 0
  
      Returns
      -------
      bval: numpy.ndarray
          b-value(s) (trace(s))
      bdelta: numpy.ndarray
          normalized tensor anisotropy(s)
      b_eta: numpy.ndarray
          tensor asymmetry(s)
  
      Notes
      -----
      This function can be used to get b-tensor parameters directly from the
      GradientTable `btens` attribute.
  
      Examples
      --------
      >>> lte = np.array([[1, 0, 0], [0, 0, 0], [0, 0, 0]])
      >>> bval, bdelta, b_eta = btens_to_params(lte)
      >>> print("bval={}; bdelta={}; b_eta={}".format(bdelta, bval, b_eta))
      bval=[ 1.]; bdelta=[ 1.]; b_eta=[ 0.]
  
      """
      # Bad input checks
      value_error_msg = (
          "`btens` must be a 2D or 3D numpy array, respectively"
          " with (3, 3) or (N, 3, 3) shape, where N corresponds"
          " to the number of b-tensors"
      )
      if not isinstance(btens, np.ndarray):
          raise ValueError(value_error_msg)
  
      nd = np.ndim(btens)
      if nd == 2:
          btens_shape = btens.shape
      elif nd == 3:
          btens_shape = btens.shape[1:]
      else:
          raise ValueError(value_error_msg)
  
      if not btens_shape == (3, 3):
          raise ValueError(value_error_msg)
  
      # Reshape so that loop below works when only one input b-tensor is provided
      if nd == 2:
          btens = btens.reshape((1, 3, 3))
  
      # Pre-allocate
      n_btens = btens.shape[0]
      bval = np.empty(n_btens)
      bdelta = np.empty(n_btens)
      b_eta = np.empty(n_btens)
  
      # Loop over b-tensor(s)
      for i in range(btens.shape[0]):
          i_btens = btens[i, :, :]
          i_bval, i_bdelta, i_b_eta = _btens_to_params_2d(i_btens, ztol)
          bval[i] = i_bval
          bdelta[i] = i_bdelta
          b_eta[i] = i_b_eta
  
      return bval, bdelta, b_eta
  
imports: import logging
  from warnings import warn
  import numpy
  from scipy.linalg import inv, polar
  from dipy.io import gradients
  from dipy.core.onetime import auto_attr
  from dipy.core.geometry import vector_norm, vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.utils.deprecator import deprecate_with_version
label_desc: Use image node_id 17 for calling a global function with example usage: btens_to_params(btens, ztol) and returns: bval,  bdelta,  b_eta