Remote ARC/ BioInfo Repo Pulls/ STalign GitHub ↗ Paper (Nat. Commun. 2023) ↗

STalign

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.)

Vendored b2068edc98974efa54537eca194736e177bbe11d (main, pulled 2026-07-23) CPU torch installed & runnable
Run it → Browse the code →

How it works here

1. Prescale

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.

2. Rasterize

Both point clouds are turned into density images (STalign.rasterize) at a shared pixel size — effectively each capture's spot-footprint/tissue outline.

3. Register

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).

Note: registration quality depends on how well the two captures' tissue footprints actually correspond, and on iteration count. Before/after scatter overlays and LDDMM's own diagnostic figures are shown after each run so you can judge convergence yourself.

Bundled fixtures

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.

6-15-26_Control__C1B_to_C1T
1258 source pts · 1271 target pts