postprocessing.py 文件源码

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

项目:diluvian 作者: aschampion 项目源码 文件源码
def get_largest_component(self, closing_shape=None):
        mask, bounds = self._get_bounded_mask(closing_shape)

        label_im, num_labels = ndimage.label(mask)
        label_sizes = ndimage.sum(mask, label_im, range(num_labels + 1))
        label_im[(label_sizes < label_sizes.max())[label_im]] = 0
        label_im = np.minimum(label_im, 1)

        if label_im[tuple(self.seed - bounds[0])] == 0:
            logging.warning('Seed voxel ({}) is not in connected component.'.format(np.array_str(self.seed)))

        return label_im, bounds
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号