code: def test_dki_predict():
      dkiM = dki.DiffusionKurtosisModel(gtab_2s)
      pred = dkiM.predict(crossing_ref, S0=100)
  
      assert_array_almost_equal(pred, signal_cross)
  
      # just to check that it works with more than one voxel:
      pred_multi = dkiM.predict(multi_params, S0=100)
      assert_array_almost_equal(pred_multi, DWI)
  
      # Check that it works with more than one voxel, and with a different S0
      # in each voxel:
      pred_multi = dkiM.predict(
          multi_params, S0=100 * np.ones(pred_multi.shape[:3])
      )
      assert_array_almost_equal(pred_multi, DWI)
  
      # check the function predict of the DiffusionKurtosisFit object
      dkiF = dkiM.fit(DWI)
      pred_multi = dkiF.predict(gtab_2s, S0=100)
      assert_array_almost_equal(pred_multi, DWI)
  
      dkiF = dkiM.fit(pred_multi)
      pred_from_fit = dkiF.predict(dkiM.gtab, S0=100)
      assert_array_almost_equal(pred_from_fit, DWI)
  
      # Test the module function:
      pred = dki.dki_prediction(crossing_ref, gtab_2s, S0=100)
      assert_array_almost_equal(pred, signal_cross)
  
      # Test the module function with S0 volume:
      pred = dki.dki_prediction(
          multi_params,
          gtab_2s,
          S0=100 * np.ones(multi_params.shape[:3]),
      )
      assert_array_almost_equal(pred, DWI)
  
imports: import numpy
  import random
  import dipy.reconst.dki
  import dipy.reconst.dti
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_raises
  from dipy.sims.voxel import multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table
  from dipy.data import get_fnames
  from dipy.reconst.dti import from_lower_triangular, decompose_tensor
  from dipy.reconst.dki import mean_kurtosis, carlson_rf, carlson_rd, axial_kurtosis, radial_kurtosis, mean_kurtosis_tensor, _positive_evals, lower_triangular, kurtosis_fractional_anisotropy
  from dipy.core.sphere import Sphere
  from dipy.data import default_sphere
  from dipy.core.geometry import sphere2cart
  from dipy.utils.optpkg import optional_package
  from dipy.utils.tripwire import TripWireError
label_desc: Use image node_id 7 for calling a global function with example usage: test_dki_predict() without return types