test_plot.py 文件源码

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

项目:xdesign 作者: tomography 项目源码 文件源码
def test_discrete_phantom_uniform():
    """The uniform discrete phantom is the same after rotating 90 degrees."""

    d0 = discrete_phantom(p, 100, ratio=10, prop='mass_atten')

    p.rotate(theta=np.pi/2, point=Point([0.5, 0.5]))
    d1 = np.rot90(discrete_phantom(p, 100, ratio=10, prop='mass_atten'))

    # plot rotated phantom
    plot_phantom(p)

    # plot the error
    plt.figure()
    plt.imshow(d1-d0, interpolation=None)
    plt.colorbar()

    # plt.show(block=True)
    # assert_allclose(d0, d1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号