Skip to content

Commit

Permalink
Merge pull request #215 from scverse/fix/no_transformations_visium_hd
Browse files Browse the repository at this point in the history
Visium hd: get transformation matrices only if images are parsed
  • Loading branch information
LucaMarconato authored Oct 30, 2024
2 parents 6d20d76 + 17119c0 commit ea0441c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spatialdata_io/readers/visium_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit ea0441c

Please sign in to comment.