code: def axonal_water_fraction(
      dki_params, sphere="repulsion100", gtol=1e-2, mask=None
  ):
      """Computes the axonal water fraction from DKI [1]_.
  
      Parameters
      ----------
      dki_params : ndarray (x, y, z, 27) or (n, 27)
          All parameters estimated from the diffusion kurtosis model.
          Parameters are ordered as follows:
              1) Three diffusion tensor's eigenvalues
              2) Three lines of the eigenvector matrix each containing the first,
                 second and third coordinates of the eigenvector
              3) Fifteen elements of the kurtosis tensor
      sphere : Sphere class instance, optional
          The sphere providing sample directions for the initial search of the
          maximal value of kurtosis.
      gtol : float, optional
          This input is to refine kurtosis maxima under the precision of the
          directions sampled on the sphere class instance. The gradient of the
          convergence procedure must be less than gtol before successful
          termination. If gtol is None, fiber direction is directly taken from
          the initial sampled directions of the given sphere object
      mask : ndarray
          A boolean array used to mark the coordinates in the data that should be
          analyzed that has the shape dki_params.shape[:-1]
  
      Returns
      -------
      awf : ndarray (x, y, z) or (n)
          Axonal Water Fraction
  
      References
      ----------
      .. [1] Fieremans E, Jensen JH, Helpern JA, 2011. White matter
             characterization with diffusional kurtosis imaging.
             Neuroimage 58(1):177-88. doi: 10.1016/j.neuroimage.2011.06.006
      """
      kt_max = kurtosis_maximum(
          dki_params, sphere=sphere, gtol=gtol, mask=mask
      )
  
      awf = kt_max / (kt_max + 3)
  
      return awf
  
imports: import numpy
  from dipy.reconst.dti import lower_triangular, from_lower_triangular, decompose_tensor, trace, mean_diffusivity, radial_diffusivity, axial_diffusivity, MIN_POSITIVE_SIGNAL
  from dipy.reconst.dki import split_dki_param, _positive_evals, directional_kurtosis, directional_diffusion, kurtosis_maximum, DiffusionKurtosisModel, DiffusionKurtosisFit
  from dipy.reconst.dti import design_matrix
  from dipy.core.ndindex import ndindex
  from dipy.reconst.vec_val_sum import vec_val_vect
  from dipy.data import get_sphere
  import dipy.core.sphere
label_desc: Use image node_id 1 for calling a global function with example usage: axonal_water_fraction(dki_params, sphere, gtol, mask) and returns: awf