Skip to content
Snippets Groups Projects
Commit 3257d796 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

dtifit --kurtdir does not produce mean kurtosis maps anymore

there are sevaral definitions of MK, most of which are not compatible with the simplified kurtosis model implemented by --kurtdir. So, I decided not to compute anything at all.
parent 1db3aa81
No related branches found
No related tags found
No related merge requests found
......@@ -229,7 +229,6 @@ for directory, multi_shell, kurt in gen_data():
if fkurtdir:
for idx, ref in zip(range(1, 4), [0.1, 0.05, 0.2]):
fit = nib.load(f'{base_output}_kurt{idx}.nii.gz').get_fdata()
#print('kurtosis', idx, ref, fit[0, 0, 0])
if kurt == 0:
testing.assert_allclose(fit, 0., atol=1e-5)
elif kurt == 1:
......@@ -237,19 +236,10 @@ for directory, multi_shell, kurt in gen_data():
elif kurt == 2:
testing.assert_allclose(fit, ref, rtol=0.1)
MK = nib.load(f'{base_output}_MK.nii.gz').get_fdata()
if kurt == 0:
testing.assert_allclose(kurt, 0., atol=1e-5)
elif kurt == 1:
# k_para and k_perp = 1 is different from MK=1...
assert not np.allclose(MK, 0.1, rtol=0.01)
elif kurt == 2:
testing.assert_allclose(MK, 0.35 / 3, rtol=0.1)
else:
assert not os.path.isfile(f'{base_output}_kurt1.nii.gz')
assert not os.path.isfile(f'{base_output}_kurt2.nii.gz')
assert not os.path.isfile(f'{base_output}_kurt3.nii.gz')
assert not os.path.isfile(f'{base_output}_MK.nii.gz')
else:
if isinstance(base_output, CalledProcessError): # dtifit crashed
print("dtifit crashed on an invalid run, which is fine")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment