spatial_image_analysis.py 文件源码

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

项目:tissue_analysis 作者: VirtualPlants 项目源码 文件源码
def consideronlylabels(self, list2consider, verbose = False):
        """
        Add labels to the ignoredlabels list (set) and update the self._labels cache.
        """
        if isinstance(list2consider, int):
            list2consider = [list2consider]

        toignore = set(np.unique(self.image))-set(list2consider)
        integers = np.vectorize(lambda x : int(x))
        toignore = integers(list(toignore)).tolist()


        if verbose: print 'Adding labels', toignore,'to the list of labels to ignore...'
        self._ignoredlabels.update(toignore)
        if verbose: print 'Updating labels list...'
        self._labels = self.__labels()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号