Clustering

Clustering

← Back to Notebook Examples

notebooks/clustering/clustering_basics.ipynb

Runs five unsupervised clustering algorithms — methods that group similar pixels together without needing any labels — on a SEM microscopy image, using spice.clustering.<method>(). Each one builds a new SPICEData holding the integer label array (it doesn’t change the original image), records what it did in spice.history, and stores extra in-between results in the new object’s extra dict — for example ws_spice.extra['watershed_binary'] and ws_spice.extra['watershed_distance'] for watershed, or otsu_spice.extra['otsu_thresholds'] for multi-Otsu. Covers: marker-based watershed, SLIC superpixels (shown with boundary outlines and average-color regions), Felzenszwalb graph-based segmentation, multi-Otsu brightness thresholding, and Quickshift. The watershed result is saved with full provenance tracking.