Image Clustering¶
JuSPICE provides a suite of unsupervised image clustering algorithms that
partition an image into spatially coherent regions based on intensity, texture,
or graph-theoretic criteria. These are distinct from the deep-learning and
foundation-model pipelines described in Image Segmentation, which JuSPICE
exposes through the separate spice.segmentation accessor. Pick an
algorithm below.
Watershed
Distance-transform flooding that separates touching objects.
SLIC Superpixels
Compact, colour-homogeneous superpixels via local k-means.
Felzenszwalb
Efficient graph-based segmentation with an adaptive threshold.
Otsu Multi-Threshold
Histogram-based optimal thresholding into N intensity classes.
Quickshift
Kernel-density mode-seeking with a hierarchy of segmentations.
K-means
Per-pixel feature-vector clustering across every channel.
All six algorithms are accessible through
ClusteringAccessor
(spice.clustering.*).
Core API¶
See juspice.clustering_module for full API details and Clustering for a module-level explanation.
Notebook example¶
A complete workflow example is available in:
The notebook loads a SEM image via load_data(), applies all
five algorithms, and saves the watershed label array through
save_data() so that the result includes a provenance JSON
sidecar and a reproducible history script.
For K-means clustering over multi-channel per-pixel feature vectors, see:
notebooks/io/io_afm2.ipynb (see Notebook Examples) — clusters all 8 channels of an AFM
.spmscan withspice.clustering.kmeans_clustering().
References¶
Libraries
scikit-image — provides five segmentation algorithms (watershed, SLIC, Felzenszwalb, Otsu multi-threshold, Quickshift)
scikit-learn — provides K-means clustering
NumPy — label array storage and statistical post-processing
See Bibliography for the publications behind the methods on this page.