constant spatial density of 1, as we use for modeling both atlas and target image varifolds in this case. Finally, in other settings without prior knowledge or wish to impose any on the specific densities prescribed to each indexed location, we can add a general regularization term to (10), such as the Kullback–Liebler divergence between the normalized estimated $\pi$ probability distribution and a uniform distribution across target features:

$$d_l \approx \sum_{f \in \mathcal{F}} \bar{\pi}_l(f) \log \left( \frac{\bar{\pi}_l(f)}{(1/|\mathcal{F}|)} \right), \quad l \in \mathcal{L} \qquad (12)$$

where $|\mathcal{F}|$ gives the number of discrete feature values in the target feature space and the probability distribution, $\bar{\pi}_l = \frac{1}{\sum_{f \in \mathcal{F}} \pi_l(f)} \pi_l$. We use this approach in the examples with BARseq data shown and in the context of a simultaneous rather than alternating optimization algorithm.

## Alternating LDDMM and quadratic program algorithm for joint optimization

For solving the variational problem of (10), optimal $\varphi, \pi$ are jointly estimated through either a single or alternating optimization scheme. In both cases, the template and target can be initially aligned through separate estimation of rigid transformations (translation and rotation) and a single isotropic scaling applied to the template to bring the total area of the template to equal that of the target. In this setting, rigid transformations are estimated by minimizing the varifold normed difference between the rotated and translated template atlas transformed to the target with L-BFGS.

Additionally, in both cases, a gradient-based optimization is performed until convergence or a specified number of iterations. We use L-BFGS optimization combined with a line search using the Wolf condition. In the single scheme, geometric parameters, $v_t$, and feature parameters, $\pi$ are optimized as a joint set of parameters in the gradient-based optimization. In contrast, an alternating scheme separates the estimation of geometric parameters and feature parameters with a gradient-based optimization for the former and the use of quadratic programming in the latter case.

The alternating scheme specifically follows$^{35}$, fixing the laws $(\pi_l)_{l \in \mathcal{L}}$ and optimizing over the control $v(t), t \in [0, 1]$ and integrating it, with the initial condition at the identity element, $\varphi_0 = \text{Id}$ (e.g. $\varphi_0(x) = x, \forall x \in \mathbb{R}^2$), to generate the diffeomorphism $\varphi_1$. The diffeomorphism is then fixed and quadratic programming, such as OSQP$^{63}$, used to estimate the feature laws. We outline this scheme explicitly below.

### Algorithm 1.

Initialize: $\pi_l(f) = \frac{1}{|\mathcal{F}|} f \in \mathcal{F}$

**A: Solve for $v$:**

1. Update and fix $(\pi_l)_{l \in \mathcal{L}}$.

2. Solve LDDMM, optimizing (10) with respect to vector field $v_t, t \in [0, 1]$.

3. Solve for $\varphi_1$, integrating O.D.E $\varphi_1 = \int_0^1 v_t \circ \varphi_t dt + \text{Id}$.

4. Flow $\mu_A^\pi$ according to $\varphi_1$, giving $\varphi_1 \cdot \mu_A^\pi$.

**B: Solve for $(\pi_l)_{l \in \mathcal{L}}$:**

1. Fix spatial positions in the deformed template, $\varphi(\mathbf{x}_i), i \in \mathcal{I}$.

2. Optimize quadratic program (13) with respect to $(\pi_l)_{l \in \mathcal{L}}$.

**Return to A**

For the atlas, we define the form of the image varifold: $\mu_A = \sum_{i \in \mathcal{I}} \delta_{x_i} \otimes w_i p_i$, with, $w_i p_i \in \mathcal{M}(\mathcal{L})$, a measure over the atlas feature values (partitions). The estimated feature distributions are given via $\pi$ as the mixture distribution, $w_i p_i = \sum_{l \in \mathcal{L}} w_l p_l(\ell) \pi_l$. We specify the target over the index set, $J$, as: $\mu_T = \sum_{j \in \mathcal{J}} \delta_{x_j} \otimes w_j p_j$ with each $w_j p_j$ and estimated $w'_i p'_i \in \mathcal{M}(\mathcal{F})$. We use this notation in defining the general

form of the quadratic program, with constraint given as described in "Variational problems" section:

$$ \begin{aligned} & \inf_{\pi_l, l \in \mathcal{L}} \| \varphi_1 \cdot \mu_A^\pi - \mu_T \|_{\mathcal{W}}^2 \\ = & \inf_{\pi_l, l \in \mathcal{L}} \sum_{i, l, \ell \in \mathcal{L}^2} |D\varphi_1|_{x_i} |D\varphi_1|_{x_l} K_1(\varphi(x_i), \varphi(x_l)) \sum_{f \in \mathcal{F}} w'_i p'_i(f) w'_i p'_i(f) \\ & - 2 \sum_{i \in \mathcal{I} \atop j \in \mathcal{J}} |D\varphi_1|_{x_i} K_1(\varphi(x_i), x_j) \sum_{f \in \mathcal{F}} w_j p_j(f) w'_i p'_i(f) \\ & \text{subject to } w^{\min} \le w'_i \le w^{\max}, i \in \mathcal{I}. \end{aligned} \qquad (13) $$

**Remark 1.** In the algorithm, under the assumption of a constant density with $w_i = 1$ for all $i \in \mathcal{I}$, we can approximate the estimated distributions, $w'_i p'_i, i \in \mathcal{I}$, by the single $\pi_l$ at each location (e.g. particle or simplex) for the $l$ with the largest mass. Defining the greedy maximizer map $\ell^*(i) = \arg \max_{l \in \mathcal{L}} p_l(\ell) \in \mathcal{L}$, we can simplify the computations by using the approximation $w'_i p'_i \simeq p_i(\ell^*(i)) \pi_{\ell^*(i)}$. This is particularly relevant for tissue-scale atlases where most particles or simplices in the image-varifold object are interior to a single atlas region and therefore carry a conditional feature distribution, $p_i = \delta_{\ell_i}$, with all mass attributed to a single feature value, $\ell_i$. For these indexed locations, the above approximation becomes an equality: $w'_i p'_i = \pi_{\ell^*(i)} = \pi_{\ell_i}$.

Both single and alternating optimization schemes were utilized in the examples shown in this work and are available with respective Python git repositories: https://github.com/kstouff4/xIV-LDDMM-Particle v1.0.0$^{64}$ and https://github.com/kstouff4/MeshLDDMMQP v1.0.0$^{65}$. The single optimization scheme is provided in the context of point cloud image-varifold implementations, whereas the alternating scheme is provided in the context of mesh-based image-varifold implementations. The quadratic program solver used in the context of the alternating scheme is OSQP as implemented in the Python qpsolvers library. Both schemes were developed and tested on a 12 GB TITAN V GPU with CUDA 10.2 and NVIDIA-SMI and Driver 440.33.01, with expected runtime varying by the size of the dataset, but on the order of 2–4 h for most examples highlighted in this work.

## Empirical distribution estimation and cross-replicate statistical comparison

For empirical atlas construction from single or multiple MERFISH sections ("Cross-replicate comparison and atlas construction" section), we used a 50 µm particle rendering (-20k particles) of the CCFv3 section as a scaffold. We assigned each mapped MERFISH cell to its nearest neighbor in the CCFv3 section, giving a distribution over cell types per particle in the CCFv3 section. As described in "Cross-replicate comparison and atlas construction" section, we computed variance in probability distribution within a region by modeling the probability distributions per particle, $p_i$, as vectors in $\mathbb{R}^C$, with the number of cell (sub)types $C = 33$, and $|p_i| = 1$. We computed mean cell type probability distributions per CCFv3 region, denoted $\bar{p}_i$ for $\ell \in \mathcal{L}$ by selecting the subset of particles, $I_\ell \subset \mathcal{I}$, for each region with at least half of their mass in that region. Under our model of spatial homogeneity per atlas region, we assume the conditional cell type probabilities per location (particle) within each atlas region are consistent. For a given cell (sub)type, c, and replicate, k, we computed spatial variance within a region, $\ell \in \mathcal{L}$ as:

$$ \frac{1}{N_\ell - 1} \sum_{i \in \mathcal{I}_\ell} |p_i(c) - \bar{p}_i(c)|^2 \qquad (14) $$

with $N_\ell$, the number of particles in $I_\ell$. Total variance per region was computed by summing (14) over cell types (Fig. 6i) and per cell type was computed by summing (14) over regions (Fig. 7b).
constant spatial density of 1, as we use for modeling both atlas and target image varifolds in this case. Finally, in other settings without prior knowledge or wish to impose any on the specific densities prescribed to each indexed location, we can add a general regularization term to (10), such as the Kullback-Liebler divergence between the normalized estimated $\pi$ probability distribution and a uniform distribution across target features:

$$d_l \approx \sum_{f \in \mathcal{F}} \bar{\pi}_l(f) \log \left( \frac{\bar{\pi}_l(f)}{(1/|\mathcal{F}|)} \right), \quad l \in \mathcal{L} \qquad (12)$$

where $|\mathcal{F}|$ gives the number of discrete feature values in the target feature space and the probability distribution, $\bar{\pi}_l = \frac{1}{\sum_{f \in \mathcal{F}} \pi_l(f)} \pi_l$. We use this approach in the examples with BARseq data shown and in the context of a simultaneous rather than alternating optimization algorithm.

## Alternating LDDMM and quadratic program algorithm for joint optimization

For solving the variational problem of (10), optimal $\varphi, \pi$ are jointly estimated through either a single or alternating optimization scheme. In both cases, the template and target can be initially aligned through separate estimation of rigid transformations (translation and rotation) and a single isotropic scaling applied to the template to bring the total area of the template to equal that of the target. In this setting, rigid transformations are estimated by minimizing the varifold normed difference between the rotated and translated template atlas transformed to the target with L-BFGS.

Additionally, in both cases, a gradient-based optimization is performed until convergence or a specified number of iterations. We use L-BFGS optimization combined with a line search using the Wolf condition. In the single scheme, geometric parameters, $v_t$, and feature parameters, $\pi$ are optimized as a joint set of parameters in the gradient-based optimization. In contrast, an alternating scheme separates the estimation of geometric parameters and feature parameters with a gradient-based optimization for the former and the use of quadratic programming in the latter case.

The alternating scheme specifically follows$^{35}$, fixing the laws $(\pi_l)_{l \in \mathcal{L}}$ and optimizing over the control $v(t), t \in [0, 1]$ and integrating it, with the initial condition at the identity element, $\varphi_0 = \text{Id}$ (e.g. $\varphi_0(x) = x, \forall x \in \mathbb{R}^2$), to generate the diffeomorphism $\varphi_1$. The diffeomorphism is then fixed and quadratic programming, such as OSQP$^{63}$, used to estimate the feature laws. We outline this scheme explicitly below.

### Algorithm 1.

Initialize: $\pi_l(f) = \frac{1}{|\mathcal{F}|} f \in \mathcal{F}$

**A: Solve for $v$:**

1. Update and fix $(\pi_l)_{l \in \mathcal{L}}$.

2. Solve LDDMM, optimizing (10) with respect to vector field $v_t, t \in [0, 1]$.

3. Solve for $\varphi_1$, integrating O.D.E $\varphi_1 = \int_0^1 v_t \circ \varphi_t dt + \text{Id}$.

4. Flow $\mu_A^\pi$ according to $\varphi_1$, giving $\varphi_1 \cdot \mu_A^\pi$.

**B: Solve for $(\pi_l)_{l \in \mathcal{L}}$:**

1. Fix spatial positions in the deformed template, $\varphi(x_i), i \in \mathcal{L}$.

2. Optimize quadratic program (13) with respect to $(\pi_l)_{l \in \mathcal{L}}$.

**Return to A**

For the atlas, we define the form of the image varifold: $\mu_A = \sum_{i \in \mathcal{L}} \delta_{x_i} \otimes w_i p_i$, with, $w_i p_i \in \mathcal{M}(\mathcal{L})$, a measure over the atlas feature values (partitions). The estimated feature distributions are given via $\pi$ as the mixture distribution, $w_i p_i = \sum_{l \in \mathcal{L}} w_l p_l(\ell) \pi_l$. We specify the target over the index set, $J$, as: $\mu_T = \sum_{j \in \mathcal{L}} \delta_{x_j} \otimes w_j p_j$ with each $w_j p_j$ and estimated $w'_j p'_j \in \mathcal{M}(\mathcal{F})$. We use this notation in defining the general

form of the quadratic program, with constraint given as described in "Variational problems" section:

$$ \begin{aligned} & \inf_{\pi_l, l \in \mathcal{L}} \| \varphi_1 \cdot \mu_A^\pi - \mu_T \|_{W'}^2 \\ = & \inf_{\pi_l, l \in \mathcal{L}} \sum_{i, l \in \mathcal{L}} |D\varphi_1|_{x_i} |D\varphi_1|_{x_l} K_1(\varphi(x_i), \varphi(x_l)) \sum_{f \in \mathcal{F}} w'_i p'_i(f) w'_i p'_i(f) \\ & - 2 \sum_{i \in \mathcal{L}} \sum_{j \in \mathcal{L}} |D\varphi_1|_{x_i} K_1(\varphi(x_i), x_j) \sum_{f \in \mathcal{F}} w_j p_j(f) w'_i p'_i(f) \\ & \text{subject to } w^{\min} \le w'_i \le w^{\max}, i \in \mathcal{L}. \end{aligned} \qquad (13) $$

**Remark 1.** In the algorithm, under the assumption of a constant density with $w_i = 1$ for all $i \in \mathcal{L}$, we can approximate the estimated distributions, $w'_i p'_i, i \in \mathcal{L}$, by the single $\pi_l$ at each location (e.g. particle or simplex) for the $l$ with the largest mass. Defining the greedy maximizer map $\ell^*(i) = \arg \max_{l \in \mathcal{L}} p_l(\ell) \in \mathcal{L}$, we can simplify the computations by using the approximation $w'_i p'_i \simeq p_i(\ell^*(i)) \pi_{\ell^*(i)}$. This is particularly relevant for tissue-scale atlases where most particles or simplices in the image-varifold object are interior to a single atlas region and therefore carry a conditional feature distribution, $p_i = \delta_{\ell^*(i)}$, with all mass attributed to a single feature value, $\ell^*(i)$. For these indexed locations, the above approximation becomes an equality: $w'_i p'_i = \pi_{\ell^*(i)} = \pi_{\ell^*(i)}$.

Both single and alternating optimization schemes were utilized in the examples shown in this work and are available with respective Python git repositories: https://github.com/kstouff4/xIV-LDDMM-Particle v1.0.0$^{64}$ and https://github.com/kstouff4/MeshLDDMMQP v1.0.0$^{65}$. The single optimization scheme is provided in the context of point cloud image-varifold implementations, whereas the alternating scheme is provided in the context of mesh-based image-varifold implementations. The quadratic program solver used in the context of the alternating scheme is OSQP as implemented in the Python qpsolvers library. Both schemes were developed and tested on a 12 GB TITAN V GPU with CUDA 10.2 and NVIDIA-SMI and Driver 440.33.01, with expected runtime varying by the size of the dataset, but on the order of 2-4 h for most examples highlighted in this work.

## Empirical distribution estimation and cross-replicate statistical comparison

For empirical atlas construction from single or multiple MERFISH sections ("Cross-replicate comparison and atlas construction" section), we used a 50 µm particle rendering (-20k particles) of the CCFv3 section as a scaffold. We assigned each mapped MERFISH cell to its nearest neighbor in the CCFv3 section, giving a distribution over cell types per particle in the CCFv3 section. As described in "Cross-replicate comparison and atlas construction" section, we computed variance in probability distribution within a region by modeling the probability distributions per particle, $p_i$, as vectors in $\mathbb{R}^C$, with the number of cell (sub)types $C = 33$, and $|p_i| = 1$. We computed mean cell type probability distributions per CCFv3 region, denoted $\bar{p}_i$ for $l \in \mathcal{L}$ by selecting the subset of particles, $l \in \mathcal{L}$, for each region with at least half of their mass in that region. Under our model of spatial homogeneity per atlas region, we assume the conditional cell type probabilities per location (particle) within each atlas region are consistent. For a given cell (sub)type, c, and replicate, k, we computed spatial variance within a region, $l \in \mathcal{L}$ as:

$$ \frac{1}{N_l - 1} \sum_{i \in \mathcal{L}} |p_i(c) - \bar{p}_i(c)|^2 \qquad (14) $$

with $N_l$, the number of particles in $l$. Total variance per region was computed by summing (14) over cell types (Fig. 6i) and per cell type was computed by summing (14) over regions (Fig. 7b).
To assess differences in cell type distribution between replicates (Figs. 6g and 7a), we similarly constructed empirical cell type distributions for each replicate independently, giving for the same indexed particle set, *l*, in the CCFv3 section, three separate image-varifold measures:

$$ 
\begin{aligned}
\mu^0 &= \sum_{i \in l} w_i^0 \delta_{x_i} \otimes p_i^0 \\
\mu^1 &= \sum_{i \in l} w_i^1 \delta_{x_i} \otimes p_i^1 \\
\mu^2 &= \sum_{i \in l} w_i^2 \delta_{x_i} \otimes p_i^2
\end{aligned} 
\qquad (15) $$

with $w_i^k$ for $k = 0, 1, 2$ denoting the cell density (cells per 50 µm² area) for each of the three targets over the CCFv3 space and $p_i^k$ for $k = 0, 1, 2$. We computed spatial variance within each region for each replicate with (14) (Fig. 6j, k). We compared mean cell type probability distributions across replicates for a given cell type, *c*, and in a region, *l*, as:

$$ \frac{1}{2} \sum_{k=0}^{2} |\overline{p}_{i}^{k}(c) - \frac{1}{3}(\overline{p}_{i}^{0}(c) + \overline{p}_{i}^{1}(c) + \overline{p}_{i}^{2}(c))|^{2} \qquad (16) $$

with total variance between replicates for a given cell type, *c* computed by summing (16) across regions (Fig. 7a) and total variance between replicates for a given region computed by summing (16) over cell types (Fig. 6g).

## Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

## Data availability

Serial MERFISH sections from the Allen Institute were produced under the BRAIN Initiative Cell Census Network (BICCN, www.biccn.org, RRRID:SCR_015820) and are available at the Brain Image Library (BIL, https://www.brainimagelibrary.org/index.html) under https://doi.org/10.35077/g.610. Cell-segmented MERFISH sections with cell type annotations are available at Zenodo (https://doi.org/10.5281/zenodo.8384018) from Clifton et al.⁶⁶. Serial BARseq sections with cell-level data are available at Mendeley data (https://doi.org/10.17632/8bhhk7c5n9.1). The Waxholm rat brain atlas used in this study is available at https://www.nitrc.org/projects/whs-sd-atlas. The Allen CCFv3 used in this study is available at https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/ccf_2022/. The DevCCF used in this study is available at https://kimlab.io/brain-map/DevCCF/.

## Code availability

Implementations of the algorithms described here can be found at: https://github.com/kstouff4/MeshLDDMMQP (triangled mesh implementation) v1.0.0⁶⁵ and https://github.com/kstouff4/xIV-LDDMM-Particle (point cloud implementation) v1.0.0⁶⁴.

## References

1. Wang, Q. et al. The allen mouse brain common coordinate framework: a 3d reference atlas. Cell 181, 936–953 (2020).

2. Paxinos, G. & Franklin, K. B. Paxinos and Franklin's the Mouse Brain in Stereotaxic Coordinates (Academic Press, USA, 2019).

3. Jones, A., Townes, F. W., Li, D. & Engelhardt, B. E. Alignment of spatial genomics data using deep Gaussian processes. Nat. Methods 20, 1–9 (2023).

4. Christensen, G. E., Rabbitt, R. D. & Miller, M. I. Deformable templates using large deformation kinematics. IEEE Trans. Image Process. 5, 1435–1447 (1996).

5. Grenander, U. & Miller, M. I. Computational anatomy: an emerging discipline. Appl. Math. 56, 617–694 (1998).

6. Thompson, P. & Toga, A. A framework for computational anatomy. Comput. Vis. Sci. 5, 13–34 (2002).

7. Ding, Z. & Niethammer, M. Aladdin: Joint atlas building and diffeomorphic registration learning with pairwise alignment. In Proc. IEEE/ CVF Conference on Computer Vision and Pattern Recognition 20784–20793 (IEEE, 2022).

8. Miller, M. I., Trouvé, A. & Younes, L. On the metrics and Euler-Lagrange equations of computational anatomy. Annu. Rev. Biomed. Eng. 4, 375–405 (2002).

9. Avants, B. & Gee, J. C. Geodesic estimation for large deformation anatomical shape averaging and interpolation. NeuroImage 23, 139–150 (2004).

10. Joshi, S., Davis, B., Jomier, M. & Gerig, G. Unbiased diffeomorphic atlas construction for computational anatomy. NeuroImage 23, 151–160 (2004).

11. Miller, M. I. Computational anatomy: shape, growth, and atrophy comparison via diffeomorphisms. NeuroImage 23, 19–33 (2004).

12. Ashburner, J. A fast diffeomorphic image registration algorithm. NeuroImage 38, 95–113 (2007).

13. Avants, B. B., Epstein, C. L., Grossman, M. & Gee, J. C. Symmetric diffeomorphic image registration with cross-correlation: Evaluating automated labeling of elderly and neurodegenerative brain. Med. Image Anal. 12, 26–41 (2008).

14. Vercauteren, T., Pennec, X., Perchant, A. & Ayache, N. Diffeomorphic demons: efficient non-parametric image registration. NeuroImage 45, 61–72 (2009).

15. Yeo, B. T. et al. Spherical demons: fast diffeomorphic landmark-free surface registration. IEEE Trans. Med. Imaging 29, 650–68 (2010).

16. Ashburner J, R. G. Symmetric diffeomorphic modeling of longitudinal structural MRI. Front. Neurosci. 5, 38074 (2013).

17. Beg, M. F., Miller, M. I., Trouvé, A. & Younes, L. Computing large deformation metric mappings via geodesic flows of diffeomorphisms. Int. J. Comput. Vision 61, 139–157 (2005).

18. Wang, J. & Zhang, M. Geo-sic: learning deformable geometric shapes in deep image classifiers. Adv. Neural Inf. Process. Syst. 35, 27994–28007 (2022).

19. Kulason, S. et al. Cortical thickness atrophy in the transentorhinal cortex in mild cognitive impairment. NeuroImage Clin. 21, 101617 (2019).

20. Heinrich, M. P. et al. MIND: modality independent neighbourhood descriptor for multi-modal deformable registration. Med. Image Anal. 16, 1423–1435 (2012).

21. Tward, D. et al. Diffeomorphic registration with intensity transformation and missing data: application to 3D digital pathology of Alzheimer's disease. Front. Neurosci. 14, 1–18 (2020).

22. Stouffer, K. M., Witter, M. P., Tward, D. J. & Miller, M. I. Projective diffeomorphic mapping of molecular digital pathology with tissue mri. Commun. Eng. 1, 44 (2022).

23. Iglesias, J. E. et al. Joint registration and synthesis using a probabilistic model for alignment of mri and histological sections. Med. Image Anal. 50, 127–144 (2018).

24. Yang, Q. et al. Mri cross-modality image-to-image translation. Sci. Rep. 10, 1–18 (2020).

25. Islam, K. T., Wijewickrema, S. & O'Leary, S. A deep learning based framework for the registration of three dimensional multi-modal medical images of the head. Sci. Rep. 11, 1–13 (2021).

26. Ding, W., Li, L., Zhuang, X. & Huang, L. Cross-modality multi-atlas segmentation using deep neural networks. In International Conference on Medical Image Computing and Computer-Assisted Intervention 233–242 (Springer, Cham, 2020).

27. Tian, L., Chen, F. & Macosko, E. Z. The expanding vistas of spatial transcriptomics. Nat. Biotechnol. 41, 773–782 (2022).
To assess differences in cell type distribution between replicates (Figs. 6g and 7a), we similarly constructed empirical cell type distributions for each replicate independently, giving for the same indexed particle set, *l*, in the CCFv3 section, three separate image-varifold measures:

$$ 
\begin{aligned}
\mu^0 &= \sum_{i \in l} w_i^0 \delta_{x_i} \otimes p_i^0 \\
\mu^1 &= \sum_{i \in l} w_i^1 \delta_{x_i} \otimes p_i^1 \\
\mu^2 &= \sum_{i \in l} w_i^2 \delta_{x_i} \otimes p_i^2
\end{aligned} 
\qquad (15) $$

with $w_i^k$ for $k = 0, 1, 2$ denoting the cell density (cells per 50 µm² area) for each of the three targets over the CCFv3 space and $p_i^k$ for $k = 0, 1, 2$. We computed spatial variance within each region for each replicate with (14) (Fig. 6j, k). We compared mean cell type probability distributions across replicates for a given cell type, *c*, and in a region, *l*, as:

$$ \frac{1}{2} \sum_{k=0}^{2} |\overline{p}_{l}^{k}(c) - \frac{1}{3}(\overline{p}_{l}^{0}(c) + \overline{p}_{l}^{1}(c) + \overline{p}_{l}^{2}(c))|^{2} \qquad (16) $$

with total variance between replicates for a given cell type, *c* computed by summing (16) across regions (Fig. 7a) and total variance between replicates for a given region computed by summing (16) over cell types (Fig. 6g).

## Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

## Data availability

Serial MERFISH sections from the Allen Institute were produced under the BRAIN Initiative Cell Census Network (BICCN, www.biccn.org, RRRID:SCR_015820) and are available at the Brain Image Library (BIL, https://www.brainimagelibrary.org/index.html) under https://doi.org/10.35077/g.610. Cell-segmented MERFISH sections with cell type annotations are available at Zenodo (https://doi.org/10.5281/zenodo.8384018) from Clifton et al.⁶⁶. Serial BARseq sections with cell-level data are available at Mendeley data (https://doi.org/10.17632/8bhhk7c5n9.1). The Waxholm rat brain atlas used in this study is available at https://www.nitrc.org/projects/whs-sd-atlas. The Allen CCFv3 used in this study is available at https://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/ccf_2022/. The DevCCF used in this study is available at https://kimlab.io/brain-map/DevCCF/.

## Code availability

Implementations of the algorithms described here can be found at: https://github.com/kstouff4/MeshLDDMMQP (triangled mesh implementation) v1.0.0⁶⁵ and https://github.com/kstouff4/xIV-LDDMM-Particle (point cloud implementation) v1.0.0⁶⁴.

## References

1. Wang, Q. et al. The allen mouse brain common coordinate framework: a 3d reference atlas. Cell 181, 936–953 (2020).

2. Paxinos, G. & Franklin, K. B. Paxinos and Franklin's the Mouse Brain in Stereotaxic Coordinates (Academic Press, USA, 2019).

3. Jones, A., Townes, F. W., Li, D. & Engelhardt, B. E. Alignment of spatial genomics data using deep Gaussian processes. Nat. Methods 20, 1–9 (2023).

4. Christensen, G. E., Rabbitt, R. D. & Miller, M. I. Deformable templates using large deformation kinematics. IEEE Trans. Image Process. 5, 1435–1447 (1996).

5. Grenander, U. & Miller, M. I. Computational anatomy: an emerging discipline. Appl. Math. 56, 617–694 (1998).

6. Thompson, P. & Toga, A. A framework for computational anatomy. Comput. Vis. Sci. 5, 13–34 (2002).

7. Ding, Z. & Niethammer, M. Aladdin: Joint atlas building and diffeomorphic registration learning with pairwise alignment. In Proc. IEEE/ CVF Conference on Computer Vision and Pattern Recognition 20784–20793 (IEEE, 2022).

8. Miller, M. I., Trouvé, A. & Younes, L. On the metrics and Euler-Lagrange equations of computational anatomy. Annu. Rev. Biomed. Eng. 4, 375–405 (2002).

9. Avants, B. & Gee, J. C. Geodesic estimation for large deformation anatomical shape averaging and interpolation. NeuroImage 23, 139–150 (2004).

10. Joshi, S., Davis, B., Jomier, M. & Gerig, G. Unbiased diffeomorphic atlas construction for computational anatomy. NeuroImage 23, 151–160 (2004).

11. Miller, M. I. Computational anatomy: shape, growth, and atrophy comparison via diffeomorphisms. NeuroImage 23, 19–33 (2004).

12. Ashburner, J. A fast diffeomorphic image registration algorithm. NeuroImage 38, 95–113 (2007).

13. Avants, B. B., Epstein, C. L., Grossman, M. & Gee, J. C. Symmetric diffeomorphic image registration with cross-correlation: Evaluating automated labeling of elderly and neurodegenerative brain. Med. Image Anal. 12, 26–41 (2008).

14. Vercauteren, T., Pennec, X., Perchant, A. & Ayache, N. Diffeomorphic demons: efficient non-parametric image registration. NeuroImage 45, 61–72 (2009).

15. Yeo, B. T. et al. Spherical demons: fast diffeomorphic landmark-free surface registration. IEEE Trans. Med. Imaging 29, 650–68 (2010).

16. Ashburner J, R. G. Symmetric diffeomorphic modeling of longitudinal structural MRI. Front. Neurosci. 5, 38074 (2013).

17. Beg, M. F., Miller, M. I., Trouvé, A. & Younes, L. Computing large deformation metric mappings via geodesic flows of diffeomorphisms. Int. J. Comput. Vision 61, 139–157 (2005).

18. Wang, J. & Zhang, M. Geo-sic: learning deformable geometric shapes in deep image classifiers. Adv. Neural Inf. Process. Syst. 35, 27994–28007 (2022).

19. Kulason, S. et al. Cortical thickness atrophy in the transentorhinal cortex in mild cognitive impairment. NeuroImage Clin. 21, 101617 (2019).

20. Heinrich, M. P. et al. MIND: modality independent neighbourhood descriptor for multi-modal deformable registration. Med. Image Anal. 16, 1423–1435 (2012).

21. Tward, D. et al. Diffeomorphic registration with intensity transformation and missing data: application to 3D digital pathology of Alzheimer's disease. Front. Neurosci. 14, 1–18 (2020).

22. Stouffer, K. M., Witter, M. P., Tward, D. J. & Miller, M. I. Projective diffeomorphic mapping of molecular digital pathology with tissue mri. Commun. Eng. 1, 44 (2022).

23. Iglesias, J. E. et al. Joint registration and synthesis using a probabilistic model for alignment of mri and histological sections. Med. Image Anal. 50, 127–144 (2018).

24. Yang, Q. et al. Mri cross-modality image-to-image translation. Sci. Rep. 10, 1–18 (2020).

25. Islam, K. T., Wijewickrema, S. & O'Leary, S. A deep learning based framework for the registration of three dimensional multi-modal medical images of the head. Sci. Rep. 11, 1–13 (2021).

26. Ding, W., Li, L., Zhuang, X. & Huang, L. Cross-modality multi-atlas segmentation using deep neural networks. In International Conference on Medical Image Computing and Computer-Assisted Intervention 233–242 (Springer, Cham, 2020).

27. Tian, L., Chen, F. & Macosko, E. Z. The expanding vistas of spatial transcriptomics. Nat. Biotechnol. 41, 773–782 (2022).
28. Biancalani, T. et al. Deep learning and alignment of spatially resolved single-cell transcriptomes with tangram. *Nat. Methods* **18**, 1352–1362 (2021).

29. Vahid, M. R. et al. High-resolution alignment of single-cell and spatial transcriptomes with cytospace. *Nat. Biotechnol.* **41**, 1543–1548 (2023).

30. Zeira, R., Land, M., Strzalkowski, A. & Raphael, B. J. Alignment and integration of spatial transcriptomics data. *Nat. Methods* **19**, 567–575 (2022).

31. Joshi, S. C. & Miller, M. I. Landmark matching via large deformation diffeomorphisms. *IEEE Trans. Image Process.* **9**, 1357–1370 (2000).

32. Xia, C. R., Cao, Z. J., Tu, X. M. & Gao, G. Spatial-linked alignment tool (SLAT) for aligning heterogenous slices. *Nat. Commun.* **14**, 7236 (2023).

33. Tang, Z. et al. Search and match across spatial omics samples at single-cell resolution. Preprint at bioRxiv https://doi.org/10.1101/2023.08.13.552987 (2023).

34. Miller, M., Tward, D. & Trouvé, A. Molecular computational anatomy: unifying the particle to tissue continuum via measure representations of the brain. *BME Front.* **2022**, 9868673 (2022).

35. Miller, M. I., Trouvé, A. & Younes, L. Space-feature measures on meshes for mapping spatial transcriptomics. *Med. Image Anal.* **93**, 103068 (2024).

36. Chen, X., Fischer, S., Zhang, A., Gillis, J. & Zador, A. Modular cell type organization of cortical areas revealed by in situ sequencing. Preprint at bioRxiv https://doi.org/10.1101/2022.11.06.515380 (2022).

37. Miller, M. I., Trouvé, A. & Younes, L. Geodesic shooting for computational anatomy. *J. Math. Imaging Vision* **24**, 209–228 (2006).

38. Miller, M. I., Younes, L. & Trouvé, A. Diffeomorphometry and geometric positioning systems for human anatomy. *Technology* **02**, 36–43 (2014).

39. Petukhov, V. et al. Cell segmentation in imaging-based spatial transcriptomics. *Nat. Biotechnol.* **40**, 345–354 (2022).

40. Littman, R. et al. Joint cell segmentation and cell type annotation for spatial transcriptomics. *Mol. Syst. Biol.* **17**, 10108 (2021).

41. Traag, V. A., Waltman, L. & Van Eck, N. J. From louvain to leiden: guaranteeing well-connected communities. *Sci. Rep.* **9**, 5233 (2019).

42. Miller, B. F., Bambah-Mukku, D., Dulac, C., Zhuang, X. & Fan, J. Characterizing spatial gene expression heterogeneity in spatially resolved single-cell transcriptomic data with nonuniform cellular densities. *Genome Res.* **31**, 1843–1855 (2021).

43. Chen, X. et al. High-throughput mapping of long-range neuronal projection using in situ sequencing. *Cell* **179**, 772–786 (2019).

44. Rodriques, S. G. et al. Slide-seq: a scalable technology for measuring genome-wide expression at high spatial resolution. *Science* **363**, 1463–1467 (2019).

45. Stringer, C., Wang, T., Michaelos, M. & Pachitariu, M. Cellpose: a generalist algorithm for cellular segmentation. *Nat. Methods* **18**, 100–106 (2021).

46. Yao, Z. et al. A taxonomy of transcriptomic cell types across the isocortex and hippocampal formation. *Cell* **184**, 3222–3241 (2021).

47. Nichols, T. & Hayasaka, S. Controlling the familywise error rate in functional neuroimaging: a comparative review. *Stat. Methods Med. Res.* **12**, 419–446 (2003).

48. Younes, L., Albert, M. & Miller, M. I. Inferring changepoint times of medial temporal lobe morphometric change in preclinical Alzheimer's disease. *NeuroImage Clin.* **5**, 178–187 (2014).

49. Paxinos, G., Halliday, G., Watson, C. & Kassem, M. S. *Atlas of the Developing Mouse Brain* (Academic Press, 2020).

50. Atlas, D. M. B. *Allen Brain Atlas* (Allen Institute for Brain Science, USA, 2006).

51. Kronman, F. A. et al. Developmental mouse brain common coordinate framework. Preprint at bioRxiv https://doi.org/10.1101/2023.09.14.557789 (2023).

52. Kleven, H., Bjerke, I. E., Clascá, F., Groenewegen, H. J., Bjaalie, J. G. & Leergaard, T. B. Waxholm space atlas of the rat brain: a 3d atlas

supporting data analysis and integration. *Nat. Methods* **20**, 1822–1829 (2023).

53. Chon, U., Vanselow, D. J., Cheng, K. C. & Kim, Y. Enhanced and unified anatomical labeling for a common mouse brain atlas. *Nat. Commun.* **10**, 5067 (2019).

54. Thompson, C. L. et al. A high-resolution spatiotemporal atlas of gene expression of the developing mouse brain. *Neuron* **83**, 309–323 (2014).

55. Moses, L. & Pachter, L. Museum of spatial transcriptomics. *Nat. Methods* **19**, 534–546 (2022).

56. Chen, X. et al. Whole-cortex in situ sequencing reveals peripheral input-dependent cell type-defined area identity. Preprint at bioRxiv https://doi.org/10.1101/2022.11.06.515380 (2023).

57. Garin, C. M., Garin, M., Silenzi, L., Jaffe, R. & Constantinidis, C. Multilevel atlas comparisons reveal divergent evolution of the pri-mate brain. *Proc. Natl Acad. Sci. USA* **119**, 2202491119 (2022).

58. Beauchamp, A. et al. Whole-brain comparison of rodent and human brains using spatial transcriptomics. *Elife* **11**, 79418 (2022).

59. Liwang, J. K. et al. epDevAtlas: mapping gabaergic cells and microglia in postnatal mouse brains. Preprint at bioRxiv https://doi.org/10.1101/2023.11.24.568585 (2023).

60. Cheng, S.-W., Dey, T. K., Shewchuk, J. & Sahni, S. *Delaunay Mesh Generation* (CRC Press, Boca Raton, FL, 2013).

61. Charon, N. & Trouvé, A. The varifold representation of nonoriented shapes for diffeomorphic registration. *SIAM J. Imaging Sci.* **6**, 2547–2580 (2013).

62. Dupuis, P., Grenander, U. & Miller, M. I. Variational problems on flows of diffeomorphisms for image matching. *Q. Appl. Math.* **56**, 587–600 (1998).

63. Stellato, B., Banjac, G., Goulart, P., Bemporad, A. & Boyd, S. OSQP: an operator splitting solver for quadratic programs. *Math. Program. Comput.* **12**, 637–672 (2020).

64. Stouffer, K., Charlier, B. & Trouvé, A.: xIV-LDDMM-Particle https://github.com/kstouff4/xIV-LDDMM-Particle (2024).

65. Stouffer, K. & Younes, L.: xIV-LDDMM-Mesh https://github.com/kstouff4/MeshLDDMMQP (2024).

66. Clifton, K. et al. Stalign: alignment of spatial transcriptomics data using diffeomorphic metric mapping. *Nat. Commun.* **14**, 8123 (2023).

## Acknowledgements

This work was supported by the National Institutes of Health (1F30AG077736-01 and T32-GM13677 (K.S.); R01EB020062, R01NS102670, U19AG033655, P41-EB031771, and R01MH105660 (M.M.); NIH Brain Initiative Grant U19MH114830 (H.Z.); RF1MH124605 (Y.K.)); the National Science Foundation (NSF) (16-569 NeuroNex contract 1707298 (M.M.)); the Computational Anatomy Science Gateway (M.M.) as part of the Extreme Science and Engineering Discovery Environment (XSEDE Towns et al., 2014), which is supported by the NSF grant ACI1548562; NSF CAREER 2047611 (J.F.); NSF 2124230 (L.Y.)); and the Kavli Neuroscience Discovery Institute supported by the Kavli Foundation (M.M.). We acknowledge Benjamin Charlier for his work on refactoring and improving the efficiency of the particle-based implementation of xIV-LDDMM. We acknowledge Fae Kronman for their contribution to the development of the DevCCF atlas used in this manuscript.

## Author contributions

M.M., A.T., and L.Y. developed the mathematical theory behind the manuscript. K.S. and M.M. drafted the manuscript. K.S. and L.Y. generated codes for algorithms described in the manuscript. K.S. created all the figures in the manuscript. M.K., L.N. and H.Z. generated serial MERFISH data. M.A. and J.F. annotated cell types for cell-segmented MERFISH data. Y.K. created the DevCCF atlas analyzed here with the CCFv3. X.C. and M.R. generated and cell typed the BARseq data analyzed in this manuscript, and specified particular cell type markers for
28. Biancalani, T. et al. Deep learning and alignment of spatially resolved single-cell transcriptomes with tangram. *Nat. Methods* **18**, 1352–1362 (2021).

29. Vahid, M. R. et al. High-resolution alignment of single-cell and spatial transcriptomes with cytospace. *Nat. Biotechnol.* **41**, 1543–1548 (2023).

30. Zeira, R., Land, M., Strzalkowski, A. & Raphael, B. J. Alignment and integration of spatial transcriptomics data. *Nat. Methods* **19**, 567–575 (2022).

31. Joshi, S. C. & Miller, M. I. Landmark matching via large deformation diffeomorphisms. *IEEE Trans. Image Process.* **9**, 1357–1370 (2000).

32. Xia, C. R., Cao, Z. J., Tu, X. M. & Gao, G. Spatial-linked alignment tool (SLAT) for aligning heterogenous slices. *Nat. Commun.* **14**, 7236 (2023).

33. Tang, Z. et al. Search and match across spatial omics samples at single-cell resolution. Preprint at bioRxiv https://doi.org/10.1101/2023.08.13.552987 (2023).

34. Miller, M., Tward, D. & Trouvé, A. Molecular computational anatomy: unifying the particle to tissue continuum via measure representations of the brain. *BME Front.* **2022**, 9868673 (2022).

35. Miller, M. I., Trouvé, A. & Younes, L. Space-feature measures on meshes for mapping spatial transcriptomics. *Med. Image Anal.* **93**, 103068 (2024).

36. Chen, X., Fischer, S., Zhang, A., Gillis, J. & Zador, A. Modular cell type organization of cortical areas revealed by in situ sequencing. Preprint at bioRxiv https://doi.org/10.1101/2022.11.06.515380 (2022).

37. Miller, M. I., Trouvé, A. & Younes, L. Geodesic shooting for computational anatomy. *J. Math. Imaging Vision* **24**, 209–228 (2006).

38. Miller, M. I., Younes, L. & Trouvé, A. Diffeomorphometry and geometric positioning systems for human anatomy. *Technology* **02**, 36–43 (2014).

39. Petukhov, V. et al. Cell segmentation in imaging-based spatial transcriptomics. *Nat. Biotechnol.* **40**, 345–354 (2022).

40. Littman, R. et al. Joint cell segmentation and cell type annotation for spatial transcriptomics. *Mol. Syst. Biol.* **17**, 10108 (2021).

41. Traag, V. A., Waltman, L. & Van Eck, N. J. From louvain to leiden: guaranteeing well-connected communities. *Sci. Rep.* **9**, 5233 (2019).

42. Miller, B. F., Bambah-Mukku, D., Dulac, C., Zhuang, X. & Fan, J. Characterizing spatial gene expression heterogeneity in spatially resolved single-cell transcriptomic data with nonuniform cellular densities. *Genome Res.* **31**, 1843–1855 (2021).

43. Chen, X. et al. High-throughput mapping of long-range neuronal projection using in situ sequencing. *Cell* **179**, 772–786 (2019).

44. Rodriques, S. G. et al. Slide-seq: a scalable technology for measuring genome-wide expression at high spatial resolution. *Science* **363**, 1463–1467 (2019).

45. Stringer, C., Wang, T., Michaelos, M. & Pachitariu, M. Cellpose: a generalist algorithm for cellular segmentation. *Nat. Methods* **18**, 100–106 (2021).

46. Yao, Z. et al. A taxonomy of transcriptomic cell types across the isocortex and hippocampal formation. *Cell* **184**, 3222–3241 (2021).

47. Nichols, T. & Hayasaka, S. Controlling the familywise error rate in functional neuroimaging: a comparative review. *Stat. Methods Med. Res.* **12**, 419–446 (2003).

48. Younes, L., Albert, M. & Miller, M. I. Inferring changepoint times of medial temporal lobe morphometric change in preclinical Alzheimer's disease. *NeuroImage Clin.* **5**, 178–187 (2014).

49. Paxinos, G., Halliday, G., Watson, C. & Kassem, M. S. *Atlas of the Developing Mouse Brain* (Academic Press, 2020).

50. Atlas, D. M. B. *Allen Brain Atlas* (Allen Institute for Brain Science, USA, 2006).

51. Kronman, F. A. et al. Developmental mouse brain common coordinate framework. Preprint at bioRxiv https://doi.org/10.1101/2023.09.14.557789 (2023).

52. Kleven, H., Bjerke, I. E., Clascá, F., Groenewegen, H. J., Bjaalie, J. G. & Leergaard, T. B. Waxholm space atlas of the rat brain: a 3d atlas

supporting data analysis and integration. *Nat. Methods* **20**, 1822–1829 (2023).

53. Chon, U., Vanselow, D. J., Cheng, K. C. & Kim, Y. Enhanced and unified anatomical labeling for a common mouse brain atlas. *Nat. Commun.* **10**, 5067 (2019).

54. Thompson, C. L. et al. A high-resolution spatiotemporal atlas of gene expression of the developing mouse brain. *Neuron* **83**, 309–323 (2014).

55. Moses, L. & Pachter, L. Museum of spatial transcriptomics. *Nat. Methods* **19**, 534–546 (2022).

56. Chen, X. et al. Whole-cortex in situ sequencing reveals peripheral input-dependent cell type-defined area identity. Preprint at bioRxiv https://doi.org/10.1101/2022.11.06.515380 (2023).

57. Garin, C. M., Garin, M., Silenzi, L., Jaffe, R. & Constantinidis, C. Multilevel atlas comparisons reveal divergent evolution of the pri-mate brain. *Proc. Natl Acad. Sci. USA* **119**, 2202491119 (2022).

58. Beauchamp, A. et al. Whole-brain comparison of rodent and human brains using spatial transcriptomics. *Elife* **11**, 79418 (2022).

59. Liwang, J. K. et al. epDevAtlas: mapping gabaergic cells and microglia in postnatal mouse brains. Preprint at bioRxiv https://doi.org/10.1101/2023.11.24.568585 (2023).

60. Cheng, S.-W., Dey, T. K., Shewchuk, J. & Sahni, S. *Delaunay Mesh Generation* (CRC Press, Boca Raton, FL, 2013).

61. Charon, N. & Trouvé, A. The varifold representation of nonoriented shapes for diffeomorphic registration. *SIAM J. Imaging Sci.* **6**, 2547–2580 (2013).

62. Dupuis, P., Grenander, U. & Miller, M. I. Variational problems on flows of diffeomorphisms for image matching. *Q. Appl. Math.* **56**, 587–600 (1998).

63. Stellato, B., Banjac, G., Goulart, P., Bemporad, A. & Boyd, S. OSQP: an operator splitting solver for quadratic programs. *Math. Program. Comput.* **12**, 637–672 (2020).

64. Stouffer, K., Charlier, B. & Trouvé, A.: xIV-LDDMM-Particle https://github.com/kstouff4/xIV-LDDMM-Particle (2024).

65. Stouffer, K. & Younes, L.: xIV-LDDMM-Mesh https://github.com/kstouff4/MeshLDDMMQP (2024).

66. Clifton, K. et al. Stalign: alignment of spatial transcriptomics data using diffeomorphic metric mapping. *Nat. Commun.* **14**, 8123 (2023).

## Acknowledgements

This work was supported by the National Institutes of Health (1F30AG077736-01 and T32-GM13677 (K.S.); R01EB020062, R01NS102670, U19AG033655, P41-EB031771, and R01MH105660 (M.M.); NIH Brain Initiative Grant U19MH114830 (H.Z.); RF1MH124605 (Y.K.)); the National Science Foundation (NSF) (16-569 NeuroNex contract 1707298 (M.M.)); the Computational Anatomy Science Gateway (M.M.) as part of the Extreme Science and Engineering Discovery Environment (XSEDE Towns et al., 2014), which is supported by the NSF grant ACI1548562; NSF CAREER 2047611 (J.F.); NSF 2124230 (L.Y.)); and the Kavli Neuroscience Discovery Institute supported by the Kavli Foundation (M.M.). We acknowledge Benjamin Charlier for his work on refactoring and improving the efficiency of the particle-based implementation of xIV-LDDMM. We acknowledge Fae Kronman for their contribution to the development of the DevCCF atlas used in this manuscript.

## Author contributions

M.M., A.T., and L.Y. developed the mathematical theory behind the manuscript. K.S. and M.M. drafted the manuscript. K.S. and L.Y. generated codes for algorithms described in the manuscript. K.S. created all the figures in the manuscript. M.K., L.N. and H.Z. generated serial MERFISH data. M.A. and J.F. annotated cell types for cell-segmented MERFISH data. Y.K. created the DevCCF atlas analyzed here with the CCFv3. X.C. and M.R. generated and cell typed the BARseq data analyzed in this manuscript, and specified particular cell type markers for
accuracy measurement. All authors contributed to the editing of the
final manuscript.

**Competing interests**

Under a license agreement between AnatomyWorks and the Johns
Hopkins University, Dr. Miller and the University are entitled to royalty
distributions related to technology described in the study discussed in
this. Dr. Miller is a founder of and holds equity in AntomyWorks. This
arrangement has been reviewed and approved by the Johns Hopkins
University in accordance with its conflict of interest policies. The
remaining authors declare no conflicts of interest.

**Additional information**

**Supplementary information** The online version contains
supplementary material available at
https://doi.org/10.1038/s41467-024-47883-4.

**Correspondence** and requests for materials should be addressed to
Kaitlin M. Stouffer or Michael I. Miller.

**Peer review information** *Nature Communications* thanks Ozgun Gokce and the other, anonymous, reviewers for their contribution to the peer review of this work. A peer review file is available.

**Reprints and permissions information** is available at
http://www.nature.com/reprints

**Publisher's note** Springer Nature remains neutral with regard to jur-
isdictional claims in published maps and institutional affiliations.

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2024
accuracy measurement. All authors contributed to the editing of the
final manuscript.

**Competing interests**

Under a license agreement between AnatomyWorks and the Johns
Hopkins University, Dr. Miller and the University are entitled to royalty
distributions related to technology described in the study discussed in
this. Dr. Miller is a founder of and holds equity in AntomyWorks. This
arrangement has been reviewed and approved by the Johns Hopkins
University in accordance with its conflict of interest policies. The
remaining authors declare no conflicts of interest.

**Additional information**

**Supplementary information** The online version contains
supplementary material available at
https://doi.org/10.1038/s41467-024-47883-4.

**Correspondence** and requests for materials should be addressed to
Kaitlin M. Stouffer or Michael I. Miller.

**Peer review information** *Nature Communications* thanks Ozgun Gokce and the other, anonymous, reviewers for their contribution to the peer review of this work. A peer review file is available.

**Reprints and permissions information** is available at
http://www.nature.com/reprints

**Publisher's note** Springer Nature remains neutral with regard to jur-
isdictional claims in published maps and institutional affiliations.

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2024