# Diffeomorphometry

Diffeomorphometry is the metric study of imagery, shape and form in the discipline of computational anatomy (CA) in medical imaging. The study of images in computational anatomy rely on high-dimensional diffeomorphism groups $\varphi \in \operatorname {Diff} _{V}$ which generate orbits of the form ${\mathcal {I}}\doteq \{\varphi \cdot I\mid \varphi \in \operatorname {Diff} _{V}\}$, in which images $I\in {\mathcal {I}}$ can be dense scalar magnetic resonance or computed axial tomography images. For deformable shapes these are the collection of manifolds ${\mathcal {M}}\doteq \{\varphi \cdot M\mid \varphi \in \operatorname {Diff} _{V}\}$, points, curves and surfaces. The diffeomorphisms move the images and shapes through the orbit according to $(\varphi ,I)\mapsto \varphi \cdot I$ which are defined as the group actions of computational anatomy.
The orbit of shapes and forms is made into a metric space by inducing a metric on the group of diffeomorphisms. The study of metrics on groups of diffeomorphisms and the study of metrics between manifolds and surfaces has been an area of significant investigation. In Computational anatomy, the diffeomorphometry metric measures how close and far two shapes or images are from each other. Informally, the metric is constructed by defining a flow of diffeomorphisms ${\dot {\phi }}_{t},t\in [0,1],\phi _{t}\in \operatorname {Diff} _{V}$ which connect the group elements from one to another, so for $\varphi ,\psi \in \operatorname {Diff} _{V}$ then $\phi _{0}=\varphi ,\phi _{1}=\psi$. The metric between two coordinate systems or diffeomorphisms is then the shortest length or geodesic flow connecting them. The metric on the space associated to the geodesics is given by$\rho (\varphi ,\psi )=\inf _{\phi :\phi _{0}=\varphi ,\phi _{1}=\psi }\int _{0}^{1}\|{\dot {\phi }}_{t}\|_{\phi _{t}}\,dt$. The metrics on the orbits ${\mathcal {I}},{\mathcal {M}}$ are inherited from the metric induced on the diffeomorphism group.
The group $\varphi \in \operatorname {Diff} _{V}$ is thusly made into a smooth Riemannian manifold with Riemannian metric $\|\cdot \|_{\varphi }$ associated to the tangent spaces at all $\varphi \in \operatorname {Diff} _{V}$. The Riemannian metric satisfies at every point of the manifold $\phi \in \operatorname {Diff} _{V}$ there is an inner product inducing the norm on the tangent space $\|{\dot {\phi }}_{t}\|_{\phi _{t}}$ that varies smoothly across $\operatorname {Diff} _{V}$.
Oftentimes, the familiar Euclidean metric is not directly applicable because the patterns of shapes and images don't form a vector space. In the Riemannian orbit model of Computational anatomy, diffeomorphisms acting on the forms $\varphi \cdot I\in {\mathcal {I}},\varphi \in \operatorname {Diff} _{V},M\in {\mathcal {M}}$ don't act linearly. There are many ways to define metrics, and for the sets associated to shapes the Hausdorff metric is another. The method used to induce the Riemannian metric is to induce the metric on the orbit of shapes by defining it in terms of the metric length between diffeomorphic coordinate system transformations of the flows. Measuring the lengths of the geodesic flow between coordinates systems in the orbit of shapes is called diffeomorphometry.

## The diffeomorphisms group generated as Lagrangian and Eulerian flows

The diffeomorphisms in computational anatomy are generated to satisfy the Lagrangian and Eulerian specification of the flow fields, $\varphi _{t},t\in [0,1]$, generated via the ordinary differential equation
| ${\frac {d}{dt}}\varphi _{t}=v_{t}\circ \varphi _{t},\ \varphi _{0}=\operatorname {id} ;$ | (Lagrangian flow) |
with the Eulerian vector fields $v\doteq (v_{1},v_{2},v_{3})$ in ${\mathbb {R} }^{3}$ for $v_{t}={\dot {\varphi }}_{t}\circ \varphi _{t}^{-1},t\in [0,1]$. The inverse for the flow is given by ${\frac {d}{dt}}\varphi _{t}^{-1}=-(D\varphi _{t}^{-1})v_{t},\ \varphi _{0}^{-1}=\operatorname {id} ,$ and the $3\times 3$ Jacobian matrix for flows in $\mathbb {R} ^{3}$ given as $\ D\varphi \doteq \left({\frac {\partial \varphi _{i}}{\partial x_{j}}}\right).$
To ensure smooth flows of diffeomorphisms with inverse, the vector fields ${\mathbb {R} }^{3}$ must be at least 1-time continuously differentiable in space which are modelled as elements of the Hilbert space $(V,\|\cdot \|_{V})$ using the Sobolev embedding theorems so that each element $v_{i}\in H_{0}^{3},i=1,2,3,$ has 3-square-integrable derivatives thusly implies $(V,\|\cdot \|_{V})$ embeds smoothly in 1-time continuously differentiable functions. The diffeomorphism group are flows with vector fields absolutely integrable in Sobolev norm:
| $\operatorname {Diff} _{V}\doteq \{\varphi =\varphi _{1}:{\dot {\varphi }}_{t}=v_{t}\circ \varphi _{t},\varphi _{0}=\operatorname {id} ,\int _{0}^{1}\|v_{t}\|_{V}\,dt<\infty \}\ .$ | (Diffeomorphism Group) |

## The Riemannian orbit model

Shapes in Computational Anatomy (CA) are studied via the use of diffeomorphic mapping for establishing correspondences between anatomical coordinate systems. In this setting, 3-dimensional medical images are modelled as diffeomorphic transformations of some exemplar, termed the template $I_{temp}$, resulting in the observed images to be elements of the random orbit model of CA. For images these are defined as $I\in {\mathcal {I}}\doteq \{I=I_{temp}\circ \varphi ,\varphi \in \operatorname {Diff} _{V}\}$, with for charts representing sub-manifolds denoted as ${\mathcal {M}}\doteq \{\varphi \cdot M_{temp}:\varphi \in \operatorname {Diff} _{V}\}$.

### The Riemannian metric

The orbit of shapes and forms in Computational Anatomy are generated by the group action ${\mathcal {I}}\doteq \{\varphi \cdot I:\varphi \in \operatorname {Diff} _{V}\}$ , ${\mathcal {M}}\doteq \{\varphi \cdot M:\varphi \in \operatorname {Diff} _{V}\}$. These are made into a Riemannian orbits by introducing a metric associated to each point and associated tangent space. For this a metric is defined on the group which induces the metric on the orbit. Take as the metric for Computational anatomy at each element of the tangent space $\varphi \in \operatorname {Diff} _{V}$ in the group of diffeomorphisms
    $\|{\dot {\varphi }}\|_{\varphi }\doteq \|{\dot {\varphi }}\circ \varphi ^{-1}\|_{V}=\|v\|_{V},$
with the vector fields modelled to be in a Hilbert space with the norm in the Hilbert space $(V,\|\cdot \|_{V})$. We model $V$ as a reproducing kernel Hilbert space (RKHS) defined by a 1-1, differential operator $A:V\rightarrow V^{*}$, where $V^{*}$ is the dual-space. In general, $\sigma \doteq Av\in V^{*}$ is a generalized function or distribution, the linear form associated to the inner-product and norm for generalized functions are interpreted by integration by parts according to for $v,w\in V$,
    $\langle v,w\rangle _{V}\doteq \int _{X}Av\cdot w\,dx,\ \|v\|_{V}^{2}\doteq \int _{X}Av\cdot v\,dx,\ v,w\in V\ .$
When $Av\doteq \mu \,dx$, a vector density, $\int Av\cdot v\,dx\doteq \int \mu \cdot v\,dx=\sum _{i=1}^{3}\mu _{i}v_{i}\,dx.$
The differential operator is selected so that the Green's kernel associated to the inverse is sufficiently smooth so that the vector fields support 1-continuous derivative. The Sobolev embedding theorem arguments were made in demonstrating that 1-continuous derivative is required for smooth flows. The Green's operator generated from the Green's function(scalar case) associated to the differential operator smooths.
For proper choice of $A$ then $(V,\|\cdot \|_{V})$ is an RKHS with the operator $K=A^{-1}:V^{*}\rightarrow V$. The Green's kernels associated to the differential operator smooths since for controlling enough derivatives in the square-integral sense the kernel $k(\cdot ,\cdot )$ is continuously differentiable in both variables implying
    $KAv(x)_{i}\doteq \sum _{j}\int _{{\mathbb {R} }^{3}}k_{ij}(x,y)Av_{j}(y)\,dy\in V\ .$

## The diffeomorphometry of the space of shapes and forms
### The right-invariant metric on diffeomorphisms

The metric on the group of diffeomorphisms is defined by the distance as defined on pairs of elements in the group of diffeomorphisms according to
| $d_{\mathrm {Diff} _{V}}(\psi ,\varphi )=\inf _{v_{t}}\left(\int _{0}^{1}\int _{X}Av_{t}\cdot v_{t}\,dx\,dt:\phi _{0}=\psi ,\phi _{1}=\varphi ,{\dot {\phi }}_{t}=v_{t}\circ \phi _{t}\right)^{1/2}\ .$ | (metric-diffeomorphisms) |
This distance provides a right-invariant metric of diffeomorphometry, invariant to reparameterization of space since for all $\phi \in \operatorname {Diff} _{V}$,
    $d_{\operatorname {Diff} _{V}}(\psi ,\varphi )=d_{\operatorname {Diff} _{V}}(\psi \circ \phi ,\varphi \circ \phi ).$

### The metric on shapes and forms

The distance on images, $d_{\mathcal {I}}:{\mathcal {I}}\times {\mathcal {I}}\rightarrow \mathbb {R} ^{+}$,
| $d_{\mathcal {I}}(I,J)=\inf _{\phi \in \operatorname {Diff} _{V}:\phi \cdot I=J}d_{\operatorname {Diff} _{V}}(id,\phi )\ ;$ | (metric-shapes-forms) |
The distance on shapes and forms, $d_{\mathcal {M}}:{\mathcal {M}}\times {\mathcal {M}}\rightarrow \mathbb {R} ^{+}$,
| $d_{\mathcal {M}}(M,N)=\inf _{\phi \in \operatorname {Diff} _{V}:\phi \cdot M=N}d_{\mathrm {Diff} _{V}}(\operatorname {id} ,\phi )\ .$ | (metric-shapes-forms) |

## The metric on geodesic flows of landmarks, surfaces, and volumes within the orbit

For calculating the metric, the geodesics are a dynamical system, the flow of coordinates $t\mapsto \phi _{t}\in \operatorname {Diff} _{V}$ and the control the vector field $t\mapsto v_{t}\in V$ related via ${\dot {\phi }}_{t}=v_{t}\cdot \phi _{t},\phi _{0}=\operatorname {id} .$ The Hamiltonian view
reparameterizes the momentum distribution $Av\in V^{*}$ in terms of the Hamiltonian momentum, a Lagrange multiplier $p:{\dot {\phi }}\mapsto (p\mid {\dot {\phi }})$ constraining the Lagrangian velocity ${\dot {\phi }}_{t}=v_{t}\circ \phi _{t}$.accordingly:
    $H(\phi _{t},p_{t},v_{t})=\int _{X}p_{t}\cdot (v_{t}\circ \phi _{t})\,dx-{\frac {1}{2}}\int _{X}Av_{t}\cdot v_{t}\,dx.$
The Pontryagin maximum principle gives the Hamiltonian $H(\phi _{t},p_{t})\doteq \max _{v}H(\phi _{t},p_{t},v)\ .$ The optimizing vector field $v_{t}\doteq \operatorname {argmax} _{v}H(\phi _{t},p_{t},v)$ with dynamics ${\dot {\phi }}_{t}={\frac {\partial H(\phi _{t},p_{t})}{\partial p}},{\dot {p}}_{t}=-{\frac {\partial H(\phi _{t},p_{t})}{\partial \phi }}$. Along the geodesic the Hamiltonian is constant: $H(\phi _{t},p_{t})=H(\operatorname {id} ,p_{0})={\frac {1}{2}}\int _{X}p_{0}\cdot v_{0}\,dx$. The metric distance between coordinate systems connected via the geodesic determined by the induced distance between identity and group element:
    $d_{\mathrm {Diff} _{V}}(\operatorname {id} ,\varphi )=\|v_{0}\|_{V}={\sqrt {2H(\operatorname {id} ,p_{0})}}$

### Landmark or pointset geodesics

For landmarks, $x_{i},i=1,\dots ,n$, the Hamiltonian momentum
    $p(i),i=1,\dots ,n$
with Hamiltonian dynamics taking the form
    $H(\phi _{t},p_{t})={\frac {1}{2}}\textstyle \sum _{j}\sum _{i}\displaystyle p_{t}(i)\cdot K(\phi _{t}(x_{i}),\phi _{t}(x_{j}))p_{t}(j)$
with
    ${\begin{cases}v_{t}=\textstyle \sum _{i}\displaystyle K(\cdot ,\phi _{t}(x_{i}))p_{t}(i),\ \\{\dot {p}}_{t}(i)=-(Dv_{t})_{|_{\phi _{t}(x_{i})}}^{T}p_{t}(i),i=1,2,\dots ,n\\\end{cases}}$
The metric between landmarks $d^{2}=\textstyle \sum _{i}p_{0}(i)\cdot \sum _{j}\displaystyle K(x_{i},x_{j})p_{0}(j).$
The dynamics associated to these geodesics is shown in the accompanying figure.

### Surface geodesics

For surfaces, the Hamiltonian momentum is defined across the surface has Hamiltonian
    $H(\phi _{t},p_{t})={\frac {1}{2}}\int _{U}\int _{U}p_{t}(u)\cdot K(\phi _{t}(m(u)),\phi _{t}(m(v)))p_{t}(v)\,du\,dv$
and dynamics
    ${\begin{cases}v_{t}=\textstyle \int _{U}\displaystyle K(\cdot ,\phi _{t}(m(u)))p_{t}(u)\,du\ ,\\{\dot {p}}_{t}(u)=-(Dv_{t})_{|_{\phi _{t}(m(u))}}^{T}p_{t}(u),u\in U\end{cases}}$
    The metric between surface coordinates $d^{2}=(p_{0}\mid v_{0})=\int _{U}p_{0}(u)\cdot \int _{U}K(m(u),m(u^{\prime }))p_{0}(u^{\prime })\,du\,du^{\prime }$

### Volume geodesics

For volumes the Hamiltonian
    $H(\phi _{t},p_{t})={\frac {1}{2}}\int _{{\mathbb {R} }^{3}}\int _{{\mathbb {R} }^{3}}p_{t}(x)\cdot K(\phi _{t}(x),\phi _{t}(y))p_{t}(y)\,dx\,dy\displaystyle$
with dynamics
    ${\begin{cases}v_{t}=\textstyle \int _{X}\displaystyle K(\cdot ,\phi _{t}(x))p_{t}(x)\,dx\ ,\\{\dot {p}}_{t}(x)=-(Dv_{t})_{|_{\phi _{t}(x)}}^{T}p_{t}(x),x\in {\mathbb {R} }^{3}\end{cases}}$
    The metric between volumes $\displaystyle d^{2}=(p_{0}\mid v_{0})=\int _{\mathbb {R} ^{3}}p_{0}(x)\cdot \int _{{\mathbb {R} }^{3}}K(x,y)p_{0}(y)\,dy\,dx.$

## Software for diffeomorphic mapping

Software suites containing a variety of diffeomorphic mapping algorithms include the following:
* Deformetrica
* ANTS
* DARTEL Voxel-based morphometry(VBM)
* DEMONS
* LDDMM
* StationaryLDDMM

### Cloud software

* MRICloud