pyramids_3d.py 文件源码

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

项目:Vessel3DDL 作者: konopczynski 项目源码 文件源码
def _smooth_3d(volume, sigma, mode, cval):
    """Return volume with each channel smoothed by the Gaussian filter."""
    smoothed = np.empty(volume.shape, dtype=np.double)
    # apply Gaussian filter to all dimensions independently
    # volume.ndim == 4 means the volume is multimodal
    if volume.ndim == 4:
        # compute 3d convolution for each modality, dim is a modality
        for dim in range(volume.shape[3]):
            ndi.gaussian_filter(volume[..., dim], sigma,
                                output=smoothed[..., dim],
                                mode=mode, cval=cval)
    else:
        ndi.gaussian_filter(volume, sigma, output=smoothed, mode=mode, cval=cval)
    return smoothed
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号