<jupyter_start><jupyter_text>Quantitative maps from neighbor statistics<jupyter_code>import pyclesperanto_prototype as cle
import numpy as np
from numpy import random
from skimage.io import imread
import matplotlib<jupyter_output><empty_output><jupyter_text>The example imge "maize_clsm.tif" was taken from the repository [mathematical_morphology_with_MorphoLibJ](https://github.com/dlegland/mathematical_morphology_with_MorphoLibJ) and is licensed by <NAME> under [CC-BY 4.0 license](https://github.com/dlegland/mathematical_morphology_with_MorphoLibJ/blob/master/LICENSE)<jupyter_code>intensity_image = imread('../../data/maize_clsm.tif')
cle.imshow(intensity_image)<jupyter_output><empty_output><jupyter_text>Starting point: Label map<jupyter_code>binary = cle.binary_not(cle.threshold_otsu(intensity_image))
cells = cle.voronoi_labeling(binary)

cle.imshow(cells, labels=True)<jupyter_output><empty_output><jupyter_text>Nearest neighbor distance maps<jupyter_code>average_distance_of_n_closest_neighbors_map = cle.average_distance_of_n_closest_neighbors_map(cells, n=1)
cle.imshow(average_distance_of_n_closest_neighbors_map, color_map='jet')
average_distance_of_n_closest_neighbors_map = cle.average_distance_of_n_closest_neighbors_map(cells, n=5)
cle.imshow(average_distance_of_n_closest_neighbors_map, color_map='jet')<jupyter_output><empty_output><jupyter_text>Touching neighbor distance map<jupyter_code>average_neighbor_distance_map = cle.average_neighbor_distance_map(cells)
cle.imshow(average_neighbor_distance_map, color_map='jet')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09085133418043202, 'fraction_numerical': 0.0025412960609911056, 'mean_word_length': 13.18918918918919, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '206434', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 595, 'n_tokens_neox': 565, 'n_words': 68, 'path': 'docs/60_data_visualization/quantitative_neighbor_maps.ipynb', 'repo_name': 'rayanirban/BioImageAnalysisNotebooks', 'size': '1581'}