test_data.py 文件源码

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

项目:dsb3 作者: EliasVansteenkiste 项目源码 文件源码
def resample(image, spacing, new_spacing=[1, 1, 1]):
    # Determine current pixel spacing
    spacing = np.array(spacing)
    resize_factor = spacing / new_spacing
    new_real_shape = image.shape * resize_factor
    new_shape = np.round(new_real_shape)
    real_resize_factor = new_shape / image.shape
    new_spacing = spacing / real_resize_factor
    image = scipy.ndimage.interpolation.zoom(image, real_resize_factor)
    return image, new_spacing
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号