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