diff --git a/src/spatialdata_io/readers/visium_hd.py b/src/spatialdata_io/readers/visium_hd.py index a19262e..aa443a3 100644 --- a/src/spatialdata_io/readers/visium_hd.py +++ b/src/spatialdata_io/readers/visium_hd.py @@ -107,7 +107,6 @@ def load_image(path: Path, suffix: str, scale_factors: list[int] | None = None) ) metadata, hd_layout = _parse_metadata(path, filename_prefix) - transform_matrices = _get_transform_matrices(metadata, hd_layout) file_format = hd_layout[VisiumHDKeys.FILE_FORMAT] if file_format != "1.0": warnings.warn( @@ -347,6 +346,7 @@ def _get_bins(path: Path) -> list[str]: suffix="_cytassist_image", ) image = images[dataset_id + "_cytassist_image"] + transform_matrices = _get_transform_matrices(metadata, hd_layout) affine0 = transform_matrices["cytassist_colrow_to_spot_colrow"] affine1 = transform_matrices["spot_colrow_to_microscope_colrow"] set_transformation(image, Sequence([affine0, affine1]), "global")