code: def _btens_to_params_2d(btens_2d, ztol):
      """Compute trace, anisotropy and asymmetry parameters from a single b-tensor
  
      Auxiliary function where calculation of `bval`, bdelta` and `b_eta` from a
      (3,3) b-tensor takes place. The main function `btens_to_params` then wraps
      around this to enable support of input (N, 3, 3) arrays, where N = number of
      b-tensors
  
      Parameters
      ----------
      btens_2d : (3, 3) numpy.ndarray
          input b-tensor
      ztol : float
          Any parameters smaller than this value are considered to be 0
  
      Returns
      -------
      bval: float
          b-value (trace)
      bdelta: float
          normalized tensor anisotropy
      bdelta: float
          tensor asymmetry
  
      Notes
      -----
      Implementation following [1].
  
      References
      ----------
      .. [1] D. Topgaard, NMR methods for studying microscopic diffusion
      anisotropy, in: R. Valiullin (Ed.), Diffusion NMR of Confined Systems: Fluid
      Transport in Porous Solids and Heterogeneous Materials, Royal Society of
      Chemistry, Cambridge, UK, 2016.
  
      """
      btens_2d[abs(btens_2d) <= ztol] = 0
  
      evals = np.real(np.linalg.eig(btens_2d)[0])
      bval = np.sum(evals)
      bval_is_zero = np.abs(bval) <= ztol
  
      if bval_is_zero:
          bval = 0
          bdelta = 0
          b_eta = 0
      else:
          lambda_iso = (1 / 3) * bval
  
          diff_lambdas = np.abs(evals - lambda_iso)
          evals_zzxxyy = evals[np.argsort(diff_lambdas)[::-1]]
  
          lambda_zz = evals_zzxxyy[0]
          lambda_xx = evals_zzxxyy[1]
          lambda_yy = evals_zzxxyy[2]
  
          bdelta = (1 / (3 * lambda_iso)) * (
              lambda_zz - ((lambda_yy + lambda_xx) / 2)
          )
  
          if np.abs(bdelta) <= ztol:
              bdelta = 0
  
          yyxx_diff = lambda_yy - lambda_xx
          if abs(yyxx_diff) <= np.spacing(1):
              yyxx_diff = 0
  
          b_eta = yyxx_diff / (2 * lambda_iso * bdelta + np.spacing(1))
  
          if np.abs(b_eta) <= b_eta:
              b_eta = 0
  
      return float(bval), float(bdelta), float(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 16 for calling a global function with example usage: _btens_to_params_2d(btens_2d, ztol) and returns: float,  float,  float