regions.py 文件源码

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

项目:diluvian 作者: aschampion 项目源码 文件源码
def remask(self):
        """Reset the mask based on the seeded connected component.
        """
        body = self.to_body()
        if not body.is_seed_in_mask():
            return False
        new_mask_bin, bounds = body.get_seeded_component(CONFIG.postprocessing.closing_shape)
        new_mask_bin = new_mask_bin.astype(np.bool)

        mask_block = self.mask[map(slice, bounds[0], bounds[1])].copy()
        # Clip any values not in the seeded connected component so that they
        # cannot not generate moves when rechecking.
        mask_block[~new_mask_bin] = np.clip(mask_block[~new_mask_bin], None, 0.9 * CONFIG.model.t_move)

        self.mask[:] = np.NAN
        self.mask[map(slice, bounds[0], bounds[1])] = mask_block
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号