code: def params_to_dki_params(result, min_diffusivity=0):
      # Extracting the diffusion tensor parameters from solution
      DT_elements = result[:6]
      evals, evecs = decompose_tensor(
          from_lower_triangular(DT_elements),
          min_diffusivity=min_diffusivity,
      )
  
      # Extracting kurtosis tensor parameters from solution
      MD_square = evals.mean(0) ** 2
      KT_elements = (
          result[6:21] / MD_square if MD_square else 0.0 * result[6:21]
      )
  
      # Write output
      dki_params = np.concatenate(
          (evals, evecs[0], evecs[1], evecs[2], KT_elements), axis=0
      )
  
      return dki_params
  
imports: import numpy
  import warnings
  import scipy.optimize
  import dipy.core.sphere
  from dipy.reconst.multi_voxel import multi_voxel_fit
  from dipy.reconst.dti import TensorFit, mean_diffusivity, from_lower_triangular, lower_triangular, decompose_tensor, MIN_POSITIVE_SIGNAL, nlls_fit_tensor, restore_fit_tensor
  from dipy.reconst.utils import dki_design_matrix
  from dipy.reconst.recspeed import local_maxima
  from dipy.reconst.base import ReconstModel
  from dipy.core.ndindex import ndindex
  from dipy.core.geometry import sphere2cart, cart2sphere, perpendicular_directions
  from dipy.core.optimize import PositiveDefiniteLeastSquares
  from dipy.data import get_sphere, get_fnames, load_sdp_constraints
  from dipy.reconst.vec_val_sum import vec_val_vect
  from dipy.core.gradients import check_multi_b
label_desc: Use image node_id 21 for calling a global function with example usage: params_to_dki_params(result, min_diffusivity) and returns: dki_params