-
Notifications
You must be signed in to change notification settings - Fork 0
Tab Segmentation
srao edited this page Aug 31, 2026
·
4 revisions
Replace the native Xenium cell segmentation with a custom segmentation produced by a separate preprocessing pipeline, enabling re-analysis with alternative cell boundaries. This tab is in the "Tools" control panel group.

| Control | Description |
|---|---|
| Active segmentation (read-only) | Displays the current segmentation — "Xenium (native)" or "Custom (from cache/file)" — along with the corresponding cell and gene counts. |
| Load Custom Segmentation... | Opens a file dialog for a custom_segmentation.h5ad file. If a cached version already exists in sdata_cached.zarr, prompts you to load from cache (fast) instead of re-importing the original file. |
| Revert to Xenium Segmentation | Restores the original Xenium cell labels and AnnData object. Disabled until a custom segmentation is loaded. |
| Update SpatialData on disk | Saves the current segmentation state (custom or native) back to sdata_cached.zarr. |
- Produce a
custom_segmentation.h5adfile using thepalms-build-custom-segmentationpipeline. This step requires R and Seurat for cell boundary extraction; see the project README for details. - In the viewer, open the Segmentation tab and click "Load Custom Segmentation...".
- Select the
custom_segmentation.h5adfile. If a cached copy exists, choose whether to load from cache or re-import. - The viewer swaps to the custom segmentation; previously computed cluster-dependent analyses are cleared.
- Re-run Leiden clustering and any downstream analyses on the new segmentation.
- To revert, click "Revert to Xenium Segmentation".
- A custom segmentation is cached in
sdata_cached.zarron first load; subsequent loads use the cached version automatically. - Building a custom segmentation is a two-stage pipeline. The boundaries are extracted first (typically in R/Seurat), then
palms-build-custom-segmentationturns them into the label raster the viewer loads. Its output is acustom_labels.zarrthat must stay beside the.h5adyou select here — selecting an.h5adon its own fails with "not found alongside h5ad". - Swapping segmentation resets active clusterings. You will need to re-run Leiden clustering on the new segmentation before cluster-dependent visualisations and analyses are available.
Reference
Cells
Genes
Spatial
- ROI Analysis
- Ligand-Receptor
- Neighborhood Enrichment
- Co-occurrence
- Spatial Domains
- Annot Nhood
- Annot Distance
Images
Tools
Tutorials
- Getting Started
- Clustering and DEG
- H&E Registration
- ARMS Overlay
- ROI Analysis
- Annotations
- Recovering a Cache