test_scripts.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:pyAFQ 作者: yeatmanlab 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号