Fig. 2: Demonstration of MAGPIE flexibility and robustness.

a Summary of the MAGPIE pipeline key decision points for user consideration. b Variation in the alignment accuracy across a range of landmarks, employing a linear (affine) or non-linear (TPS) transform, with or without using an intermediate MSI H&E image to assist with co-registration, for 8 mouse lung samples. For each setting, the mean alignment accuracy per sample was selected across 5 iterations of randomly selected landmarks followed by averaging the scores across all samples, shown as points in the graph. Error bars correspond to the standard error centred on the mean alignment accuracy across all samples. Points are coloured by the inclusion of an intermediate H&E image for the MSI modality. N samples = 8. c Maximum accuracy for each sample using either affine or TPS transform, with or without the aid of an intermediate MSI H&E image (reflected in colour). d Comparison of highest accuracy performance per sample using affine or TPS transforms, with or without an intermediate H&E microscopy image. Each point represents the maximum achieved accuracy for each tested sample (n = 8) with the boxplot showing the median, upper and lower quartiles with whiskers extending to 1.5× interquartile range. The maximum alignment accuracies per group were compared using paired two-sided Wilcoxon rank sum tests (Affine with H&E vs Affine without H&E: p = 1.12×10-4, TPS with H&E vs TPS without H&E: p = 1.77 × 10-13, Affine with H&E vs TPS with H&E: p = 0.198 (n.s. non-significant), Affine without H&E vs TPS without H&E: p = 1.69 × 10-13). Boxes are coloured by the inclusion of an intermediate H&E image for the MSI modality. e Examples of H&E-stained tissue sections of mouse lung section pairs, ordered by maximum accuracy measurement between Visium and MSI sections. Full results across 9 tested samples with Visium and MSI H&E images are shown in Supplementary Fig. 1c. Scale bars reflect 500 μm. f Generalisability of MAGPIE to other species and tissue types by application to same-section Visium and MALDI-MSI data (SMA) from mouse and human brain tissue. The maximum co-registration accuracies achieved per sample (mouse, n = 3; human, n = 3) are shown as bar charts, alongside example Visium H&E images, MSI dimensionality reduction colouring (using first 3 principle components as RGB channels) and overlaid Visium and MSI coordinates. Scale bars reflect 500 μm. Source data are provided as a Source Data file.