Quantitative maps from neighbor statistics#

import pyclesperanto_prototype as cle
import numpy as np
from numpy import random
from skimage.io import imread
import matplotlib

The example imge “maize_clsm.tif” was taken from the repository mathematical_morphology_with_MorphoLibJ and is licensed by David Legland under CC-BY 4.0 license

intensity_image = imread('../../data/maize_clsm.tif')
cle.imshow(intensity_image)
../_images/quantitative_neighbor_maps_3_0.png

Starting point: Label map#

binary = cle.binary_not(cle.threshold_otsu(intensity_image))
cells = cle.voronoi_labeling(binary)

cle.imshow(cells, labels=True)
../_images/quantitative_neighbor_maps_5_0.png

Nearest neighbor distance maps#

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')
../_images/quantitative_neighbor_maps_7_0.png
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')
../_images/quantitative_neighbor_maps_8_0.png

Touching neighbor distance map#

average_neighbor_distance_map = cle.average_neighbor_distance_map(cells)
cle.imshow(average_neighbor_distance_map, color_map='jet')
../_images/quantitative_neighbor_maps_10_0.png