Hierarchical Computational Anatomy: Unifying the Molecular to Tissue Continuum Via Measure Representations of the Brain

Objective The objective of this research is to unify the molecular representations of spatial transcriptomics and cellular scale histology with the tissue scales of Computational Anatomy for brain mapping. Impact statement We present a unified representation theory for brain mapping based on geometric measures of the micro-scale phenotypes of molecular disease simultaneously with the connectomic scales of complex interacting brain circuits. Introduction Mapping across coordinate systems in computational anatomy allows us to understand structural and functional properties of the brain at the millimeter scale. New measurement technologies in digital pathology and spatial transcriptomics allow us to measure the brain molecule by molecule and cell by cell based on protein and transcriptomic identity. We currently have no mathematical representations for integrating consistently the tissue limits with the molecular particle descriptions. The formalism derived here demonstrates the methodology for transitioning consistently from the molecular scale of quantized particles – as first introduced by Dirac as the class of generalized functions – to the continuum and fluid mechanics scales appropriate for tissue. Methods We introduce two methods based on notions of generalized function geometric measures and statistical mechanics. We use generalized functions expanded to include functional geometric descriptions - electrophysiology, transcriptomic, molecular histology – to represent the molecular biology scale integrated with a Boltzman like procedure to pass from the sparse particles to empirical probability laws on the functional state of the tissue. Results We demonstrate a unified mapping methodology for transferring molecular information in the transcriptome and histological scales to the human atlas scales for understanding Alzheimer’s disease. Conclusions We demonstrate a unified brain mapping theory for molecular and tissue scales based on geometric measure representations.


Introduction
One of the striking aspects of the study of the brain in modern neurobiology is the fact that the distributions of discrete structures that make up physical tissue, from neural cells to synapses to genes and molecules, exists across nearly ten orders of magnitude in spatial scale. This paper focusses on the challenge of building multi-scale representations that simultaneously connect the quantum nano-scales of modern molecular biology and digital pathology for characterizing neural circuits architecture in the functioning brain and disease with the classical continuum representations at the anatomical gross and meso scales.
We have been highly motivated by the Cell Census Network project (BICCN [1]) which brings the nano and micron scales of single cell measures of RNA via spatial transcriptomics [2][3][4] coupled to the tissue scales of mouse atlases. The recent review on bridging scales from cells to physiology [5] motivates the mathematical framework presented herein. The recent emergence of spatial transcriptomics as Nature method of the year highlights the importance and ascendence of such approaches for understanding the dense metric structure of the brain which represent the coarse physiological atlas scales built up from dense imaging measurements at the cellular scales. Specifically, in our own work digital pathology for the study of Alzheimer's disease called the BIOCARD study [6], we are examining pathological Tau at both the micro histological and macro atlas scales of Tau particle detections, from 10-100 µ m [7,8] and to human magnetic resonance millimeter scales for examining entire circuits in the medial temporal lobe. In the mouse cell counting project we are examining single-cell spatial transcriptomics using modern RNA sequencing in dense tissue at the micron scale and its representations in the Allen atlas coordinates [9].
Most noteworthy for any representation is that at the finest micro scales nothing is smooth; the distributions of cells and molecules are more well described as random quantum counting processes in space [10]. In contrast, information associated to atlasing methods at the gross anatomical tissue and organ scales of Computational Anatomy extend smoothly [11][12][13][14][15][16]. Crosssectionally and even cross-species, gross anatomical labelling is largely repeatable, implying information transfers and changes from one coordinate system to another smoothly. This is built into the representation theory of diffeomorphisms and soft matter tissue models for which advection and transport hold [17][18][19][20][21], principles upon which continuum mechanics and its analogues are based. Also of note is the fact that the brain organizes information on geometric objects, submanifolds of the brains such as the foliation of the cortex and associated coordinates of the cortical columns. Our representations must both represent the quantum to ensemble scales as well as encode the geoemetric organization of the brain.
The focus of this paper is to build a coherent representation theory across scales. For this we view the micron to millimeter scales via the same representation theory called mathematical geometric measures, building the finest micron scales from discrete units termed particle measures which represent molecules, synapses and cells. The measure representation from fine to coarse scale aggregates forming tissue. This measure representation allows us to understand subsets of tissues that contain discretely positioned and placed functional objects at the finest quantized scales and simultaneously pass smoothly with aggregation to the classical continuum scales at which stable functional and anatomical representations exist. Since the study of the function of the brain on its geometric submanifolds -the gyri, sulci, subnuclei and laminae of cortex-are so important, we extend our general framework to exploit varifold measures [22] arising in the modern discipline of geometric measure theory. Geometric measures are a class of generalized functions which have the basic measure property of additivity on disjoint unions of the experimental probe space and encode the complex physiological functions with the geometric properties of the submanifolds to which they are associated. To be able to compare the brains we use diffeomorphisms as the comparator tool, with their action representing 3D varifold action which we formulate as "copy and paste" so that basic particle quantities that are conserved biologically are combined with greater multiplicity and not geometrically distorted as would be the case for measure transport.
The functional features are represented via generalized Dirac delta functions at the finest micro structure scales. The functional feature is abstracted into a function space rich enough to accomodate the molecular machinery as represented by RNA or Tau particles, as well as electrophysiology associated to spiking neurons, or at the tissue scales of medical imaging dense contrasts of magnetic resonance images (MRIs). We pass to the classical function continuum via introduction of a scale-space that extends the descriptions of cortical micro-circuits to the meso and anatomical scales. This passage from the quantized features to the stochastic laws is in fact akin to the Boltzman program transferring the view from the Newtonian particles to the stable distributions describing them. For this we introduce a scale-space of kernel density transformations which allows us to retrieve the empirical averages represented by the determinism of the stochastic law consistent with our views of the macro tissue scales.
The representation provides a recipe for scale traversal in terms of a cascade of linear space scaling composed with non-linear functional feature mapping. Following the cascade implies every scale is a measure so that a universal family of measure norms can be introduced which simultaneously measure the disparety between brains in the orbit independent of the probing technology, RNA identities, Tau or amyloid histology, spike trains, or dense MR imagery. Our brain measure model implies the existence of a sequence . This scale-space of pairs, the measure representation of the brain and the associated probing measurement technologies we call Brainspace. To formulate a consistent measurement and comparison technology on Brainspace we construct a natural metric upon it allowing us to study its geometry and connectedness. The metric between brains is constructed via a Hamiltonian which defines the geodesic connections throughout scale space, providing for the first time a hierarchical representation that unifies micro to millimeter representation in the brain and makes Brainspace into a metric space. Examples of representation and comparision are given for Alzheimer's histology integrated to magnetic resonance imaging scales, and spatial transcriptomics.

Measure Model of Brain Structures
To build a coherent theory we view the micron to anatomical scales via the same representation theory building upon discrete units termed particles or atoms. As they aggregate they form tissues. This is depicted in Figure 1 in which the top left panel shows mouse imaging of CUX1 labelling of the inner layers of mouse cortex (white) and CTP2 imaging of the outer layers (green) at 2.5 micron in plane resolution. Notice the discrete nature of the cells clearly resolved which form the layers of tissue which are the global macro scale features of layer 2,3,4 which stain more prolificaly in white and the outer layers 5,6 which stain more prolifically in green.
Our representation exists simultaneously at both the micro and tissue millimeter scales. A key aspect of anatomy is that at a micro or nano scale, information is encoded as a massive collection of pairs px i , f i q where x i R d (d 2, 3) describes the position of a "particle" and f i is a functional state in a given set F attached to it. In our applications F are proteins representing RNA signatures or Tau tangles, and for single cell Neurophysiology represents the dynamics of neural spiking. At the micro scale basically everything is deterministic, with every particle attached to its own functional state among possible functional state in F. But zooming out, the tissue level, say mm scale, appears through the statistical distribution of its constituents with two key quantities, the local density of particles ρ and the conditional probability distribution of the functional features µ x pdfq at any location x. At position x, we no longer have a deterministic functional state but a probability distribution µ x on functional states.
The integration of both descriptions into a common mathematical framework can be done quite naturally in the setting of mathematical measures which are mathematical constructs that are able to represent both the discrete and continuous worlds as well as natural level of approximation between both. We associate the elementary 'Dirac' δ x δ f which applies to infinitesimal volumes in space and function so that δ x δ f pdx, df q δ x pdxqδ f pdfq is equal to 1 if x dx and f df and 0, otherwise. Indeed the set MpR d ¢ Fq of finite positive measures on R d ¢ F contains discrete measures written as where w i is a positive weight that can encode the collection px i , f i q at micro scale.
As in Boltzmann modelling we describe the features statistically at a fixed spatial scale transferring our attention to their stochastic laws modelled as conditional probabilities in M P pFq with integral 1. For this we factor the measures into the marginal density measure on space ρ µ on R d with ρ µ pdxq ³ F µpdx, df q, and the field of probability distributions on F conditioned on x.
We use the convention dx and df as events in space and function, respectively, implying the classical factorization with field of conditional probabilities: Continuous tissues we abstract as brain measures µ with marginal ρ µ having a tissue density ρpdxq ρ c pxqdx with respect to the Lebesgue measure on R d . A fundamental link between the molecular and continuum tissue can be addressed through the law of large numbers since if px i , f i q i¥0 is an independent and identically distributed sample drawn from law µ{M of R d ¢ F where M ³ R d ¢F µpdx, df q is the total mass of such µ, then we have almost surely the weak convergence Passing from the tissue scales to the molecular-cellular scales behooves us to introduce a scale-space so that empirical averages which govern it are repeatable. Figure 1 (right) depicts our multi-scale model of a brain as a sequence of measures: Our idealization of Brainspace as a sequence of measures as depicted in Figure 1 descends from the the coarse tissue scale (top) to the finest particle representation (bottom), with color representing function f F, and radius space-scale.Throughout the range of scales is denoted shorthand max to mean 0 ¤ max with lowest scale 0 and upper max not attained.

Nonlinear Transformation Model for Crossing Scales
The brain being a multi-scale collection of measures requires us to be able to transform from one scale to another. We do this by associating a scale-space to each particle feature by pairing to each measure a kernel function transforming it from a generalized function to a classical function δ z : h Þ Ñ hpzq. The kernels carry resolution scales σ or reciprocally bandwidths, analogous to Planck's scale.
We introduce the abstract representation of our system as a collection of descriptive elements z Z made from spatial and functional features. We transform our mathematical measure µp¤q on Z generating new measures µ I p¤q on Z I by defining correspondences via kernels z Þ Ñ kpz, dz I q, with the kernel acting on the measures transforming as This implies the particles transform as Krδ zi spdz I q kpz i , dz I q. Figure 1 (bottom row) shows the cascade of operations operations µ Þ Ñ ν on F transforming linearly, the second ν Þ Ñ µ on F nonlinearly; transforming µ °i I w i δ xi δ fi to scale gives 6 9 9 9 8 9 9 9 7 We use space resampling defined by πpx, yq the fraction particle x shares with y, giving density ρ ν ³ R d wpxqδ x dx and (6b) Feature reduction uses singular kernels with projective feature maps from machine learning, α Þ Ñ φpαq F , We compute via lattices pY j , y j Y j q jI transforming to scale (see Methods 4.2) generating measures on the lattice:

Dynamical Systems Model via Varifold Action of Multi-scale Diffeomorphisms
We want to measure and cluster brains by building a metric space structure. We do this by following the original program of D'Arcy Thompson building bijective crrespondence. In this setting this must be done at every scale with each scale having different numbers of particles and resolutions. We build correspondence between sample brains via dense connections of the discrete particles to the continuum at all scales using the diffeomorphism group and diffeomorphic transport. For this define the group of k-times continuously differentiable diffeomorphisms ϕ G k with group operation function composition ϕ a ¥ϕ b . For any brain Space scales are represented as the group product, ϕ : pϕ q max , acting component-wise with action The |dϕpxq| term in the action we call the "copy and paste" varifold action. It enables the crucial property that when a tissue is extended to a larger area, the total number of its basic constituents increase accordingly with total integral not conserved, in contrast to classic measure or probability transport.
Dynamics occurs by generating the diffeomorphism as flows t Ñ pϕ t q max , with dynamics controlled by vector fields t Þ Ñ u t : pu t q max via the ordinary differential equation (ODE) at each scale satisfying The controls are coupled by successive refinement v , max , with u ¡1 0: To control smoothness of the maps we force the vector fields to be elements of a reproducing kernel Hilbert spaces (RKHS's) V , Each RKHS is taken to have a diagonal kernel K p¤, ¤q g p¤, ¤qid d , with g the Green's functions with id d the d ¢ d identity (see [24] for non-diagonal kernels). Geodesic mapping flows under a control process along paths of minimum energy respecting the boundary conditions.  The multi-scale dynamical control are written 9 ϕ t u t ¥ ϕ t : pu t ¥ ϕ t q max . The dynamical system is an observer and dynamics equation: Dynamics translates into a navigation in the orbit of brains and provides a metric distance between brains. Paths of minimum energy connecting the identity ϕ 0 Id to any fixed boundary condition (BC) ϕ 1 where ϕ 1 is accessible defines the distance extending LDDMM [23] to a hierarchy of diffeomorphisms, and is a geodesic for an associated Riemannian metric [24].
The metric from µ 0 to µ 1 in the orbit accesible from µ 0 via diffeomorphisms is the shortest length geodesic paths with BCs ϕ 0 ¤ µ 0 µ 0 and ϕ 1 ¤ µ 0 µ 1 . This extension to multi-scale LDDMM Eqn. (23) is given in the Methods 4.4 where we discuss the smoothness required for the geodesics to define a metric and specify the optimal control problem in the state Eqn. (25).

Geodesic Brain Mapping via the Varifold Measure Norm
The BC for matching two brains is defined using measure norms with equality meaning brains are equal, with small normed difference meaning brains are similar. Every brain has a variable number of particles, without correspondence between particles.
Measure norms accomodate these variabilities. Geodesic mapping solves for the control minimizing the energy with the boundary endpoint condition modelled via measure norms. The endpoint is a varifold norm constructed from the basic inner product on pairs of points involving a smooth kernel with the kernel defined as separable Gaussians in space and function (see Methods 4.3). The measure norm-square becomes the hierarchical norms across the scales becomes }µ} 2 The optimal control pu t q 0¤t¤1 is square-integrable under the V -norms, satisfying for α ¡ 0: Hamiltonian control parameterizes the measures µpq t q :°i I w i,t δ xi,t δ fi via the flows of the state processes giving endpoint q 1 Þ Ñ U pq 1 q ° max U pq 1 q modelled as continuously differentiable in the states: Hamiltonian control reparameterizes (11) In the above we have eased notation removing indexing of the optimal controls by scales when implied. Methods 4.5 establishes the smoothness for the Hamiltonian equations. Methods 4.6 establishes the smoothness for the norm gradients.

Gradients of the norm endpoints unifying the molecular and tissue models.
Calculating the variations on dense voxel images unifies the tissue scales with the sparse molecular scales. Imaging at the tissue continuum scales has the measures as dense limits µ The endpoint gradient for the continuum U pq 1 q, q 1 pϕ 1 , w 1 q is the average of h q over the feature space: (16) We emphasize that the varifold action gives the continuum problem unifying with LDDMM [23]; taking Ipyq R with µ y δ Ipyq , µ I : ³ R d δ y δ Ipyq dy, the action becomes This unifies with the action of LDDMM: 2.5 MRI and Digital Pathology for Tau Histology in Alzheimer's 2.5.1 Bayes Segmentation of MRI and Figure 3 shows the multi-scale data from the clinical BIOCARD study [6] of Alzheimer's disease within the medial temporal lobe Box depicts trans-entorhinal region from top row. Right two panels shows mean particle size and standard deviation at µm and tissue scales; deep red color denotes 80 µm 2 Tau area. for brain parcellation performs feature reduction as a key step for segmentation at tissue scales [26]. Feature reduction maps the distribution on gray levels F r0, 255s to probabilities on N tissue types, defined by the integration over the decision regions θ n r0, 255s: φ n pµ x q » θn µ x pdfq p n , n 1, . . . , N .

Gaussian Scale-Space Resampling of Tau Histology:
For histology at the molecular scales the measure encodes the detected Tau and amyloid particles µ °i w i δ xi δ fi for fine scale particles with function the geometric features F R . Figure 3 (bottom row) shows the detected Tau particles as red dots at 4µ m with feature reduction done via moments on tau. We use computational lattices to interpolate between scales reapportioning particles pδ xi , x i R d q iI to the lattice centers pδ yj , y j Y j R d q jII , via Gaussian resampling x Þ Ñ πpx, Y j q from 4µm. Feature reduction maps to the first two moments at the tissue scale of mean and variance of particle size F R 2 : µ ¸j I w j δ yj δ φpνy j q with 6 9 9 9 9 8 9 9 9 9 7 The bottom row of Figure 3 (right two panels) shows the mean and variance of the particle size reconstructed from the 4µ m scale: The mm scale depicts the global folding property of the tissue. The color codes the mean tissue Tau area as a function of position at the tissue scales with deep red color denoting 80 µm 2 maximum Tau area for the detected particles.

Cellular Neurophysiology: Neural Network Temporal Models
Single unit neurophysiology uses temporal models of spiking neurons with a "neural network" µ °i δ xi δ fi , x i R d , f i F taking each neuron x i modelled as a counting measure in time N i ptq, t ¥ 0 with the spike times the feature f i pt k q 1¤k¤n f i : Post-stimulus time (PST) [27] and interval histograms are used to examine the instantaneous discharge rates and inter-spike interval statistics [28]. The interval histogram abandons the requirement of maintaining the absolute phase of the signal for measuring temporal periodicity and phase locking. Synchrony in the PST is measured using binning rb i , b i 1 q, i 1, ¤ ¤ ¤ , B and Fourier transforms, j= c ¡1: The n 0 frequency computes integrated rate; each phase-locked feature is complex φ n C.

Scale Space Resampling of RNA to Cell and Tissue Scales
Methods in spatial-transcriptomics which have emerged for localizing and identifying cell-types via marker genes and across different cellular resolutions [4,[29][30][31][32] presents the opportunity of localizing in spatial coordinates the transcriptionally distinct cell-types. Depicted in Figure 4 are the molecular measurements at the micron scales with MERFISH [33] at three different scales. The molecular measures represent RNA locations with sparse RNA features, µ 1 °i I 1 δ xi δ fi , F 1 R 167 . Crossing to cells pY j R 2 q jI partitions into closest particle subsets defined by the distance dpx i , Y j q of particle x i to cell Y j , resampling RNA particles pδ xi , x i R d q iI 1 to the cell centers pδ yj , y j Y j R 2 q jI via indicator functions accumulating to nonsparse mixtures of RNA within the closest cell. The feature is the conditional probability of the 17 cell-type vector F r0, 1s 17 .
Resampling to tissue pδ z k , z k Z k R 2 q kI ¡1 uses normal rescaling. The new feature vector becomes the probability of the cell at any position being one of 10 tissue types F ¡1 r0, 1s 10 . The probability of tissue type is calculated using 10-means clustering on the cell probabilities. The distance for 10-means clustering is computed using the Fisher-Rao metric [34] between the empirical feature laws ν ¡1 z k . The output of 10-means are a partition of feature space t F t F ¡1 giving new features: y k q with 6 9 9 9 9 8 9 9 9 9 7 w ¡1 k °j I w j π σ py j , Z k q,   The measure µ °i w i δ xi δ fi , F tcell typesu crosses to atlas scales using π σ in R 2 of Eqn. (20a) with feature reduction expectations of moments, F tsize, variance,entropyu: The right panels of Figure 5 shows the tissue scale features associated to the cell identity depicting and the entropy. The right panels shows the results of transforming the neuronal cells depicting the cell type (top row) and entropy feature (bottom row). The enropy is a measure of dispersion across the cell identities given by the expectation of the log probability function with zero entropy meaning the space location feature distribution ν x has all its mass on 1 cell type. Geodesic mapping enforces vector field smoothness via differential operators specifying the norms in the RKHS }v } 2 max .   pp1 ¡ pα q 2 ∇ 2 qid d q 2 , with α with F W HM 580µm, 3300µm, for 1, 2 respectively. The varifold norm has σ x 800 µm, 160 µm for the mappings.

Mapping Digital Pathology from Histology to MRI Scales
All of the examples thus far have created the multi-scale data generated using the resampling kernels from the finest scales.
As illustrated in our early figures much of the data is inherently multi-scale, with the measurement technologies generating the coarse scale representations. Shown in Figure 7 is data illustrating our Alzheimer's study of post mortem MR images that are simultaneously collected with amyloid and Tau pathology sections. MR images have a resolution of approximately 100 µm, while pathology images have a resolution of approximately 1 µm. For computational purposes the MRI template and target images were downsampled to 759 and 693 particles, respectively with the tau tangles downsampled to 1038 and 1028 particles, respectively.
We treated every pixel in the MR image as a coarse scale particle with image intensity as its feature value Eqn. (17), and every detected tau tangle as a fine scale particle with a constant feature value, and performed varifold matching to align to neighboring sections. The endpoint representing the two scales is U 1 2° 1,2 }µ temp ¡ µ obs } 2 W ¦ . For each scale norm we use a varifold kernel given by the products of Gaussian distributions with the varifold measure norm Eqn. The top two rows of Figure 7 shows the imaging data for both sections. The bottom row shows the transformed template image at the fine scale. The high resolution mapping carries the kernels across all the scales as indicated by the geodesic equation (14a).
Notice the global motions of the high resolution of the fine particles. Figure 7: Whole brain section showing mapping MRI and histology at the multiple scales. Top two row shows the MRI and Tau histology for two sections with the detected Tau particle superimposed over the MRI (right); bottom row shows the finest scales for the template, middle the template mapped, with the right shows the target; the varifold norm has σ x 4000 µm, 100 µm. The vector field mappings have RKHS norm induced by the differential operator L : pp1 ¡ pα q 2 ∇ 2 qid d q 2 , α giving F W HM 1500 µm, 6400 µm, for 1, 2 respectively.

Discussion
Computational anatomy was originally formulated as a mathematical orbit model for representing medical images at the tissue scales. The model generalizes linear algebra to the group action on images by the diffeomorphism group, a non-linear algebra, but one that inherits a metric structure from the group of diffeomorphisms. The formulation relies on principles of continuity of medical images as classical functions, generalizating optical flow and advection of material to diffeomorphic flow of material, the material represented by the contrast seen in the medical imaging modality such as fiber orientation for diffusion tensor imaging, and or bold contrast for gray matter content. Unifying this representation to images built at the particle and molecular biological scale has required us to move away from classical functions, to the more modern 20th century theory of non-classical generalized functions. Mathematical measures are the proper representation as they generally reflect the property that probes from molecular biology associated to disjoints sets are additive, the basic starting point of measure theory. Changing the model from a focus on groups acting on functions to groups acting on measures allows for a unified representation that has both a metric structure at the finest scales, as well as a unification with the tissue imaging scales. The brain measure formulation, carries with it implicitly the notion of scale-space, i.e. the existence of a sequence of pairs across scales, the measure representation of the brain and the associated scale-space reproducing kernel Hilbert space of functions which correspond to the probing measurement technologies. As such part of the prescription of the theory is a method for crossing scales and carrying information from one scale to the other. Important to this approach is that at every scale we generate a new measure, therefore the recipe of introducing "measure norms" built from RKHS's for measuring brain disparity is universal across the hierarchy allowing us to work simultaneously with common data structures and a common formalism. Interestingly, the measure norms do not require identical particle numbers across brains in brain space at the molecular scales.
The key modelling element of brain function is that the conditional feature probability is manipulated from the quantized features to the stochastic laws. These are the analogues of the Boltzman distributions generalized to the complex feature spaces representing function. As they correspond to arbitary feature spaces not necessarily Newtonian particles, we represent them simply as empirical distributions on the feature space, with the empirical measure constructed from the collapse of the fine scale to the resampled coarse scale. To model rescaling through scale-space explicitly, the two kernel transformation are used allowing us to retrieve the empirical averages represented by the determinism of the stochastic law consistent with our views of the macro tissue scales. This solves the dilemna that for the quantized atomic and micro scales cell occurence will never repeat, i.e. there is zero probability of finding a particular cell at a particular location, and conditioned on finding it once it will never be found again in the exact same location in another preparation. The properties that are stable are the probability laws with associated statistics that may transfer across organisms and species.
Importantly, our introduction of the |dϕpxq| term in the action enables the crucial property that when a tissue is extended to a larger area, the total number of its basic constituents should increase accordingly and not be conserved. This is not traditional measure transport which is mass preserving which is not a desirable feature for biological samples. Rather we have defined a new action on measures that is reminiscent of the action on d-dimensonal varifolds [35,36]. We call this property "copy and paste", the notion being that the brain is built on basic structuring elements that are conserved.
Successive refinement for the small deformation setting has been introduced in many areas associated to multigrid and basis expansions. The notion of building multi-scale representation in the large deformation LDDMM setting was originally explored F. Riesser et al. [37] in which the kernels are represented as a sum of kernels and Sommer et al. [38] in which the kernel is represented as vector bundles. In their multi-scale setting there is a post-optimization decomposition in which the contribution of the velocity field into its different components can then each be integrated. In that multi-scale setting the basic Euler-Lagrange equation termed EPDIFF remains that of LDDMM [39] . In the setting proposed here we separate the scales before optimisation via the hierarchy of layered diffeomorphisms and use a multi-scale representation of the brain hierarchy itself which is directly associated to the differomorphism at that scale. This gives the fundamental setting of the product group of diffeomorphisms with the Euler-Lagrange equation corresponding to the sequence of layered diffeomorphisms for multi-scale LDDMM [24].
The aggregation across scales from particle to tissue scales on lattices provides the essential link to inference on graphs It is natural for these aggregated features with associated conditional probability laws to become the nodes in Markov random field modelling for spatial inference; see examples in spatial transcriptomics and tissue segmentation [40]. Building neighborhood relations as conditional probabilities between lattice sites from which global probabilites laws are constructed with the Hammersley-Clifford theorem links us to Grenander's metric pattern theory formalisms with the atoms and conditional laws px i , µ xi q iI at any scale playing the roles of the generators.

Experimental and Technical Design
The objective of this research is to unify the molecular representations of spatial transcriptomics and cellular scale histology with the tissue scales of Computational Anatomy for brain mapping. To accomplish this we designed a mathematical framework for representing data at multiple scales using generalized functions, and mapping data using geodesic flows of multiple diffeomorphisms.
We illustrate the method using several examples from human MRI and digital pathology, as well as mouse spatial transcriptomics.

Computational Lattices for Interpolating Brain Measures
We use computational lattices pY j R d q jI , 0,1,... to interpolate µ °i I w i δ xi δ fi onto µ at scale . Then πpx, Y j q is chosen to share its probability concentrated to the lattice cell centers y j Y j : k 1 ppx, f q, ¤q ¸j I πpx, Y j q δ yj δ f p¤q µ p¤q ¸j I w j k 2 ppy j , ν yj q, ¤q ¸j I w j δ yj δ φpνy j q p¤q (21) with 6 9 8 9 7

Gaussian Kernel Varifold Norm
Our varifold norm construction models the measures as elements of a Hilbert space W ¦ which is dual to an RKHS W with a kernel K W . We introduce the dual bracket notation for h W, µ W ¦ , pµ | h q ³ R d ¢F µpdx, df qhpx, f q. The norms are generated by integrating against the kernel according to (10) written with the dual bracket }µ} 2 W ¦ : pµ | K W rµsq; the multi-scale norm is given by }µ} 2 To ensure the brain measures are elements of W ¦ dual to the RKHS W , the kernel K W is chosen to densely and continuously embed in bounded continuous functions C b pR d ¢F, Rq so that the signed measure spaces M s pR d ¢Fq of brains are continuously embedded in the dual spaces C b pR d ¢ F, Rq ¦ . An example is the Gaussian kernel (22) which satisfies this condition, the kernel taken as separable Gaussians with | ¤ | Euclidean distance: For measures µ a °i I w a For data carrying position information but no feature values (such as tau tangle locations), each f i , f j is constant and the resulting exponential terms are all 1.

The Riemannian Distance Metric on the Hierarchical Group
The diffeomorphism group acts on the hierarchy ϕ ¤ µ component-wise Eqn. (7b) with the multi-scale group the product with elements ϕ G k satisfying the law of composition component-wise ϕ ¥ ϕ I pϕ ¥ ϕ I q max . The group G k supporting k¡derivatives of the diffeomorphisms builds from C k 0 pR d , R d q a space of k-times continuously differentiable vector fields vanishing at infinity and its partial derivatives of order p ¤ k intersecting with diffeomorphisms with 1-derivative: Dynamics occurs via group action generated as a dynamical system in which the multi-scale control t Þ Ñ u t : pu t q max flows the hierarchy t Þ Ñ ϕ t satisfying 9 ϕ t u t ¥ ϕ t of (8a). The control is in the product V ± max V , each space an RKHS V selected to control the smoothness of the vector fields. The hierarchy of spaces are organized as a sequence of continuous embeddings: where V max is an additional layer containing the others with V max C m 0 pR d , R d q defined as a space of m-times continuously differentiable vector fields vanishing at infinity as well all its partial derivatives of order p ¤ m.
The hierarchy is connected via successive refinements u u ¡1 v , u 0 v 0 expressed via the continuous linear operator A : V Ñ V with v Au. The control process pu t q 0¤t¤1 L 2 pr0, 1s, V q has finite square-integral with total energy Optimal curves which minimize the integrated energy E A between any two fixed boundary conditions (BC) ϕ 0 Id and ϕ 1 which is accessible with a path of finite energy extends the LDDMM setting [23] to a hierarchy of diffeomorphisms and describes a geodesic for an associated Riemannian metric and multi-scale LDDMM [24] on G k : d G k pId, ϕ 1 q 2 : min putq0¤t¤1L 2 pr0,1s,V q: 9 ϕtut¥ϕt,with BC ϕ0Id,ϕ1 Existence of solutions for minimizers over u of (23) when d G k pId, ϕ 1 q is finite can be established when m ¥ k ¥ 1.

Geodesic Multi-Scale LDDMM via Hamiltonian Control
The Hamiltonian method reduces the parameterization of the vector field to the dynamics of the particles that encode the flow of states (12). We write the dynamics explicitly as a linear function of the control, which defines the flow of the measures: 9q t ξ qt pu t q : pξ q t pu t qq max , with 9 q t ξ qt pu t q : pu t px i,t q, w i,t divu t px i,t qq iI ; µpq t q : pµpq t qq max , µpq t q :i I w i,t δ xi,t δ fi .

Gradients of the Endpoint Varifold Matching Norm
The gradients of (14c) are efficiently rewritten using the state q t px i,t , w i,t q iI to define the norm-square in terms of h q continuously differentiable in x and bounded C 1,0 b giving the smooth endpoint term determining the smooth gradients: h q1 py, zq : αK W rµpq 1 q ¡ µ obs spy, zq, py, zq R d ¢ F .
We take the variation d dε U pqpεqq| ε0 varying each term q 1 pεq px i,1 εψ x i , w i,1 εψ w i q iI with dependence on -scale implied.
These represent the gradients of (14c).
The tissue continuum has µ ³ R d ρ c pxqδ x µ x dx with µpq t q ³ R d w t pxqρ c pxqδ ϕtpxq µ x dx and q t : pϕ t , w t w 0 |dϕ t |q.
The average of h q1 over the feature space determines the boundary term variation.
v pεq v εψ u for ψ u V . We have d dε £ p § § ξ q pu pεqq¨¡ 1 2 1 j L j v j pεq § § v j pεq¨ |ε0 (34) i I ¡ xp x, i , ψ u px i qy p w, i w i pdiv ψ u qpx i q