Skip to content

Commit ea0441c

Browse files
Merge pull request #215 from scverse/fix/no_transformations_visium_hd
Visium hd: get transformation matrices only if images are parsed
2 parents 6d20d76 + 17119c0 commit ea0441c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/spatialdata_io/readers/visium_hd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def load_image(path: Path, suffix: str, scale_factors: list[int] | None = None)
107107
)
108108

109109
metadata, hd_layout = _parse_metadata(path, filename_prefix)
110-
transform_matrices = _get_transform_matrices(metadata, hd_layout)
111110
file_format = hd_layout[VisiumHDKeys.FILE_FORMAT]
112111
if file_format != "1.0":
113112
warnings.warn(
@@ -347,6 +346,7 @@ def _get_bins(path: Path) -> list[str]:
347346
suffix="_cytassist_image",
348347
)
349348
image = images[dataset_id + "_cytassist_image"]
349+
transform_matrices = _get_transform_matrices(metadata, hd_layout)
350350
affine0 = transform_matrices["cytassist_colrow_to_spot_colrow"]
351351
affine1 = transform_matrices["spot_colrow_to_microscope_colrow"]
352352
set_transformation(image, Sequence([affine0, affine1]), "global")

0 commit comments

Comments
 (0)