<jupyter_start><jupyter_text>Eroded Otsu-labelingSegments and labels an image using blurring, Otsu-thresholding, binary erosion andmasked Voronoi-labeling.After bluring and Otsu-thresholding the image, iterative binary erosion is applied.Objects in the eroded image are labeled and the labels are extended to fit again intothe initial binary image using masked-Voronoi labeling.This function is similar to voronoi_otsu_labeling. It is intended to deal better incase labels of objects swapping into each other if objects are dense. Like when usingVoronoi-Otsu-labeling, small objects may disappear when applying this operation.This function is inspired by a similar [implementation in Java](https://github.com/biovoxxel/bv3dbox/blob/9e38ed02cff606e7e8fbe57db0f6af810bf1a83a/BioVoxxel_3D_Box/src/main/java/de/biovoxxel/bv3dbox/plugins/BV_LabelSplitter.javaL83) by <NAME> (Biovoxxel) in the [Biovoxxel toolbox](https://zenodo.org/badge/latestdoi/434949702). Big thanks Jan!<jupyter_code>from skimage.data import cells3d
import pyclesperanto_prototype as cle
image = cells3d()
image.shape
nuclei = image[30, 1]

cle.imshow(nuclei)
labels = cle.eroded_otsu_labeling(nuclei, number_of_erosions=11, outline_sigma=4)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>Parameter: number_of_erosionsIf the specified number of erosions is too small, sticky objects will be labeled together.<jupyter_code>labels = cle.eroded_otsu_labeling(nuclei, number_of_erosions=5, outline_sigma=4)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>If too many erosions are configured, objects may disappear.<jupyter_code>labels = cle.eroded_otsu_labeling(nuclei, number_of_erosions=20, outline_sigma=4)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>Parameter: outline_sigmaWith this outline, you can control the denoising before thresholding. If this value is too low, objects may have noisy edges and holes lead to more object-splits.<jupyter_code>labels = cle.eroded_otsu_labeling(nuclei, number_of_erosions=5, outline_sigma=1)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>If this value is too high, object outlines may be not fitting to the original objects anymore.<jupyter_code>labels = cle.eroded_otsu_labeling(nuclei, number_of_erosions=11, outline_sigma=10)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>Similar algorithm: Voronoi-Otsu-LabelingVoronoi-Otsu-Labeling is a similar algorithm. When you see labels swapping over in neighbor-objects when using it like shown below, you may want to give object-splitting-Otsu-labeling a try.<jupyter_code>labels = cle.voronoi_otsu_labeling(nuclei, spot_sigma=10, outline_sigma=5)

cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>Documentation<jupyter_code>cle.eroded_otsu_labeling?<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07946336429308566, 'fraction_numerical': 0.019263845889232887, 'mean_word_length': 8.0875, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '335189', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1031, 'n_tokens_neox': 970, 'n_words': 236, 'path': 'demo/segmentation/object_splitting_otsu_labeling.ipynb', 'repo_name': 'DrLachie/pyclesperanto_prototype', 'size': '2912'}