(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/a3b8abafafa9a92b9757736d44504ef401d2b47c297582559c01e3c19fce505f.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/b58983881572d2ef391594fa68463a5dbc9edfad692188d7489479ca59cb8511.png