code: def test_md_regularization():
      # single voxel
      gtf = (
          0.97  # for this ground truth value, md is larger than 2.7e-3
      )
      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=[(90, 0), (90, 0)],
          fractions=[(1 - gtf) * 100, gtf * 100],
          snr=None,
      )
      fwdm = fwdti.FreeWaterTensorModel(gtab_2s, "NLS")
      fwefit = fwdm.fit(S_conta)
  
      assert_array_almost_equal(fwefit.fa, 0.0)
      assert_array_almost_equal(fwefit.md, 0.0)
      assert_array_almost_equal(fwefit.f, 1.0)
  
      # multi voxel
      DWI[0, 1, 1] = S_conta
      GTF[0, 1, 1] = 1
      FAref[0, 1, 1] = 0
      MDref[0, 1, 1] = 0
  
      fwefit = fwdm.fit(DWI)
      assert_array_almost_equal(fwefit.fa, FAref)
      assert_array_almost_equal(fwefit.md, MDref)
      assert_array_almost_equal(fwefit.f, GTF)
  
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 11 for calling a global function with example usage: test_md_regularization() without return types