tumourkit.segmentation.hovernet.misc.utils.remove_small_objects
- tumourkit.segmentation.hovernet.misc.utils.remove_small_objects(pred, min_size=64, connectivity=1)
Remove connected components smaller than the specified size.
This function is taken from skimage.morphology.remove_small_objects, but the warning is removed when a single label is provided.
- Args:
pred: input labelled array min_size: minimum size of instance in output array connectivity: The connectivity defining the neighborhood of a pixel.
- Returns:
out: output array with instances removed under min_size