User:Mim.cis/sandbox/Derivation of Landmark LDDMM Conditions



A diffeomorphic mapping system is a system designed to map, manipulate, and transfer information which is stored in many types of spatially distributed medical imagery.

Diffeomorphic mapping is the underlying technology for mapping and analyzing information measured in human anatomical coordinate systems which have been measured via Medical imaging. Diffeomorphic mapping is a broad term that actually refers to a number of different algorithms, processes, and methods. It is attached to many operations and has many applications for analysis and visualization. Diffeomorphic mapping can be used to relate various sources of information which are indexed as a function of spatial postiion as the key index variable. Diffeomorphisms are by their latin root structure preserving transformations, which are in turn differentiable and therefore smooth, allowing for the calculation of metric based quantities such as arc length and surface areas. Spatial location and extents in human anatomical coordinate systems can be recorded via a variety of Medical imaging modalities, generally termed multi-modal medical imagery, providing either scalar and or vector quantities at each spatial location. Examples are scalar T1 or T2 Magnetic resonance imagery, or as 3x3 diffusion tensor matrices Diffusion MRI and Diffusion-weighted imaging, to scalar densities associated to Computed Tomography (CT),or functional imagery such as temporal data of functional magnetic resonance imaging and scalar densities such as Positron emission tomography (PET).

The acronym LDDMM, standing for large deformation diffeomorphic metric mapping is often used to refer to a specific suite of algorithms used for diffeomorphic mapping and manipulating dense imagery based on  diffeomorphic metric mapping within the academic discipline of Computational anatomy, to be distinguised from it's precursor based on diffeomorphic mapping. The distinction between the two is that diffeomorphic metric maps satisfy the property that the length associated to their flow away from the identity induces a metric on the group of diffeomorphisms, which in turn induces a metric on the orbit of Shapes and Forms within the field of Computational Anatomy. The study of shapes and forms with the metric of diffeomorphic metric mapping is called Diffeomorphometry.

Computational anatomy is a subdiscipline within the broader field of Neuroinformatics within Bioinformatics and Medical imaging. The first algorithm for dense image mapping via diffeomorphic metric mapping was Beg's LDDMM for volumes and Joshi's landmark matching for point sets with correspondence, with LDDMM algorithms now available for computing diffeomorphic metric maps between non-corresponding landmarks and landmark matching intrinsic to spherical manifolds, curves, currents and surfaces,  tensors, varifolds, and time-series. The term LDDMM was first established as part of the National Institutes of Health supported Biomedical Informatics Research Network.

In a more general sense, diffeomorphic mapping is a term that describes any solution that registers or builds correspondences between dense coordinate systems in Medical imaging by ensuring the solutions are diffeomorphic. There are now many codes organized around diffeomorphic registration including ANTS, DARTEL, DEMONS, StationaryLDDMM as examples of actively used computational codes for constructing correspondences between coordinate systems based on dense images.

The distinction between diffeomorphic metric mapping forming the basis for LDDMM and the earliest methods of diffeomorphic mapping is the introduction of a Hamilton principle of least-action in which large deformations are selected of shortest length corresponding to geodesic flows. The lengths of these geodesics form the metric; diffeomorphic mapping in general does not correspond to any metric formulation.

History of Development
Diffeomorphic mapping 3-dimensional information across coordinate systems is central to high-resolution Medical imaging and the area of Neuroinformatics within the newly emerging field of bioinformatics. Diffeomorphic ma pping 3-dimensional coordinate systems as measured via high resolution dense imagery has a long history in 3-D beginning with Computed Axial Tomography (CAT scanning) in the early 80's by the University of Pennsylvania group led by Ruzena Bajcsy, and subsequently the Ulf Grenander school at Brown University with the HAND experiments. In the 90's there were several solutions for image registration which were associated to linearizations of small deformation and non-linear elasticity.

The central focus of the sub-field of Computational anatomy (CA) within medical imaging is mapping information across anatomical coordinate systems at the 1 millimeter morphome scale. In CA mapping of dense information measured within Magnetic resonance image (MRI) based coordinate systems such as in the brain has been solved via inexact matching of 3D MR images one onto the other. The earliest introduction of the use of diffeomorphic mapping via large deformation flows of diffeomorphisms for transformation of coordinate systems in image analysis and medical imaging was by Christensen et. al. and Trouve. The introduction of flows, which are akin to the equations of motion used in fluid dynamics, exploit the notion that dense coordinates in image analysis follow the Lagrangian and Eulerian equations of motion. This model becomes more appropriate for cross-sectional studies in which brains and or hearts are not necessarily deformations of one to the other. Methods based on linear or non-linear elasticity energetics which grows with distance from the identity mapping of the template, is not appropriate for cross-sectional study. Rather, in models based on Lagrangian and Eulerian flows of diffeomorphisms, the constraint is associated to topological properties, such as open sets being preserved, coordinates not crossing implying uniqueness and existence of the inverse mapping, and connected sets remaining connected. The use of diffeomorphic methods grew quickly to dominate the field of mapping methods post Christensen's original paper, with fast and symmetric methods becoming available.

Such methods are powerful in that they introduce notions of regularity of the solutions so that they can be differentiated and local inverses can be calculated. The disadvantages of these methods is that there was no associated global least-action property which could score the flows of minimum energy. This contrasts the geodesic motions which are central to the study of Rigid body kinematics and the many problems solved in Physics via Hamilton's principle of least action. In 1998, Dupuis, Grenander and Miller established the conditions for guaranteeing the existence of solutions for dense image matching in the space of flows of diffeomorphisms. These conditions require an action penalizing kinetic energy measured via the Sobolev norm on spatial derivatives of the flow of vector fields.

The Large Deformation Diffeomorphic Metric Mapping (LDDMM) code that Faisal Beg derived and implemented for his PhD at Johns Hopkins University developed the earliest algorithmic code which solved for flows with fixed points satisfying the necessary conditions for the dense image matching problem subject to least-action. Computational anatomy now has many existing codes organized around diffeomorphic registration including ANTS, DARTEL, DEMONS, LDDMM, StationaryLDDMM as examples of actively used computational codes for constructing correspondences between coordinate systems based on dense images.

These large deformation methods have been extended to landmarks without registration via measure matching, curves, surfaces, dense vector and tensor imagery, and varifolds removing orientation.

The Diffeomorphism Orbit Model in Computational Anatomy
Deformable shape in Computational Anatomy (CA)   is studied via the use of diffeomorphic mapping for establishing correspondences between anatomical coordinates in Medical Imaging. In this setting, three dimensional medical images are modelled as a random deformation of some exemplar, termed the template $$ I_{temp} $$, with the set of observed images element in the random orbit model of CA for images $$ I \in \mathcal {I} \doteq \{ I = I_{temp} \circ \varphi, \varphi \in Diff_V \} $$. The template is mapped onto the target by defining a variational problem in which the template is transformed via the diffeomorphism used as a change of coordinate to minimize a squared-error matching condition between the transformed template and the target.

The diffeomorphisms are generated via smooth flows $$\phi_t,  t \in [0,1]$$, with $$\varphi \doteq \phi_1$$, satisfying the Lagrangian and Eulerian specification of the flow field associated to the ordinary differential equation,

\frac{d}{dt} \phi_t = v_t \circ \phi_t, \ \phi_0 = id $$, with $$ v_t, t \in [0,1] $$ the Eulerian vector fields determining the flow. The vector fields are guaranteed to be 1-time continuously differentiable $$ v_t \in C^1 $$ by modelling them to be in a smooth Hilbert space $$v \in V$$ supporting 1-continuous derivative. The inverse $$ \phi_t^{-1}, t \in [0,1] $$ is defined by the Eulerian vector-field with flow given by

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. Thus $$(V, \| \cdot \|_V )$$ embeds smoothly in 1-time continuously differentiable functions. The diffeomorphism group are flows with vector fields absolutely integrable in Sobolev norm

In CA the space of vector fields $$(V, \| \cdot \|_V )$$ are modelled as a reproducing Kernel Hilbert space (RKHS) defined by a 1-1, differential operator$$ A: V \rightarrow V^* $$ determining the norm $$  \| v\|_V^2 \doteq (Av|v), \ v \in V \. $$ The differential operator is selected so that the Green's kernel the inverse of the operator is continuously differentiable in each variable implying that the vector fields support 1-continuous derivative; see for the necessary conditions on the norm for existence of solutions.

Beg's LDDMM algorithm for image matching
The original large deformation diffeomorphic metric mapping (LDDMM) algorithms of Beg, Miller, Trouve, Younes was derived taking variations with respect to the vector field parameterization of the group, since $$ v = \dot \phi \circ \phi^{-1} $$ are in a vector spaces. Variations satisfy the necessary optimality conditions. Beg solved the Control Problem for dense image matching mnimizing endpoint matching term $$E (\phi_1) \doteq \frac{1}{2} \| I \circ \phi_1^{-1} - J\|^2$$ simultaneously minimizing the action integral of kinetic energy $$ \int_0^1 \| v_t \|_V^2 dt $$, using the vector fields $$v_t, t \in [0,1]$$ via the following iterative algorithm optimization problem and iteration. Update until convergence, $$ \phi_t^{old} \leftarrow \phi_t^{new} $$ each iteration, with $$\phi_{t1} \doteq \phi_1 \circ \phi_t^{-1}$$: This implies that the fixed point at $$ t=0 $$ satisfies $$ \mu_0^*=Av_0^* = (I -J \circ \phi_1^* ) \nabla I | D\phi_1^*| $$, which in turn implies it satisfies the Conservation equation given by the $$ according to $$Av_t^* = (D \phi_t^{*-1})^T Av_0^* \circ \phi_t^{*-1}|D \phi_t^{*-1}|$$

Joshi's original LDDMM landmark matching
The landmark matching problem has endpoint $$ \frac{1}{2} \sum_i \| \phi_1(x_i)-y_i \|^2 $$ was solved originally corresponding to the following:
 * $$ \min_{v:\dot \phi_t= v_t \circ \phi_t} C(v) \doteq \frac{1}{2} \int

\|v_t\|^2_Vdt +\frac{1}{2} \sum_i \| \phi_1(x_i)-y_i \|^2 $$;

Update until convergence, $$ \phi_t^{old} \leftarrow \phi_t^{new} $$ each iteration, with $$\phi_{t1} \doteq \phi_1 \circ \phi_t^{-1}$$:

with necessary conditions become      $$Av_t = -\sum_i  (D \phi_{t1})^T|_{\phi_t(x_i)} (y_i-\phi_1(x_i))\delta_{\phi_t(x_i)}$$.





Proof of Gradient and Necesssary Maximizer Conditions
The Calculus of variations was used in Beg[49] to derive the iterative algorithm as a solution which when it converges satisfies the necessary maximizer conditions given by the  necessary conditions for a first order variation. This also gives the update rule for the gradient algorithm requiring the variation of the endpoint with respect to a first order variation of the vector field. We do this by calculating the directional derivative calculating the Gâteaux derivative. These variations were calculated iin Beg's original paper[49]  as well as in.

Taking the first order variation in the vector fields $$v+\epsilon \delta v$$ using the chain rule requires the computation of three variations. The variation of $$\phi^{-1}$$ generalizes the matrix perturbation of the inverse  via $$(\phi + \epsilon \delta \phi \circ \phi)\circ (\phi^{-1} + \epsilon \delta \phi^{-1} \circ \phi^{-1}) = id + o(\epsilon)$$ giving  $$\delta \phi^{-1} \circ \phi^{-1} =-(D \phi_1^{-1}) \delta \phi  $$.

To express the variation in terms of $$ \delta v $$, use $$ \delta \phi_1 = (D \phi_1)_{|\phi_1^{-1}} \int_0^1 (D \phi_t)_{|\phi_1^{-1}}^{-1} (\delta v_t )_{\phi_t \circ \phi_1^{-1} } dt $$ solving Lie bracket $$\frac{d }{d t} \left( \delta \phi_{|\phi} \right) = (Dv)_{| \phi} \delta \phi_{| \phi} + \delta v_{| \phi}$$. i:.

This gives

\frac{d}{d \epsilon} \frac{1}{2} \int_X | I \circ ( \phi^{-1} + \epsilon \delta \phi^{-1} \circ \phi^{-1})-J|^2 dx|_{\epsilon =0} =\int_X (I \circ \phi^{-1} -J ) \nabla I|_{\phi^{-1}} \delta \phi^{-1} \circ \phi^{-1} dx $$$$ = \int_X (I \circ \phi^{-1} -J ) \nabla I|_{\phi^{-1}} (-D \phi_1^{-1}) \delta \phi dx $$
 * $$ =\int_X(I \circ \phi_1^{-1} -J) \nabla I|_{\phi_1^{-1}} (- D \phi_1)_{|\phi_1^{-1}}^{-1}(D \phi_1)_{|\phi_1^{-1}}) \int_0^1 (D \phi_t)_{|\phi_1^{-1}}^{-1} (\delta v_t)_{|{\phi_t \circ \phi_1^{-1}}} dt dx

$$. Taking the Gâteaux variation substituting $$ \phi_{t1} \doteq \phi_1 \circ \phi_t^{-1} $$ gives the necessary condition for an optimum:

\frac{d}{d \epsilon}C(v +\epsilon\delta v)|_{\epsilon=0} = \int_0^1 \int_X Av_t \cdot \delta v_t dx dt -\int_0^1 \int_X (I \circ \phi_1^{-1} -J) \nabla I|_{\phi_1^{-1}}(D \phi_t)_{|\phi_1^{-1}}^{-1} (\delta v_t)_{|{\phi_t \circ \phi_1^{-1}}} dx dt $$



\ \ \ \ \ \ \ \ = \int_0^1 \int_X \left( Av_t - (I \circ \phi_t^{-1} -J \circ \phi_{t1}) \nabla I|_{\phi_t^{-1}}(D \phi_t)_{|\phi_t^{-1}}^{-1} |D \phi_{t1}| \right) \cdot \delta v_t dxdt = 0 $$.

The perturbation in the vector field gives $$ (\delta \phi_1)_{|{\phi_1}} = (D \phi_1) \int_0^1 (D \phi_t)^{-1} \delta v_t \circ \phi_t dt $$ Take the variation in the vector fields $$v+\epsilon \delta v$$ using the chain rule $$ \frac{\partial E(\phi_1)}{\partial v}=\frac{\partial E(\phi_1)}{\partial \phi} \frac{\partial \phi_1}{\partial v} $$ which gives the first variation


 * $$ \frac{d}{d \epsilon}C(v +\epsilon\delta v)|_{\epsilon=0}=\sum_i (\phi_1(x_i) - y_i) \cdot D \phi_1 |_{\phi_1^{-1}(\phi_1(x_i))} \int_0^1 (D \phi_t)_{|\phi_1^{-1}(\phi_1(x_i))}^{-1} \delta v_t |_{\phi_t \circ \phi_1^{-1} (\phi_1(x_i))} dt

$$


 * $$ =\int_0^1 \int_X \sum_i \delta_{\phi_t(x_i)}(x) (\phi_1(x_i) - y_i) \cdot (D \phi_1)_{\phi_t^{-1} (x)}(D \phi_t)_{\phi_t^{-1}(x)}^{-1} \delta v_t (x) dx dt

=\int_0^1 \int_X \sum_i \delta_{\phi_t(x_i)}(y) (D \phi_{t1})_{\phi_t(x_i)}^T (\phi_1(x_i) - y_i) \cdot \delta v_t (x) dx dt $$

Hamiltonian LDDMM for Dense Image Matching
Beg solved the early LDDMM algorithms by solving the variational matching taking variations with respect to the vector fields. Another solution by Vialard, reparameterizes the optimization problem in terms of the state $$q_t \doteq I \circ \phi_t^{-1}, q_0 = I$$, for image $$ I(x), x \in X $$, with the dynamics equation controlling the state by the control given in terms of the advection equation according to $$\dot q_t = - \nabla q_t \cdot v_t$$. The endpoint matching term$$ E(q_1) \doteq \frac{1}{2} \| q_1-J\|^2 $$ gives the variational problem: {NumBlk|| $$ \begin{matrix} & \ \ \ \ \  \min_{v:   \dot q =v \circ q} C(v) \doteq \frac{1}{2} \int_0^1 (Av_t|v_t)dt +\frac{1}{2} \int_{{\mathbb R}^3}  | q_1(x)-J(x)|^2dx \end{matrix} $$|$$}}

Proof of Hamiltonian Dynamics
The Hamiltonian dynamics with advected state and control dynamics $$ q_t = I \circ \phi_t^{-1}$$, $$ \dot q = - \nabla q \cdot v $$ with extended Hamiltonian $$ H(q,p,v) = (p|-\nabla q \cdot v ) -\frac{1}{2} (Av|v) $$ gives the variational problem

\min_{p,q,v} C(p,q,v) \doteq (p|\dot q)-\left( (p|-\nabla q \cdot v ) -\frac{1}{2} (Av|v) \right) + E(q_1) = (p|\dot q) - H(p,q,v) +E(q_1) \. $$ The first variation gives the condition on the optimizing vector field $$Av=-p\nabla q $$, with the endpoint condition $$ p_1=-\frac{\partial E}{\partial q}(q_1) $$ and dynamics on the Lagrange multipliers determined by the Gatteux derivative conditions $$ (-\dot p - \nabla \cdot (pv) | \delta q) ) =0

$$ and the state $$

( \delta p | \dot q + \nabla q \cdot v ) = 0 $$.