tumourkit.segmentation.hovernet.metrics.stats_utils.remap_label
- tumourkit.segmentation.hovernet.metrics.stats_utils.remap_label(pred, by_size=False)
Rename all instance id so that the id is contiguous i.e [0, 1, 2, 3] not [0, 2, 4, 6]. The ordering of instances (which one comes first) is preserved unless by_size=True, then the instances will be reordered so that bigger nucler has smaller ID.
- Args:
- predthe 2d array contain instances where each instances is marked
by non-zero integer
by_size : renaming with larger nuclei has smaller id (on-top)