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]
spatial_image_analysis.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录