|
9 | 9 | "\n", |
10 | 10 | "This tutorial walks through the core mental model of [`spatialdata-plot`](https://github.com/scverse/spatialdata-plot): a fluent API on top of a `SpatialData` object that lets you layer the four spatial element types (images, labels, shapes, points) into a single matplotlib figure.\n", |
11 | 11 | "\n", |
12 | | - "We use the lightweight built-in `blobs` dataset so this notebook runs in seconds with zero downloads. Once the API clicks, the same calls work on Visium, Xenium, MERFISH, or any other dataset that can be loaded as a `SpatialData` object — see the other tutorials in this gallery for real-world examples." |
| 12 | + "We use the lightweight built-in `blobs` dataset so this notebook runs in seconds with zero downloads. Once the API clicks, the same calls work on Visium, Xenium, MERFISH, or any other dataset that can be loaded as a `SpatialData` object \u2014 see the other tutorials in this gallery for real-world examples." |
13 | 13 | ] |
14 | 14 | }, |
15 | 15 | { |
|
19 | 19 | "source": [ |
20 | 20 | "## The data\n", |
21 | 21 | "\n", |
22 | | - "`sd.datasets.blobs()` returns a `SpatialData` object containing one image, one label mask, one points layer, and several shape layers — all aligned in the `global` coordinate system." |
| 22 | + "`sd.datasets.blobs()` returns a `SpatialData` object containing one image, one label mask, one points layer, and several shape layers \u2014 all aligned in the `global` coordinate system." |
23 | 23 | ] |
24 | 24 | }, |
25 | 25 | { |
|
39 | 39 | "data": { |
40 | 40 | "text/plain": [ |
41 | 41 | "SpatialData object\n", |
42 | | - "├── Images\n", |
43 | | - "│ ├── 'blobs_image': DataArray[cyx] (3, 512, 512)\n", |
44 | | - "│ └── 'blobs_multiscale_image': DataTree[cyx] (3, 512, 512), (3, 256, 256), (3, 128, 128)\n", |
45 | | - "├── Labels\n", |
46 | | - "│ ├── 'blobs_labels': DataArray[yx] (512, 512)\n", |
47 | | - "│ └── 'blobs_multiscale_labels': DataTree[yx] (512, 512), (256, 256), (128, 128)\n", |
48 | | - "├── Points\n", |
49 | | - "│ └── 'blobs_points': DataFrame with shape: (<Delayed>, 4) (2D points)\n", |
50 | | - "├── Shapes\n", |
51 | | - "│ ├── 'blobs_circles': GeoDataFrame shape: (5, 2) (2D shapes)\n", |
52 | | - "│ ├── 'blobs_multipolygons': GeoDataFrame shape: (2, 1) (2D shapes)\n", |
53 | | - "│ └── 'blobs_polygons': GeoDataFrame shape: (5, 1) (2D shapes)\n", |
54 | | - "└── Tables\n", |
55 | | - " └── 'table': AnnData (26, 3)\n", |
| 42 | + "\u251c\u2500\u2500 Images\n", |
| 43 | + "\u2502 \u251c\u2500\u2500 'blobs_image': DataArray[cyx] (3, 512, 512)\n", |
| 44 | + "\u2502 \u2514\u2500\u2500 'blobs_multiscale_image': DataTree[cyx] (3, 512, 512), (3, 256, 256), (3, 128, 128)\n", |
| 45 | + "\u251c\u2500\u2500 Labels\n", |
| 46 | + "\u2502 \u251c\u2500\u2500 'blobs_labels': DataArray[yx] (512, 512)\n", |
| 47 | + "\u2502 \u2514\u2500\u2500 'blobs_multiscale_labels': DataTree[yx] (512, 512), (256, 256), (128, 128)\n", |
| 48 | + "\u251c\u2500\u2500 Points\n", |
| 49 | + "\u2502 \u2514\u2500\u2500 'blobs_points': DataFrame with shape: (<Delayed>, 4) (2D points)\n", |
| 50 | + "\u251c\u2500\u2500 Shapes\n", |
| 51 | + "\u2502 \u251c\u2500\u2500 'blobs_circles': GeoDataFrame shape: (5, 2) (2D shapes)\n", |
| 52 | + "\u2502 \u251c\u2500\u2500 'blobs_multipolygons': GeoDataFrame shape: (2, 1) (2D shapes)\n", |
| 53 | + "\u2502 \u2514\u2500\u2500 'blobs_polygons': GeoDataFrame shape: (5, 1) (2D shapes)\n", |
| 54 | + "\u2514\u2500\u2500 Tables\n", |
| 55 | + " \u2514\u2500\u2500 'table': AnnData (26, 3)\n", |
56 | 56 | "with coordinate systems:\n", |
57 | | - " ▸ 'global', with elements:\n", |
| 57 | + " \u25b8 'global', with elements:\n", |
58 | 58 | " blobs_image (Images), blobs_multiscale_image (Images), blobs_labels (Labels), blobs_multiscale_labels (Labels), blobs_points (Points), blobs_circles (Shapes), blobs_multipolygons (Shapes), blobs_polygons (Shapes)" |
59 | 59 | ] |
60 | 60 | }, |
|
65 | 65 | ], |
66 | 66 | "source": [ |
67 | 67 | "import spatialdata as sd\n", |
68 | | - "\n", |
69 | 68 | "import spatialdata_plot # noqa: F401 (registers the .pl accessor)\n", |
70 | 69 | "\n", |
71 | 70 | "sdata = sd.datasets.blobs()\n", |
|
131 | 130 | "source": [ |
132 | 131 | "### Render labels\n", |
133 | 132 | "\n", |
134 | | - "By default, labels are filled. Use `contour_px` to draw boundaries instead — useful for overlaying segmentations on top of an image without hiding pixel-level detail." |
| 133 | + "By default, labels are filled. Use `contour_px` to draw boundaries instead \u2014 useful for overlaying segmentations on top of an image without hiding pixel-level detail." |
135 | 134 | ] |
136 | 135 | }, |
137 | 136 | { |
|
341 | 340 | "source": [ |
342 | 341 | "## Where to next\n", |
343 | 342 | "\n", |
344 | | - "- **API reference** — every parameter for every `render_*` is documented in the [plotting API](https://spatialdata.scverse.org/projects/plot/en/latest/api.html).\n", |
345 | | - "- **Real-data tutorials** — see the other notebooks in this gallery for Visium, Xenium, and MERFISH examples that combine these primitives into complete analyses.\n", |
346 | | - "- **Contributing** — found a missing example? Open a PR on [`spatialdata-plot-notebooks`](https://github.com/scverse/spatialdata-plot-notebooks)." |
| 343 | + "- **API reference** \u2014 every parameter for every `render_*` is documented in the [plotting API](https://spatialdata.scverse.org/projects/plot/en/latest/api.html).\n", |
| 344 | + "- **Real-data tutorials** \u2014 see the other notebooks in this gallery for Visium, Xenium, and MERFISH examples that combine these primitives into complete analyses.\n", |
| 345 | + "- **Contributing** \u2014 found a missing example? Open a PR on [`spatialdata-plot-notebooks`](https://github.com/scverse/spatialdata-plot-notebooks)." |
347 | 346 | ] |
348 | 347 | } |
349 | 348 | ], |
|
0 commit comments