code: def msdki_prediction(msdki_params, gtab, S0=1.0):
      """
      Predict the mean signal given the parameters of the mean signal DKI, an
      GradientTable object and S0 signal.
  
      Parameters
      ----------
      msdki_params : ndarray ([X, Y, Z, ...], 2)
          Array containing the mean signal diffusivity and mean signal kurtosis
          in its last axis
      gtab : a GradientTable class instance
          The gradient table for this prediction
      S0 : float or ndarray (optional)
          The non diffusion-weighted signal in every voxel, or across all
          voxels. Default: 1
  
      Notes
      -----
      The predicted signal is given by:
          $MS(b) = S_0 * exp(-bD + 1/6 b^{2} D^{2} K)$, where $D$ and $K$ are the
          mean signal diffusivity and mean signal kurtosis.
  
      References
      ----------
      .. [1] Henriques, R.N., 2018. Advanced Methods for Diffusion MRI Data
             Analysis and their Application to the Healthy Ageing Brain (Doctoral
             thesis). Downing College, University of Cambridge.
             https://doi.org/10.17863/CAM.29356
      """
      A = design_matrix(round_bvals(gtab.bvals))
  
      params = msdki_params.copy()
      params[..., 1] = params[..., 1] * params[..., 0] ** 2
  
      if isinstance(S0, (float, int)):
          pred_sig = S0 * np.exp(np.dot(params, A[:, :2].T))
      elif S0.size == 1:
          pred_sig = S0 * np.exp(np.dot(params, A[:, :2].T))
      else:
          nv = gtab.bvals.size
          S0r = np.zeros(S0.shape + gtab.bvals.shape)
          for vi in range(nv):
              S0r[..., vi] = S0
          pred_sig = S0r * np.exp(np.dot(params, A[:, :2].T))
  
      return pred_sig
  
imports: import numpy
  import scipy.optimize
  from dipy.core.gradients import check_multi_b, unique_bvals_magnitude, round_bvals
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.dti import MIN_POSITIVE_SIGNAL
  from dipy.core.ndindex import ndindex
  from dipy.core.onetime import auto_attr
label_desc: Use image node_id 6 for calling a global function with example usage: msdki_prediction(msdki_params, gtab, S0) and returns: pred_sig