spatial_image_analysis.py 文件源码

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

项目:tissue_analysis 作者: VirtualPlants 项目源码 文件源码
def find_smallest_boundingbox(image, label_1, label_2):
    """Return the smallest boundingbox within `image` between cell-labels `label_1` & `label_2`."""
    boundingbox = nd.find_objects(image, max_label=max([label_1, label_2]))
    boundingbox = {label_1:boundingbox[label_1-1], label_2:boundingbox[label_2-1]} # we do 'label_x - 1' since 'nd.find_objects' start at '1' (and not '0') !
    label_1, label_2 = sort_boundingbox(boundingbox, label_1, label_2)
    return bbox[label_1]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号