<jupyter_start><jupyter_text>Basic statistics with pyclesperantoA common use case for image processing in the biology context is deriving statistics of segmented objects. clEsperanto offers a function for that: [statistics_of_labelled_pixels](https://clij.github.io/clij2-docs/reference_statisticsOfLabelledPixels).<jupyter_code>import pyclesperanto_prototype as cle

import pandas as pd
from skimage.io import imread, imsave, imshow
import matplotlib
import numpy as np

# initialize GPU
cle.select_device("RTX")
# load data
image = imread('../../data/blobs.tif')

# segment the image
labels = cle.voronoi_otsu_labeling(image, spot_sigma=3.5)
cle.imshow(labels, labels=True)<jupyter_output><empty_output><jupyter_text>Deriving basic statistics of labelled objects<jupyter_code>statistics = cle.statistics_of_labelled_pixels(image, labels)
statistics.keys()<jupyter_output><empty_output><jupyter_text>We can use [pandas](https://pandas.pydata.org/) to process that kind of tabular data.<jupyter_code>table = pd.DataFrame(statistics)
table
table.describe()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09493087557603687, 'fraction_numerical': 0.0027649769585253456, 'mean_word_length': 7.758064516129032, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '589253', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 363, 'n_tokens_neox': 351, 'n_words': 82, 'path': 'docs/22_feature_extraction/statistics_with_pyclesperanto.ipynb', 'repo_name': 'rayanirban/BioImageAnalysisNotebooks', 'size': '1085'}