@@ -242,9 +242,9 @@ def _get_bins(path_bins: Path) -> list[str]:
242
242
shapes_name = dataset_id + "_" + bin_size_str
243
243
radius = scalefactors [VisiumHDKeys .SCALEFACTORS_SPOT_DIAMETER_FULLRES ] / 2.0
244
244
transformations = {
245
- "global" : transform_original ,
246
- "downscaled_hires " : transform_hires ,
247
- "downscaled_lowres " : transform_lowres ,
245
+ dataset_id : transform_original ,
246
+ f" { dataset_id } _downscaled_hires " : transform_hires ,
247
+ f" { dataset_id } _downscaled_lowres " : transform_lowres ,
248
248
}
249
249
circles = ShapesModel .parse (
250
250
adata .obsm ["spatial" ],
@@ -322,7 +322,10 @@ def _get_bins(path_bins: Path) -> list[str]:
322
322
)
323
323
set_transformation (
324
324
images [dataset_id + "_hires_image" ],
325
- {"downscaled_hires" : Identity (), "global" : transform_hires .inverse ()},
325
+ {
326
+ f"{ dataset_id } _downscaled_hires" : Identity (),
327
+ dataset_id : transform_hires .inverse (),
328
+ },
326
329
set_all = True ,
327
330
)
328
331
@@ -340,7 +343,10 @@ def _get_bins(path_bins: Path) -> list[str]:
340
343
)
341
344
set_transformation (
342
345
images [dataset_id + "_lowres_image" ],
343
- {"downscaled_lowres" : Identity (), "global" : transform_lowres .inverse ()},
346
+ {
347
+ f"{ dataset_id } _downscaled_lowres" : Identity (),
348
+ dataset_id : transform_lowres .inverse (),
349
+ },
344
350
set_all = True ,
345
351
)
346
352
@@ -365,7 +371,7 @@ def _get_bins(path_bins: Path) -> list[str]:
365
371
projective /= projective [2 , 2 ]
366
372
if _projective_matrix_is_affine (projective ):
367
373
affine = Affine (projective , input_axes = ("x" , "y" ), output_axes = ("x" , "y" ))
368
- set_transformation (image , affine , "global" )
374
+ set_transformation (image , affine , dataset_id )
369
375
else :
370
376
# the projective matrix is not affine, we will separate the affine part and the projective shift, and apply
371
377
# the projective shift to the image
@@ -413,7 +419,6 @@ def _get_bins(path_bins: Path) -> list[str]:
413
419
414
420
if annotate_table_by_labels :
415
421
for bin_size_str in bin_sizes :
416
-
417
422
shapes_name = dataset_id + "_" + bin_size_str
418
423
419
424
# add labels layer (rasterized bins).
0 commit comments