def test_predict_dki(): with nbtmp.InTemporaryDirectory() as tmpdir: fbval = op.join(tmpdir, 'dki.bval') fbvec = op.join(tmpdir, 'dki.bvec') fdata = op.join(tmpdir, 'dki.nii.gz') make_dki_data(fbval, fbvec, fdata) file_dict = dki.fit_dki(fdata, fbval, fbvec, out_dir=tmpdir) params_file = file_dict['params'] gtab = dpg.gradient_table(fbval, fbvec) predict_fname = dki.predict(params_file, gtab, S0_file=fdata, out_dir=tmpdir) prediction = nib.load(predict_fname).get_data() npt.assert_almost_equal(prediction, nib.load(fdata).get_data())
def test_fit_dki(): fdata, fbval, fbvec = dpd.get_data('small_101D') with nbtmp.InTemporaryDirectory() as tmpdir: file_dict = dki.fit_dki(fdata, fbval, fbvec, out_dir=tmpdir) for f in file_dict.values(): op.exists(f)