volume_raycasting_example.py 文件源码

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

项目:ModernGL-Volume-Raycasting-Example 作者: ulricheck 项目源码 文件源码
def load_raw(filename, volsize):
    """ inspired by mhd_utils from github"""
    dim = 3
    element_channels = 1
    np_type = np.ubyte

    arr = list(volsize)
    volume = np.prod(arr[0:dim - 1])

    shape = (arr[dim - 1], volume, element_channels)
    with open(filename,'rb') as fid:
        data = np.fromfile(fid, count=np.prod(shape),dtype = np_type)
    data.shape = shape

    arr.reverse()
    data = data.reshape(arr)

    return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号