|
86 | 86 | "│ └── 'transcripts': DataFrame with shape: (<Delayed>, 8) (3D points)\n", |
87 | 87 | "├── Shapes\n", |
88 | 88 | "│ ├── 'cell_boundaries': GeoDataFrame shape: (167780, 1) (2D shapes)\n", |
89 | | - "│ ├── 'cell_circles': GeoDataFrame shape: (167780, 2) (2D shapes)\n", |
90 | | - "│ └── 'xenium_landmarks': GeoDataFrame shape: (3, 2) (2D shapes)\n", |
| 89 | + "│ └── 'cell_circles': GeoDataFrame shape: (167780, 2) (2D shapes)\n", |
91 | 90 | "└── Tables\n", |
92 | 91 | " └── 'table': AnnData (167780, 313)\n", |
93 | 92 | "with coordinate systems:\n", |
94 | | - " ▸ 'aligned', with elements:\n", |
95 | | - " morphology_focus (Images)\n", |
96 | 93 | " ▸ 'global', with elements:\n", |
97 | | - " morphology_focus (Images), morphology_mip (Images), transcripts (Points), cell_boundaries (Shapes), cell_circles (Shapes), xenium_landmarks (Shapes)" |
| 94 | + " morphology_focus (Images), morphology_mip (Images), transcripts (Points), cell_boundaries (Shapes), cell_circles (Shapes)" |
98 | 95 | ] |
99 | 96 | }, |
100 | 97 | "execution_count": 2, |
|
142 | 139 | "│ ├── 'CytAssist_FFPE_Human_Breast_Cancer_hires_image': DataArray[cyx] (3, 2000, 1809)\n", |
143 | 140 | "│ └── 'CytAssist_FFPE_Human_Breast_Cancer_lowres_image': DataArray[cyx] (3, 600, 543)\n", |
144 | 141 | "├── Shapes\n", |
145 | | - "│ ├── 'CytAssist_FFPE_Human_Breast_Cancer': GeoDataFrame shape: (4992, 2) (2D shapes)\n", |
146 | | - "│ └── 'visium_landmarks': GeoDataFrame shape: (3, 2) (2D shapes)\n", |
| 142 | + "│ └── 'CytAssist_FFPE_Human_Breast_Cancer': GeoDataFrame shape: (4992, 2) (2D shapes)\n", |
147 | 143 | "└── Tables\n", |
148 | 144 | " └── 'table': AnnData (4992, 18085)\n", |
149 | 145 | "with coordinate systems:\n", |
150 | | - " ▸ 'aligned', with elements:\n", |
151 | | - " CytAssist_FFPE_Human_Breast_Cancer_full_image (Images), CytAssist_FFPE_Human_Breast_Cancer_hires_image (Images), CytAssist_FFPE_Human_Breast_Cancer_lowres_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes), visium_landmarks (Shapes)\n", |
152 | | - " ▸ 'downscaled_hires', with elements:\n", |
| 146 | + " ▸ 'CytAssist_FFPE_Human_Breast_Cancer', with elements:\n", |
| 147 | + " CytAssist_FFPE_Human_Breast_Cancer_full_image (Images), CytAssist_FFPE_Human_Breast_Cancer_hires_image (Images), CytAssist_FFPE_Human_Breast_Cancer_lowres_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes)\n", |
| 148 | + " ▸ 'CytAssist_FFPE_Human_Breast_Cancer_downscaled_hires', with elements:\n", |
153 | 149 | " CytAssist_FFPE_Human_Breast_Cancer_hires_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes)\n", |
154 | | - " ▸ 'downscaled_lowres', with elements:\n", |
155 | | - " CytAssist_FFPE_Human_Breast_Cancer_lowres_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes)\n", |
156 | | - " ▸ 'global', with elements:\n", |
157 | | - " CytAssist_FFPE_Human_Breast_Cancer_full_image (Images), CytAssist_FFPE_Human_Breast_Cancer_hires_image (Images), CytAssist_FFPE_Human_Breast_Cancer_lowres_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes), visium_landmarks (Shapes)" |
| 150 | + " ▸ 'CytAssist_FFPE_Human_Breast_Cancer_downscaled_lowres', with elements:\n", |
| 151 | + " CytAssist_FFPE_Human_Breast_Cancer_lowres_image (Images), CytAssist_FFPE_Human_Breast_Cancer (Shapes)" |
158 | 152 | ] |
159 | 153 | }, |
160 | 154 | "execution_count": 3, |
|
282 | 276 | "outputs": [], |
283 | 277 | "source": [ |
284 | 278 | "from spatialdata.models import ShapesModel\n", |
| 279 | + "from spatialdata.transformations import Identity\n", |
285 | 280 | "\n", |
286 | 281 | "visium_landmarks = ShapesModel.parse(\n", |
287 | | - " np.array([[10556.699, 7829.764], [13959.155, 13522.025], [10621.200, 17392.116]]), geometry=0, radius=500\n", |
| 282 | + " np.array([[10556.699, 7829.764], [13959.155, 13522.025], [10621.200, 17392.116]]), geometry=0, radius=500, transformations={'CytAssist_FFPE_Human_Breast_Cancer': Identity()}\n", |
288 | 283 | ")\n", |
289 | 284 | "visium_sdata[\"visium_landmarks\"] = visium_landmarks\n", |
290 | 285 | "\n", |
| 286 | + "# for Xenium data, the data is aligned to the 'global' coordinate system as with can see with print(xenium_sdata), so there is no need to specify transformations in .parse()\n", |
291 | 287 | "xenium_landmarks = ShapesModel.parse(\n", |
292 | 288 | " np.array([[9438.385, 13933.017], [24847.866, 5948.002], [34082.584, 15234.235]]), geometry=0, radius=500\n", |
293 | 289 | ")\n", |
|
389 | 385 | " reference_element=xenium_sdata[\"morphology_focus\"],\n", |
390 | 386 | " moving_element=visium_sdata[\"CytAssist_FFPE_Human_Breast_Cancer_full_image\"],\n", |
391 | 387 | " reference_coordinate_system=\"global\",\n", |
392 | | - " moving_coordinate_system=\"global\",\n", |
| 388 | + " moving_coordinate_system=\"CytAssist_FFPE_Human_Breast_Cancer\",\n", |
393 | 389 | " new_coordinate_system=\"aligned\",\n", |
394 | 390 | ")\n", |
395 | 391 | "affine" |
|
571 | 567 | "name": "python", |
572 | 568 | "nbconvert_exporter": "python", |
573 | 569 | "pygments_lexer": "ipython3", |
574 | | - "version": "3.11.0" |
| 570 | + "version": "3.10.0" |
575 | 571 | }, |
576 | 572 | "vscode": { |
577 | 573 | "interpreter": { |
|
0 commit comments