def test_fit_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)
cmd = ["pyAFQ_dki", "-d", fdata, "-l", fbval, "-c", fbvec,
"-o", tmpdir]
out = runner.run_command(cmd)
npt.assert_equal(out[0], 0)
# Get expected values
names = ['FA', 'MD', 'AD', 'RD', 'MK', 'AK', 'RK']
for n in names:
fname = op.join(tmpdir, "dki_%s.nii.gz" % n)
img = nib.load(fdata)
affine = img.get_affine()
shape = img.shape[:-1]
assert_image_shape_affine(fname, shape, affine)
评论列表
文章目录