Voronoi-Otsu-Labeling on binary images#

The Voronoi-Otsu-Labeling algorithm can also be used on binary images, leading to similar results like the binary watershed in ImageJ. It splits roundish objects in case they stick together.

from skimage.io import imread
from napari_segment_blobs_and_things_with_membranes import voronoi_otsu_labeling, threshold_otsu
import stackview

To demonstrate this, we start wit a binary image.

blobs_image = imread("../../data/blobs.tif")
binary_image = threshold_otsu(blobs_image)

binary_image
nsbatwm made image
shape(254, 256)
dtypeint32
size254.0 kB
min0
max1

We now apply Voronoi-Otsu-Labeling to the binary image.

label_image = voronoi_otsu_labeling(binary_image, spot_sigma=3.5)

label_image
nsbatwm made image
shape(254, 256)
dtypeint32
size254.0 kB
min0
max67

Exercise#

Below you see the result of the Watershed in ImageJ. How do you need to modify the label_image result above to turn it again into a binary image like the result of ImageJ?

binary_watershed_imagej = imread("../../data/blobs_otsu_watershed.tif")

stackview.insight(binary_watershed_imagej)
shape(254, 256)
dtypeuint8
size63.5 kB
min0
max255