code: def test_kurtosis_to_smt2_conversion():
      # 1. Check conversion of smt2 awf to kurtosis
      # When awf = 0 kurtosis was to be 0
      awf0 = 0
      kexp0 = 0
      kest0 = msk_from_awf(awf0)
      assert_almost_equal(kest0, kexp0)
  
      # When awf = 1 kurtosis was to be 2.4
      awf1 = 1
      kexp1 = 2.4
      kest1 = msk_from_awf(awf1)
      assert_almost_equal(kest1, kexp1)
  
      # Check the inversion of msk_from_awf
      awf_test_array = np.linspace(0, 1, 100)
      k_exp = msk_from_awf(awf_test_array)
      awf_from_k = awf_from_msk(k_exp)
      assert_array_almost_equal(awf_from_k, awf_test_array)
  
      # Check the awf_from_msk estimates when kurtosis is out of expected
      # interval ranges - note that under SMT2 assumption MSK is never lower
      # than 0 and never higher than 2.4. Since SMT2 assumptions are commonly not
      # met kurtosis can be out of this expected range. So, if MSK is lower than
      # 0, f is set to 0 (avoiding negative f). On the other hand, if MSK is
      # higher than 2.4, f is set to the maximum value of 1.
      assert_array_almost_equal(
          awf_from_msk(np.array([-0.1, 2.5])), np.array([0.0, 1.0])
      )
  
      # if msk = np.nan, function outputs awf=np.nan
      assert_(np.isnan(awf_from_msk(np.array(np.nan))))
  
file_path: dipy/dipy/reconst/tests/test_msdki.py
imports: import numpy
  import random
  from numpy.testing import assert_array_almost_equal, assert_raises, assert_almost_equal, assert_
  from dipy.sims.voxel import single_tensor, multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table, unique_bvals_magnitude, round_bvals
  from dipy.data import get_fnames
  import dipy.reconst.msdki
  from dipy.reconst.msdki import msk_from_awf, awf_from_msk
label_desc: Use image node_id 8 for calling a global function with example usage: test_kurtosis_to_smt2_conversion() without return types