code: def test_kurtosis_elements():
      """Testing symmetry of the elements of the KT
  
      As an 4th order tensor, KT has 81 elements. However, due to diffusion
      symmetry the KT is fully characterized by 15 independent elements. This
      test checks for this property.
      """
      # two fiber not aligned to planes x = 0, y = 0, or z = 0
      mevals = np.array(
          [
              [0.00099, 0, 0],
              [0.00226, 0.00087, 0.00087],
              [0.00099, 0, 0],
              [0.00226, 0.00087, 0.00087],
          ]
      )
      angles = [(80, 10), (80, 10), (20, 30), (20, 30)]
      fie = 0.49  # intra axonal water fraction
      frac = [fie * 50, (1 - fie) * 50, fie * 50, (1 - fie) * 50]
      sticks = _check_directions(angles)
      mD = np.zeros((len(frac), 3, 3))
      for i in range(len(frac)):
          R = all_tensor_evecs(sticks[i])
          mD[i] = np.dot(np.dot(R, np.diag(mevals[i])), R.T)
  
      # compute global DT
      D = np.zeros((3, 3))
      for i in range(len(frac)):
          D = D + frac[i] * mD[i]
  
      # compute voxel's MD
      MD = (D[0][0] + D[1][1] + D[2][2]) / 3
  
      # Reference dictionary with the 15 independent elements.
      # Note: The multiplication of the indexes (i+1) * (j+1) * (k+1) * (l+1)
      # for of an elements is only equal to this multiplication for another
      # element if an only if the element corresponds to an symmetry element.
      # Thus indexes multiplication is used as key of the reference dictionary
      kt_ref = {
          1: kurtosis_element(mD, frac, 0, 0, 0, 0),
          16: kurtosis_element(mD, frac, 1, 1, 1, 1),
          81: kurtosis_element(mD, frac, 2, 2, 2, 2),
          2: kurtosis_element(mD, frac, 0, 0, 0, 1),
          3: kurtosis_element(mD, frac, 0, 0, 0, 2),
          8: kurtosis_element(mD, frac, 0, 1, 1, 1),
          24: kurtosis_element(mD, frac, 1, 1, 1, 2),
          27: kurtosis_element(mD, frac, 0, 2, 2, 2),
          54: kurtosis_element(mD, frac, 1, 2, 2, 2),
          4: kurtosis_element(mD, frac, 0, 0, 1, 1),
          9: kurtosis_element(mD, frac, 0, 0, 2, 2),
          36: kurtosis_element(mD, frac, 1, 1, 2, 2),
          6: kurtosis_element(mD, frac, 0, 0, 1, 2),
          12: kurtosis_element(mD, frac, 0, 1, 1, 2),
          18: kurtosis_element(mD, frac, 0, 1, 2, 2),
      }
  
      # Testing all 81 possible elements
      xyz = [0, 1, 2]
      for i in xyz:
          for j in xyz:
              for k in xyz:
                  for l in xyz:
                      key = (i + 1) * (j + 1) * (k + 1) * (l + 1)
                      assert_almost_equal(
                          kurtosis_element(mD, frac, i, k, j, l),
                          kt_ref[key],
                      )
                      # Testing optional function inputs
                      assert_almost_equal(
                          kurtosis_element(mD, frac, i, k, j, l),
                          kurtosis_element(mD, frac, i, k, j, l, D, MD),
                      )
  
file_path: dipy/dipy/sims/tests/test_voxel.py
imports: import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_, assert_almost_equal
  from dipy.sims.voxel import _check_directions, all_tensor_evecs, add_noise, single_tensor, sticks_and_ball, multi_tensor_dki, kurtosis_element, dki_signal, multi_tensor
  from dipy.data import get_fnames
  from dipy.core.gradients import gradient_table
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 8 for calling a global function with example usage: test_kurtosis_elements() without return types