def test_fit_dti():
with nbtmp.InTemporaryDirectory() as tmpdir:
fbval = op.join(tmpdir, 'dti.bval')
fbvec = op.join(tmpdir, 'dti.bvec')
fdata = op.join(tmpdir, 'dti.nii.gz')
make_dti_data(fbval, fbvec, fdata)
cmd = ["pyAFQ_dti", "-d", fdata, "-l", fbval, "-c", fbvec,
"-o", tmpdir, '-b', '0']
out = runner.run_command(cmd)
npt.assert_equal(out[0], 0)
# Get expected values
names = ['FA', 'MD', 'AD', 'RD']
for n in names:
fname = op.join(tmpdir, "dti_%s.nii.gz" % n)
img = nib.load(fdata)
affine = img.get_affine()
shape = img.shape[:-1]
assert_image_shape_affine(fname, shape, affine)
评论列表
文章目录