Spatial Shrunken Centroids (SSC) Segmentation
License: noncommercial — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see metadata.tool_license).
Summary
Spatial shrunken centroids (SSC) is an unsupervised clustering method for mass spectrometry imaging that identifies spatially coherent metabolite regions by combining feature selection with adaptive spatial weighting. It produces k tissue-specific clusters with tunable sparsity to control feature selection stringency.
When to use
Apply SSC when you have preprocessed and normalized MS imaging data (e.g., after TIC normalization and peak processing) and need to discover spatially distinct metabolite regions without prior tissue annotation. SSC is appropriate when you want to balance feature selection (via sparsity parameters) with spatial coherence (via adaptive radius weighting) to avoid over-segmentation or loss of localized signals.
When NOT to use
- Input is already a tissue-labeled or manually annotated region map — use supervised classification instead.
- Data has not been normalized (TIC) or peak-filtered — SSC requires preprocessed intensities to avoid artifacts.
- Spatial coordinates are missing or unreliable — SSC depends on pixel adjacency; non-spatial clustering may be more appropriate.
- You need to preserve all original features equally — SSC sparsity parameters will remove low-weight features, reducing dimensionality by design.
Inputs
- Normalized and peak-processed Cardinal object (mzImage or imagingExperiment)
- Preprocessed feature matrix with TIC normalization and peak filtering applied
- Spatial coordinates (x, y pixel positions for each spectrum)
Outputs
- SSC cluster assignments (vector of cluster membership per spectrum/pixel)
- Spatial segmentation map (image showing cluster regions)
- Feature importance scores per cluster (from sparsity-penalized centroids)
- Annotated Cardinal object with SSC results attached
- Converted Seurat object with SSC assay and metadata for downstream analysis
How to apply
After loading a normalized and peak-processed Cardinal object, run spatial shrunken centroids segmentation with adaptive weights, specifying a spatial radius (e.g., radius=2 pixels), the target number of clusters (e.g., k=8), and a sequence of sparsity parameters (e.g., s=2,4,8,16,32,64) to explore feature selection trade-offs. The adaptive weights incorporate spatial neighborhood information within the specified radius. Select the optimal sparsity parameter by examining cluster stability and interpretability (e.g., s=32 for moderate feature selection). Annotate the resulting SSC clusters back to the Cardinal object using the annotation function with the chosen radius, k, and sparsity, then convert to a Seurat object for downstream statistical and pathway analysis.
Related tools
- Cardinal (Provides the imagingExperiment data structure, feature normalization (TIC), peak processing, and the SSC segmentation function with adaptive spatial weighting) — https://github.com/Vitek-Lab/Cardinal3-vignettes
- SpaMTP (Wraps Cardinal segmentation results and provides downstream functions for differential metabolite expression, pathway analysis, and visualization on annotated SSC clusters) — https://github.com/GenomicsMachineLearning/SpaMTP
- Seurat (Post-segmentation platform for statistical testing (differential expression), clustering visualization, and integrative multi-omics analysis of SSC-annotated metabolite data)
Examples
# After loading and normalizing Cardinal object:
ssc_result <- spatialShrunkenCentroids(pig206_cardinal, r=2, k=8, s=32, weights='adaptive')
annotated_cardinal <- add_ssc_annotation(pig206_cardinal, r=2, k=8, s=32, result=ssc_result)
seurat_obj <- CardinalToSeurat(annotated_cardinal)
Evaluation signals
- Cluster counts match the specified k parameter and cluster assignments span all k values (no empty clusters after filtering).
- Spatial segmentation map shows contiguous or near-contiguous regions; large salt-and-pepper noise suggests radius or k may be misspecified.
- Feature importance (sparsity) gradually increases from s=2 to s=64; monotonic trends confirm sparsity parameter sweep is working.
- Clusters correlate with known tissue boundaries or metabolite gradients (validated by co-localization with reference metabolites or histology if available).
- Differential metabolite expression within top-ranked clusters (after SSC annotation) shows expected fold-changes (e.g., > 1.5–2× for biologically relevant metabolites).
Limitations
- SSC requires pre-specification of k clusters; no automatic k-selection algorithm is described. Over- or under-specification leads to fragmented or merged regions.
- Sparsity parameters (s) must be manually tuned; no principled criterion for optimal s is provided beyond visual inspection or downstream validation.
- Performance on very large datasets (>10,000 spectra) or high-resolution imaging is not characterized; computational cost may scale with spatial radius and k.
- SSC assumes Euclidean spatial neighborhoods; irregular tissue shapes or large holes may violate the adaptive weighting model.
- The method is sensitive to preprocessing quality; incomplete normalization or peak detection errors propagate into segmentation artifacts.
Evidence
- [other] Run spatial shrunken centroids (SSC) segmentation with adaptive weights, radius=2, k=8 clusters, and sparsity parameters s=2,4,8,16,32,64.: "Run spatial shrunken centroids (SSC) segmentation with adaptive weights, radius=2, k=8 clusters, and sparsity parameters s=2,4,8,16,32,64."
- [other] Annotate SSC results back to the Cardinal object using add_ssc_annotation(r=2,k=8,s=32).: "Annotate SSC results back to the Cardinal object using add_ssc_annotation(r=2,k=8,s=32)."
- [other] Convert the processed Cardinal object to a SpaMTP Seurat object using CardinalToSeurat().: "Convert the processed Cardinal object to a SpaMTP Seurat object using CardinalToSeurat()."
- [readme] SpaMTP inherits functionalities from two well established R packages (Cardinal and Seurat) to present a user-friendly platform for integrative spatial-omics analysis.: "SpaMTP inherits functionalities from two well established R packages (Cardinal and Seurat) to present a user-friendly platform for integrative spatial-omics analysis."
- [other] Apply TIC normalization followed by peakProcess with SNR threshold=3, sampleSize=0.1, tolerance=0.5 mz to generate 687 cleaned peaks.: "Apply TIC normalization followed by peakProcess with SNR threshold=3, sampleSize=0.1, tolerance=0.5 mz to generate 687 cleaned peaks."
1---2name: spatial-segmentation-shrunken-centroids3description: Use when apply SSC when you have preprocessed and normalized MS imaging data (e.g., after TIC normalization and peak processing) and need to discover spatially distinct metabolite regions without prior tissue annotation.4license: CC-BY-4.05---67# Spatial Shrunken Centroids (SSC) Segmentation89> **License: noncommercial** — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see `metadata.tool_license`). <!-- asb-license-banner -->10## Summary1112Spatial shrunken centroids (SSC) is an unsupervised clustering method for mass spectrometry imaging that identifies spatially coherent metabolite regions by combining feature selection with adaptive spatial weighting. It produces k tissue-specific clusters with tunable sparsity to control feature selection stringency.1314## When to use1516Apply SSC when you have preprocessed and normalized MS imaging data (e.g., after TIC normalization and peak processing) and need to discover spatially distinct metabolite regions without prior tissue annotation. SSC is appropriate when you want to balance feature selection (via sparsity parameters) with spatial coherence (via adaptive radius weighting) to avoid over-segmentation or loss of localized signals.1718## When NOT to use1920- Input is already a tissue-labeled or manually annotated region map — use supervised classification instead.21- Data has not been normalized (TIC) or peak-filtered — SSC requires preprocessed intensities to avoid artifacts.22- Spatial coordinates are missing or unreliable — SSC depends on pixel adjacency; non-spatial clustering may be more appropriate.23- You need to preserve all original features equally — SSC sparsity parameters will remove low-weight features, reducing dimensionality by design.2425## Inputs2627- Normalized and peak-processed Cardinal object (mzImage or imagingExperiment)28- Preprocessed feature matrix with TIC normalization and peak filtering applied29- Spatial coordinates (x, y pixel positions for each spectrum)3031## Outputs3233- SSC cluster assignments (vector of cluster membership per spectrum/pixel)34- Spatial segmentation map (image showing cluster regions)35- Feature importance scores per cluster (from sparsity-penalized centroids)36- Annotated Cardinal object with SSC results attached37- Converted Seurat object with SSC assay and metadata for downstream analysis3839## How to apply4041After loading a normalized and peak-processed Cardinal object, run spatial shrunken centroids segmentation with adaptive weights, specifying a spatial radius (e.g., radius=2 pixels), the target number of clusters (e.g., k=8), and a sequence of sparsity parameters (e.g., s=2,4,8,16,32,64) to explore feature selection trade-offs. The adaptive weights incorporate spatial neighborhood information within the specified radius. Select the optimal sparsity parameter by examining cluster stability and interpretability (e.g., s=32 for moderate feature selection). Annotate the resulting SSC clusters back to the Cardinal object using the annotation function with the chosen radius, k, and sparsity, then convert to a Seurat object for downstream statistical and pathway analysis.4243## Related tools4445- **Cardinal** (Provides the imagingExperiment data structure, feature normalization (TIC), peak processing, and the SSC segmentation function with adaptive spatial weighting) — https://github.com/Vitek-Lab/Cardinal3-vignettes46- **SpaMTP** (Wraps Cardinal segmentation results and provides downstream functions for differential metabolite expression, pathway analysis, and visualization on annotated SSC clusters) — https://github.com/GenomicsMachineLearning/SpaMTP47- **Seurat** (Post-segmentation platform for statistical testing (differential expression), clustering visualization, and integrative multi-omics analysis of SSC-annotated metabolite data)4849## Examples5051```52# After loading and normalizing Cardinal object:53ssc_result <- spatialShrunkenCentroids(pig206_cardinal, r=2, k=8, s=32, weights='adaptive')54annotated_cardinal <- add_ssc_annotation(pig206_cardinal, r=2, k=8, s=32, result=ssc_result)55seurat_obj <- CardinalToSeurat(annotated_cardinal)56```5758## Evaluation signals5960- Cluster counts match the specified k parameter and cluster assignments span all k values (no empty clusters after filtering).61- Spatial segmentation map shows contiguous or near-contiguous regions; large salt-and-pepper noise suggests radius or k may be misspecified.62- Feature importance (sparsity) gradually increases from s=2 to s=64; monotonic trends confirm sparsity parameter sweep is working.63- Clusters correlate with known tissue boundaries or metabolite gradients (validated by co-localization with reference metabolites or histology if available).64- Differential metabolite expression within top-ranked clusters (after SSC annotation) shows expected fold-changes (e.g., > 1.5–2× for biologically relevant metabolites).6566## Limitations6768- SSC requires pre-specification of k clusters; no automatic k-selection algorithm is described. Over- or under-specification leads to fragmented or merged regions.69- Sparsity parameters (s) must be manually tuned; no principled criterion for optimal s is provided beyond visual inspection or downstream validation.70- Performance on very large datasets (>10,000 spectra) or high-resolution imaging is not characterized; computational cost may scale with spatial radius and k.71- SSC assumes Euclidean spatial neighborhoods; irregular tissue shapes or large holes may violate the adaptive weighting model.72- The method is sensitive to preprocessing quality; incomplete normalization or peak detection errors propagate into segmentation artifacts.7374## Evidence7576- [other] Run spatial shrunken centroids (SSC) segmentation with adaptive weights, radius=2, k=8 clusters, and sparsity parameters s=2,4,8,16,32,64.: "Run spatial shrunken centroids (SSC) segmentation with adaptive weights, radius=2, k=8 clusters, and sparsity parameters s=2,4,8,16,32,64."77- [other] Annotate SSC results back to the Cardinal object using add_ssc_annotation(r=2,k=8,s=32).: "Annotate SSC results back to the Cardinal object using add_ssc_annotation(r=2,k=8,s=32)."78- [other] Convert the processed Cardinal object to a SpaMTP Seurat object using CardinalToSeurat().: "Convert the processed Cardinal object to a SpaMTP Seurat object using CardinalToSeurat()."79- [readme] SpaMTP inherits functionalities from two well established R packages (Cardinal and Seurat) to present a user-friendly platform for integrative spatial-omics analysis.: "SpaMTP inherits functionalities from two well established R packages (Cardinal and Seurat) to present a user-friendly platform for integrative spatial-omics analysis."80- [other] Apply TIC normalization followed by peakProcess with SNR threshold=3, sampleSize=0.1, tolerance=0.5 mz to generate 687 cleaned peaks.: "Apply TIC normalization followed by peakProcess with SNR threshold=3, sampleSize=0.1, tolerance=0.5 mz to generate 687 cleaned peaks."