Annotation.py 文件源码

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

项目:pylidc 作者: pylidc 项目源码 文件源码
def bbox(self, image_coords=True):
        """
        Return a 3 by 2 matrix, corresponding to the bounding box of the 
        annotation within the scan. If `scan_slice` is a numpy array 
        containing aslice of the scan, each slice of the annotation is 
        contained within the box:

            bbox[0,0]:bbox[0,1]+1, bbox[1,0]:bbox[1,1]+1

        If `image_coords` is `False` then each annotation slice is 
        instead contained within:

            bbox[1,0]:bbox[1,1]+1, bbox[0,0]:bbox[0,1]+1

        The last row of `bbox` give the inclusive lower and upper 
        bounds of the `image_z_position`.
        """
        matrix = self.contours_to_matrix()
        bbox   = np.c_[matrix.min(axis=0), matrix.max(axis=0)]
        return bbox if not image_coords else bbox[[1,0,2]]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号