code: def test_fwdti_predictions():
      # single voxel case
      gtf = 0.50  # ground truth volume fraction
      angles = [(90, 0), (90, 0)]
      mevals = np.array(
          [[0.0017, 0.0003, 0.0003], [0.003, 0.003, 0.003]]
      )
      S_conta, peaks = multi_tensor(
          gtab_2s,
          mevals,
          S0=100,
          angles=angles,
          fractions=[(1 - gtf) * 100, gtf * 100],
          snr=None,
      )
      R = all_tensor_evecs(peaks[0])
      R = R.reshape(9)
      model_params = np.concatenate(
          ([0.0017, 0.0003, 0.0003], R, [gtf]), axis=0
      )
      S_pred1 = fwdti_prediction(model_params, gtab_2s, S0=100)
      assert_array_almost_equal(S_pred1, S_conta)
  
      # Testing in model class
      fwdm = fwdti.FreeWaterTensorModel(gtab_2s)
      S_pred2 = fwdm.predict(model_params, S0=100)
      assert_array_almost_equal(S_pred2, S_conta)
  
      # Testing in fit class
      fwefit = fwdm.fit(S_conta)
      S_pred3 = fwefit.predict(gtab_2s, S0=100)
      assert_array_almost_equal(S_pred3, S_conta, decimal=5)
  
      # Multi voxel simulation
      S_pred1 = fwdti_prediction(
          model_params_mv, gtab_2s, S0=100
      )  # function
      assert_array_almost_equal(S_pred1, DWI)
      S_pred2 = fwdm.predict(model_params_mv, S0=100)  # Model class
      assert_array_almost_equal(S_pred2, DWI)
      fwefit = fwdm.fit(DWI)  # Fit class
      S_pred3 = fwefit.predict(gtab_2s, S0=100)
      assert_array_almost_equal(S_pred3, DWI)
  
imports: import numpy
  import dipy.reconst.dti
  import dipy.reconst.fwdti
  from dipy.reconst.fwdti import fwdti_prediction
  from numpy.testing import assert_array_almost_equal, assert_almost_equal, assert_raises
  from dipy.reconst.dti import from_lower_triangular, decompose_tensor, fractional_anisotropy
  from dipy.reconst.fwdti import lower_triangular_to_cholesky, cholesky_to_lower_triangular, nls_fit_tensor, wls_fit_tensor
  from dipy.sims.voxel import multi_tensor, single_tensor, all_tensor_evecs, multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table
  from dipy.data import get_fnames
label_desc: Use image node_id 5 for calling a global function with example usage: test_fwdti_predictions() without return types