Diffeomorphic metric mapping (LDDMM) for aligning spatial transcriptomics data — Clifton, Anant, Aihara et al., Nature Communications 2023. Given two point clouds (a "source" to warp and a "target" to match), STalign jointly fits a coarse affine transform and a smooth, invertible non-rigid deformation that maps one onto the other. Here it registers two independent 10x Visium captures of the same experiment onto each other — the tool's actual intended input. (An earlier version of this demo instead paired a 3Brain MEA electrode grid against a Visium capture; that ran, but MEA↔Visium alignment is a different problem — solved separately by the Kairns tool's own tissue-mask method — not what STalign's diffeomorphic ST-to-ST matching was built or validated for.)
Even two Visium captures of the same experiment aren't guaranteed to land on identical pixel-coordinate ranges. The source is recentered and isotropically rescaled onto the target's coordinate frame before anything else runs, so STalign's tuned default step sizes and velocity-field smoothness apply as intended regardless.
Both point clouds are turned into density images (STalign.rasterize) at a shared pixel
size — effectively each capture's spot-footprint/tissue outline.
A centroid+scale affine initial guess is refined jointly with a diffeomorphic velocity field via
LDDMM gradient descent (STalign.LDDMM), then applied to the raw source points
(transform_points_source_to_target).
Pairs of independent Visium captures of the same experiment, prepared from Kairns' cached data (data/kairns_visium_captures/prepare_fixtures.py). Only cohorts with two captures qualify — a single capture has nothing genuinely ST-to-ST to register against.