# spatialdata

**URL:** https://discourse.scverse.org/c/help/spatialdata/44.md

[Latest](https://discourse.scverse.org/latest.md) · [Categories](https://discourse.scverse.org/categories.md) · [Tags](https://discourse.scverse.org/tags.md)

---

## [About the spatialdata category](https://discourse.scverse.org/t/about-the-spatialdata-category/1436)

<div class="topic-metadata">

**Author:** [@ivirshup](https://discourse.scverse.org/u/ivirshup)\
**Replies:** 0

</div>

---

## ["sd.filter\_by\_table\_query()" fails with "IndexError" on SpatialData 0.7.3 / AnnData 0.12.6](https://discourse.scverse.org/t/sd-filter-by-table-query-fails-with-indexerror-on-spatialdata-0-7-3-anndata-0-12-6/4012)

<div class="topic-metadata">

**Author:** [@albi](https://discourse.scverse.org/u/albi)\
**Replies:** 6\
**Last updated:** [June 22, 2026, 11:49pm UTC](https://discourse.scverse.org/t/sd-filter-by-table-query-fails-with-indexerror-on-spatialdata-0-7-3-anndata-0-12-6/4012 "2026-06-22T23:49:11Z")

</div>

Hi, I’m encountering an IndexError when using sd.filter\_by\_table\_query() on a SpatialData object. Versions spatialdata: 0.7.3 anndata: 0.12.6 annsel: 0.1.2 Variables print(type(keep\_mask)) \>\<class 'pandas.Series'\> pri…

---

## [Multiple coordinate systems](https://discourse.scverse.org/t/multiple-coordinate-systems/3999)

<div class="topic-metadata">

**Author:** [@albi](https://discourse.scverse.org/u/albi)\
**Replies:** 2\
**Last updated:** [May 26, 2026, 1:18pm UTC](https://discourse.scverse.org/t/multiple-coordinate-systems/3999 "2026-05-26T13:18:07Z")

</div>

Hi, I have a Zarr file generated from a CosMx dataset. When I open the object in Napari using napari-spatialdata, I see multiple coordinate systems: The only coordinate system I care about is the global one. The othe…

---

## [Grouping/merging CosMx FOVs into cores in SpatialData](https://discourse.scverse.org/t/grouping-merging-cosmx-fovs-into-cores-in-spatialdata/3971)

<div class="topic-metadata">

**Author:** [@albi](https://discourse.scverse.org/u/albi)\
**Replies:** 6\
**Last updated:** [May 26, 2026, 11:56am UTC](https://discourse.scverse.org/t/grouping-merging-cosmx-fovs-into-cores-in-spatialdata/3971 "2026-05-26T11:56:03Z")

</div>

Hi all and thanks for the awesome Python ecosystem for single-cell and spatial omics data analysis! I’m working with CosMx SpatialData from a TMA experiment, where each core consists of 4–9 FOVs. Currently, each FOV has…

---

## [Unable to save subset spatialdata to zarr](https://discourse.scverse.org/t/unable-to-save-subset-spatialdata-to-zarr/3995)

<div class="topic-metadata">

**Author:** [@npont](https://discourse.scverse.org/u/npont)\
**Replies:** 1\
**Last updated:** [May 21, 2026, 1:34pm UTC](https://discourse.scverse.org/t/unable-to-save-subset-spatialdata-to-zarr/3995 "2026-05-21T13:34:31Z")

</div>

Hello, I have subset a spatialdata using coordinates of a selection. This generated properly a new spatialdata (call it test) containing a subset of the SpatialElements initially present in the whole sdata, as desired. …

---

## [Render\_points super pixelized after subsetting SpatialData](https://discourse.scverse.org/t/render-points-super-pixelized-after-subsetting-spatialdata/3994)

<div class="topic-metadata">

**Author:** [@npont](https://discourse.scverse.org/u/npont)\
**Replies:** 2\
**Last updated:** [May 21, 2026, 11:58am UTC](https://discourse.scverse.org/t/render-points-super-pixelized-after-subsetting-spatialdata/3994 "2026-05-21T11:58:23Z")

</div>

Hello, I cropped my SpatialData object using coordinates (load the coordinates csv with spatialdata\_io.xenium\_explorer\_selection(file) and subset using polygon\_query() ). I then plot the expression of some transcripts …

---

## [Plotting the tangram imputed spatial data with spatialdata\_plot](https://discourse.scverse.org/t/plotting-the-tangram-imputed-spatial-data-with-spatialdata-plot/3942)

<div class="topic-metadata">

**Author:** [@mdka00001](https://discourse.scverse.org/u/mdka00001)\
**Replies:** 3\
**Last updated:** [March 11, 2026, 2:02pm UTC](https://discourse.scverse.org/t/plotting-the-tangram-imputed-spatial-data-with-spatialdata-plot/3942 "2026-03-11T14:02:10Z")

</div>

I am trying to plot the features of my tangram imupted spatial data by using the spatial image and cell segmentation of my reference spatial data. In general, I want to render a plot as below: However, only replacing…

---

## [Questions on Shapes + Tables vs single AnnData object](https://discourse.scverse.org/t/questions-on-shapes-tables-vs-single-anndata-object/3814)

<div class="topic-metadata">

**Author:** [@LucaMarconato](https://discourse.scverse.org/u/LucaMarconato)\
**Replies:** 6\
**Last updated:** [December 11, 2025, 10:02pm UTC](https://discourse.scverse.org/t/questions-on-shapes-tables-vs-single-anndata-object/3814 "2025-12-11T22:02:03Z")

</div>

Moving the conversation from a GitHub issue to here. Original message from asmlgkj (curry\_fan) · GitHub I have a couple of questions regarding the SpatialData outputs and how cell positions are represented in Seurat o…

---

## [Spatialdata.aggregate, image and segmentation\_mask have different shape, but aligned in 'global'](https://discourse.scverse.org/t/spatialdata-aggregate-image-and-segmentation-mask-have-different-shape-but-aligned-in-global/3650)

<div class="topic-metadata">

**Author:** [@kare9758](https://discourse.scverse.org/u/kare9758)\
**Replies:** 4\
**Last updated:** [November 21, 2025, 6:46pm UTC](https://discourse.scverse.org/t/spatialdata-aggregate-image-and-segmentation-mask-have-different-shape-but-aligned-in-global/3650 "2025-11-21T18:46:50Z")

</div>

Thanks for the great package! I have an image and a cell mask, I want to quantify the mean intensity of the signal measured in the image within each cell, using the cell mask. The image is a lot smaller, with size (3,91…

---

## [Calculate gene signature scores from cell2location-deconvolved spatial transcriptomics](https://discourse.scverse.org/t/calculate-gene-signature-scores-from-cell2location-deconvolved-spatial-transcriptomics/3836)

<div class="topic-metadata">

**Author:** [@victorsanchezarevalo](https://discourse.scverse.org/u/victorsanchezarevalo)\
**Replies:** 0\
**Last updated:** [October 22, 2025, 1:11pm UTC](https://discourse.scverse.org/t/calculate-gene-signature-scores-from-cell2location-deconvolved-spatial-transcriptomics/3836 "2025-10-22T13:11:47Z")

</div>

Hi everyone, I’m working with Visium spatial transcriptomics data and have performed deconvolution using cell2location. Now I want to calculate a gene signature score (e.g., an acidosis signature) and I’m unsure about t…

---

## [SpatialData workflow](https://discourse.scverse.org/t/spatialdata-workflow/3740)

<div class="topic-metadata">

**Author:** [@revalescente](https://discourse.scverse.org/u/revalescente)\
**Replies:** 3\
**Last updated:** [August 12, 2025, 3:27pm UTC](https://discourse.scverse.org/t/spatialdata-workflow/3740 "2025-08-12T15:27:57Z")

</div>

Hello, I’m a biostatistician working on a project with visiumHD data and I’d like to use spatialdata objects as the backbone of the segmentation process. I’m used to work with R and probably my supervisor will prefer th…

---

## [How to filter out specific cell types in spatialdata similar to anndata?](https://discourse.scverse.org/t/how-to-filter-out-specific-cell-types-in-spatialdata-similar-to-anndata/3575)

<div class="topic-metadata">

**Author:** [@christophechu](https://discourse.scverse.org/u/christophechu)\
**Replies:** 1\
**Last updated:** [August 1, 2025, 2:15pm UTC](https://discourse.scverse.org/t/how-to-filter-out-specific-cell-types-in-spatialdata-similar-to-anndata/3575 "2025-08-01T14:15:29Z")

</div>

In anndata, I can easily filter out low-quality cells using the following: adata = adata\[~adata.obs.fine\_celltype.isin(\[‘Low quality’\]), :\].copy() I would like to achieve the same thing in spatialdata, but I’m not sure…

---

## [RESOLVI - continuous\_covariate\_keys](https://discourse.scverse.org/t/resolvi-continuous-covariate-keys/3724)

<div class="topic-metadata">

**Author:** [@ndove7](https://discourse.scverse.org/u/ndove7)\
**Replies:** 0\
**Last updated:** [July 24, 2025, 7:12pm UTC](https://discourse.scverse.org/t/resolvi-continuous-covariate-keys/3724 "2025-07-24T19:12:37Z")

</div>

Hello, Are there plans to implement the ability to correct using a continuous covariate in RESOLVI like there are in other models? Or is this not possible? Thanks, Nicholas

---

## [How to plot annotation in Xenium data using spatialdata](https://discourse.scverse.org/t/how-to-plot-annotation-in-xenium-data-using-spatialdata/3468)

<div class="topic-metadata">

**Author:** [@christophechu](https://discourse.scverse.org/u/christophechu)\
**Replies:** 8\
**Last updated:** [April 10, 2025, 9:24pm UTC](https://discourse.scverse.org/t/how-to-plot-annotation-in-xenium-data-using-spatialdata/3468 "2025-04-10T21:24:39Z")

</div>

sdata.pl.render\_shapes('cell\_boundaries', color='leiden', cmap='Set3').pl.show() there is no annotation be plotted.

---

## [Really hard to plot categories palette](https://discourse.scverse.org/t/really-hard-to-plot-categories-palette/3486)

<div class="topic-metadata">

**Author:** [@christophechu](https://discourse.scverse.org/u/christophechu)\
**Replies:** 1\
**Last updated:** [February 14, 2025, 10:58pm UTC](https://discourse.scverse.org/t/really-hard-to-plot-categories-palette/3486 "2025-02-14T22:58:21Z")

</div>

As I’ve mentioned in the github. How to plot with our own palette?

---

## [Dealing with multiple samples](https://discourse.scverse.org/t/dealing-with-multiple-samples/1465)

<div class="topic-metadata">

**Author:** [@grst](https://discourse.scverse.org/u/grst)\
**Replies:** 9\
**Last updated:** [February 13, 2025, 12:49pm UTC](https://discourse.scverse.org/t/dealing-with-multiple-samples/1465 "2025-02-13T12:49:32Z")

</div>

Hi spatialdata folks, I was wondering what is the intended way to work with images from different samples (e.g. 10 tumor slides from responders and 10 non-responders) when the goal is to compare features from groups wit…

---

## [Cropping spatialdata to extent of shapes](https://discourse.scverse.org/t/cropping-spatialdata-to-extent-of-shapes/3438)

<div class="topic-metadata">

**Author:** [@grst](https://discourse.scverse.org/u/grst)\
**Replies:** 2\
**Last updated:** [January 20, 2025, 3:41pm UTC](https://discourse.scverse.org/t/cropping-spatialdata-to-extent-of-shapes/3438 "2025-01-20T15:41:04Z")

</div>

scanpy.pl.spatial has an option crop=None that automatically crops the image to the extent of the shapes: Coordinates to use for cropping the image (left, right, top, bottom). These coordinates are expected to be in pi…

---

## [Napari\_spatialdata colouring cell\_labels and plotting specific transcripts](https://discourse.scverse.org/t/napari-spatialdata-colouring-cell-labels-and-plotting-specific-transcripts/2187)

<div class="topic-metadata">

**Author:** [@lhock17](https://discourse.scverse.org/u/lhock17)\
**Replies:** 3\
**Last updated:** [December 28, 2024, 2:03pm UTC](https://discourse.scverse.org/t/napari-spatialdata-colouring-cell-labels-and-plotting-specific-transcripts/2187 "2024-12-28T14:03:19Z")

</div>

Hi there, I am wanting to create a similar plot to the one below with my Xenium sample. There are cell type labels in the Anndata.obs, but I can only plot them on the cell\_circles and not the cell\_labels. I also want to …

---

## [\`crop0(sdata).pl.render\_labels\` running too slow](https://discourse.scverse.org/t/crop0-sdata-pl-render-labels-running-too-slow/3361)

<div class="topic-metadata">

**Author:** [@zhouzhendiao](https://discourse.scverse.org/u/zhouzhendiao)\
**Replies:** 1\
**Last updated:** [November 27, 2024, 3:54pm UTC](https://discourse.scverse.org/t/crop0-sdata-pl-render-labels-running-too-slow/3361 "2024-11-27T15:54:52Z")

</div>

I am quite a newbie of spatial omics. We tried running spatialdata using Xenum 5K example data on a lab server(512Gb Mem, 120 thread CPU ,no GPU). The run time was much longer than expected, especially when plotting cro…

---

## [Xenium z-coord normalization](https://discourse.scverse.org/t/xenium-z-coord-normalization/3347)

<div class="topic-metadata">

**Author:** [@alexis](https://discourse.scverse.org/u/alexis)\
**Replies:** 1\
**Last updated:** [November 19, 2024, 5:27pm UTC](https://discourse.scverse.org/t/xenium-z-coord-normalization/3347 "2024-11-19T17:27:18Z")

</div>

Hello everyone, I am working on image-based spatial transcriptomics data Xenium and Merfish. I noticed on several samples of the Xenium data that the transcripts expression coordinate on the x and y axis seems to be shi…

---

## [How to extract transformed polygons from sdata.shapes?](https://discourse.scverse.org/t/how-to-extract-transformed-polygons-from-sdata-shapes/2458)

<div class="topic-metadata">

**Author:** [@liz-is](https://discourse.scverse.org/u/liz-is)\
**Replies:** 3\
**Last updated:** [September 2, 2024, 9:44am UTC](https://discourse.scverse.org/t/how-to-extract-transformed-polygons-from-sdata-shapes/2458 "2024-09-02T09:44:26Z")

</div>

I have some segmentations (of structures larger than cells) that were performed on an H&E image, that I have imported, added to my spatialdata object containing my Xenium data, and then applied the appropriate XeniumExpl…

---

## [Read failure with aligned example data; fails on "shapes"](https://discourse.scverse.org/t/read-failure-with-aligned-example-data-fails-on-shapes/2437)

<div class="topic-metadata">

**Author:** [@stvjc](https://discourse.scverse.org/u/stvjc)\
**Replies:** 2\
**Last updated:** [August 7, 2024, 1:12pm UTC](https://discourse.scverse.org/t/read-failure-with-aligned-example-data-fails-on-shapes/2437 "2024-08-07T13:12:19Z")

</div>

wget https://s3.embl.de/spatialdata/spatialdata-sandbox/xenium\_rep1\_io\_aligned.zip unzip to find folder data\_aligned.zarr \>\>\> sdata = sd.read\_zarr("data\_aligned.zarr") Traceback (most recent call last): File "\<stdin\>"…

---

## [\[moved\] How to align image to cropped data, visualize with Xenium Explorer](https://discourse.scverse.org/t/moved-how-to-align-image-to-cropped-data-visualize-with-xenium-explorer/2368)

<div class="topic-metadata">

**Author:** [@LucaMarconato](https://discourse.scverse.org/u/LucaMarconato)\
**Replies:** 1\
**Last updated:** [July 2, 2024, 11:35pm UTC](https://discourse.scverse.org/t/moved-how-to-align-image-to-cropped-data-visualize-with-xenium-explorer/2368 "2024-07-02T23:35:06Z")

</div>

Moved from GitHub Coordinates from Xenium Explorer not matching the original data · Issue #167 · scverse/spatialdata-io · GitHub, originally asked from Yifan-debug (yifan wang) · GitHub. Original question: in my case, I…

---

## [Spatial resolution artifacts outside of detected tissue](https://discourse.scverse.org/t/spatial-resolution-artifacts-outside-of-detected-tissue/2335)

<div class="topic-metadata">

**Author:** [@CSMattison](https://discourse.scverse.org/u/CSMattison)\
**Replies:** 8\
**Last updated:** [June 24, 2024, 7:50pm UTC](https://discourse.scverse.org/t/spatial-resolution-artifacts-outside-of-detected-tissue/2335 "2024-06-24T19:50:49Z")

</div>

Hi, I’m trying to plot module scores from a gene list over our tissue images and even though sc.pl.spatial is used with clusters gene counts as the color and nothing is outside of the tissue, it keeps happening when usin…

---

## [Spatialdata wrong shapes translation](https://discourse.scverse.org/t/spatialdata-wrong-shapes-translation/2276)

<div class="topic-metadata">

**Author:** [@alexis](https://discourse.scverse.org/u/alexis)\
**Replies:** 8\
**Last updated:** [June 21, 2024, 8:40am UTC](https://discourse.scverse.org/t/spatialdata-wrong-shapes-translation/2276 "2024-06-21T08:40:32Z")

</div>

I have a xenium image, which is the concatenation of 4 different samples. To get samples, I use bounding\_box\_query(). For instance, I get the sample number 3 like that: crop\_sample\_3 = lambda x: bounding\_box\_query( …

---

## [Add & plot cell type annotation to spatialdata](https://discourse.scverse.org/t/add-plot-cell-type-annotation-to-spatialdata/2292)

<div class="topic-metadata">

**Author:** [@max](https://discourse.scverse.org/u/max)\
**Replies:** 3\
**Last updated:** [May 29, 2024, 11:55am UTC](https://discourse.scverse.org/t/add-plot-cell-type-annotation-to-spatialdata/2292 "2024-05-29T11:55:26Z")

</div>

Hello, I have a xenium spatialdata object. I have a dataframe with cell types annotation (a column with a cell id, and a column with a cell type). The cell id in my dataframe is the same than the cell id in my shapes. …

---

## [Remove coordinate system from Spatialdata](https://discourse.scverse.org/t/remove-coordinate-system-from-spatialdata/2204)

<div class="topic-metadata">

**Author:** [@grst](https://discourse.scverse.org/u/grst)\
**Replies:** 1\
**Last updated:** [April 9, 2024, 1:11pm UTC](https://discourse.scverse.org/t/remove-coordinate-system-from-spatialdata/2204 "2024-04-09T13:11:13Z")

</div>

How can I remove a coordinate system from a SpatialData object? I have a Visium SpatialData object that looks like this: SpatialData object with: ├── Images │ └── 'SAMP427\_16\_hires': SpatialImage\[cyx\] (3, 2000, 200…

---

## [View xenium images in napari](https://discourse.scverse.org/t/view-xenium-images-in-napari/2119)

<div class="topic-metadata">

**Author:** [@dylanmr](https://discourse.scverse.org/u/dylanmr)\
**Replies:** 5\
**Last updated:** [February 25, 2024, 6:09pm UTC](https://discourse.scverse.org/t/view-xenium-images-in-napari/2119 "2024-02-25T18:09:30Z")

</div>

I used the spatialdata\_io xenium function to load in my xenium data, which appears to work exactly as described. However, when I try to view my xenium image using: Interactive(\[adata\]) The napari viewer is empty. I am …

---

## [Using my own datasets with spatialData](https://discourse.scverse.org/t/using-my-own-datasets-with-spatialdata/2058)

<div class="topic-metadata">

**Author:** [@rmiller](https://discourse.scverse.org/u/rmiller)\
**Replies:** 9\
**Last updated:** [February 8, 2024, 10:01pm UTC](https://discourse.scverse.org/t/using-my-own-datasets-with-spatialdata/2058 "2024-02-08T22:01:35Z")

</div>

I have followed along with the tutorials at spatialdata tutorial to load a visium dataset and a xenium dataset and align the images by landmarks. Now I want to try an alignment with my own visium slides. Is there a resou…

---

## [Importing cellcharter](https://discourse.scverse.org/t/importing-cellcharter/2013)

<div class="topic-metadata">

**Author:** [@SBDixit](https://discourse.scverse.org/u/SBDixit)\
**Replies:** 1\
**Last updated:** [January 22, 2024, 2:25pm UTC](https://discourse.scverse.org/t/importing-cellcharter/2013 "2024-01-22T14:25:25Z")

</div>

Hi, I am trying to import cellcharter to perform clustering on MERSCOPE data and I run into errors during the import: I am using spatialdata==0.0.12 and the below commands for other dependencies conda create -n cel…

[Next page](https://discourse.scverse.org/c/help/spatialdata/44.md?page=1)
