(image_segmentation.split_touching_objects)

Split touching objects#

In this section we will split objects in binary images that have a roundish shape and touch each other. We will use the napari plugin napari-segment-blobs-and-things-with-membranes. Under the hood, this plugins uses functions from scikit-image.

from napari_segment_blobs_and_things_with_membranes import threshold_otsu, split_touching_objects
from skimage.io import imread
from skimage import data
from pyclesperanto_prototype import imshow

Starting point for this is a binary image, e.g. made using thresholding.

blobs = imread('../../data/blobs.tif')

binary = threshold_otsu(blobs)

imshow(binary)
../_images/08a_split_touching_objects_3_0.png

We can then split the touching object by only taking the binary image into account. The underlying algorithm aims to produce similar results to ImageJ’s binary watershed algorithm and the implementation here also works in 3D.

split_objects = split_touching_objects(binary)
imshow(split_objects)
../_images/08a_split_touching_objects_5_0.png