code: def test_multi_voxel_kurtosis_maximum():
      # Multi-voxel simulations parameters
      FIE = np.array(
          [[[0.30, 0.32], [0.74, 0.51]], [[0.47, 0.21], [0.80, 0.63]]]
      )
      RDI = np.zeros((2, 2, 2))
      ADI = np.array(
          [
              [[1e-3, 1.3e-3], [0.8e-3, 1e-3]],
              [[0.9e-3, 0.99e-3], [0.89e-3, 1.1e-3]],
          ]
      )
      ADE = np.array(
          [
              [[2.2e-3, 2.3e-3], [2.8e-3, 2.1e-3]],
              [[1.9e-3, 2.5e-3], [1.89e-3, 2.1e-3]],
          ]
      )
      Tor = np.array(
          [[[2.6, 2.4], [2.8, 2.1]], [[2.9, 2.5], [2.7, 2.3]]]
      )
      RDE = ADE / Tor
  
      # prepare simulation:
      DWIsim = np.zeros((2, 2, 2, gtab_2s.bvals.size))
  
      for i in range(2):
          for j in range(2):
              for k in range(2):
                  ADi = ADI[i, j, k]
                  RDi = RDI[i, j, k]
                  ADe = ADE[i, j, k]
                  RDe = RDE[i, j, k]
                  fie = FIE[i, j, k]
                  mevals = np.array([[ADi, RDi, RDi], [ADe, RDe, RDe]])
                  frac = [fie * 100, (1 - fie) * 100]
                  theta = random.uniform(0, 180)
                  phi = random.uniform(0, 320)
                  angles = [(theta, phi), (theta, phi)]
                  signal, dt, kt = multi_tensor_dki(
                      gtab_2s,
                      mevals,
                      angles=angles,
                      fractions=frac,
                      snr=None,
                  )
                  DWIsim[i, j, k, :] = signal
  
      # Ground truth Maximum kurtosis
      RD = FIE * RDI + (1 - FIE) * RDE
      RK = 3 * FIE * (1 - FIE) * ((RDI - RDE) / RD) ** 2
  
      # prepare inputs
      dkiM = dki.DiffusionKurtosisModel(gtab_2s, fit_method="WLS")
      dkiF = dkiM.fit(DWIsim)
  
      # TEST - when no sphere is given
      k_max = dki.kurtosis_maximum(dkiF.model_params)
      assert_almost_equal(k_max, RK, decimal=4)
  
      # TEST - when sphere is given
      k_max = dki.kurtosis_maximum(dkiF.model_params, default_sphere)
      assert_almost_equal(k_max, RK, decimal=4)
  
      # TEST - when mask is given
      mask = np.ones((2, 2, 2), dtype="bool")
      mask[1, 1, 1] = 0
      RK[1, 1, 1] = 0
      k_max = dki.kurtosis_maximum(dkiF.model_params, mask=mask)
      assert_almost_equal(k_max, RK, decimal=4)
  
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 20 for calling a global function with example usage: test_multi_voxel_kurtosis_maximum() without return types