pyramids_3d.py 文件源码

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

项目:Vessel3DDL 作者: konopczynski 项目源码 文件源码
def pyramid_expand_3d(volume, upscale=2, sigma=None, order=1, mode='reflect', cval=0):
    _check_factor(upscale)
    #_check_float32(volume)
    #volume=img_as_float(volume)
    volume=volume.astype('float64') # /(12641.6)  #
    x = volume.shape[0]
    y = volume.shape[1]
    z = volume.shape[2]
    out_x = math.ceil(upscale * x)
    out_y = math.ceil(upscale * y)
    out_z = math.ceil(upscale * z)

    if sigma is None:
        # automatically determine sigma which covers > 99% of distribution
        sigma = 2 * upscale / 6.0

    start_time = time.time()
    resized = resize(volume, (out_x, out_y, out_z), order=order, mode=mode, cval=cval)
    start_time = time.time()
    out = _smooth_3d(resized, sigma, mode, cval)
    # I want it to be float32
    start_time = time.time()    
    out=out.astype('float32')
    return out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号