render.py 文件源码

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

项目:picasso 作者: jungmannlab 项目源码 文件源码
def render(locs, info=None, oversampling=1, viewport=None, blur_method=None, min_blur_width=0):
    if viewport is None:
        try:
            viewport = [(0, 0), (info[0]['Height'], info[0]['Width'])]
        except TypeError:
            raise ValueError('Need info if no viewport is provided.')
    (y_min, x_min), (y_max, x_max) = viewport
    if blur_method is None:
        return render_hist(locs, oversampling, y_min, x_min, y_max, x_max)
    elif blur_method == 'gaussian':
        return render_gaussian(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
    elif blur_method == 'gaussian_iso':
        return render_gaussian_iso(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
    elif blur_method == 'smooth':
        return render_smooth(locs, oversampling, y_min, x_min, y_max, x_max)
    elif blur_method == 'convolve':
        return render_convolve(locs, oversampling, y_min, x_min, y_max, x_max, min_blur_width)
    else:
        raise Exception('blur_method not understood.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号