test_scripts.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号