# Algorithm Overview

TubeTK provides algorithms for deformable registration of images depicting multiple organs in which the organs may have shifted, expanded, or compressed independently.

Traditional deformable registration imposes a uniform smoothness constraint on the deformation field. However, discontinuities in the deformation field are expected with sliding motion, and this constraint is not appropriate. This ultimately leads to registration inaccuracies.

TubeTK provides deformable image registration incorporating a deformation field regularization term that is based on anisotropic diffusion. A cost function $C(u)$ is a function of the current estimation of the deformation field $u$ . $C(u)$ is iteratively optimized using finite differences and is the sum of of two terms:

• Intensity-based distance measure: captures intensity differences between the fixed image and the transformed moving image (sum of squared differences)
• Anisotropic diffusive regularization term: penalizes unrealistic deformation fields, while considering sliding motion

The anisotropic diffusive regularization is based on decomposing the deformation field into normal and tangential components, which are defined with respect to a given organ boundary along which sliding motion is expected to occur. These two components are handled differently:

• Motion normal to the organ boundary should be smooth both across organ boundaries and deep within organs. The motion normal to the organ boundary must be smooth in both the normal and tangential directions. The former condition enforces coupling between neighboring organs under the assumption that organs do not pull apart. The later forces smooth motion of individual organs.
• Motion tangential to the organ boundary should be smooth in the tangential direction within each individual organ. However, smoothness is not required across organ boundaries, therefore sliding transformations are not penalized.

These conditions are implemented by defining the anisotropic regularizer as:

$S_{\mathrm {a} }(u)={\frac {1}{2}}\sum _{l=x,y,z}\sum _{\mathbf {x} \in \Omega }\|P\nabla u_{l}(\mathbf {x} )\|^{2}+w\left(n^{T}\nabla u_{l}^{\perp }(\mathbf {x} )\right)^{2}$ where

$P=I-wnn^{T}$ and

• $n$ is the organ boundary in the vicinity of ${\textbf {x}}$ ,
• $u(\mathbf {x} )$ is the vector within the deformation field $u$ at location ${\textbf {x}}$ • $\nabla u_{l}(\mathbf {x} )$ is the gradient of the $l$ -th component of $u({\textbf {x}})$ • $u_{l}^{\perp }(\mathbf {x} )$ is the component of $u_{l}({\textbf {x}})$ in the normal direction
• $w$ is a weighting term between the anisotropic diffusive and the diffusive regularizations, and decays exponentially from 1 to 0 as a function of distance to the organ boundary.

Close to organ boundaries, where $w$ is close to 1:

• $\|P\nabla u_{l}(\mathbf {x} )\|^{2}$ penalizes any discontinuities in the deformation field that are in the plane tangential to the organ boundary. This anisotropically smooths:
• Discontinuities in the deformation field's normal component that occur in the tangential plane
• Discontinuities in the deformation field's tangential component that occur in the tangential plane
• $w\left(n^{T}\nabla u_{l}^{\perp }(\mathbf {x} )\right)^{2}$ penalizes any discontinuities in the deformation field's normal component that occur in the normal direction
• Discontinuities in the deformation field's tangential component that occur in the normal direction are allowed: these are sliding motions!

The gradient is defined with respect to $u$ and is implemented in itkImageToImageDiffusiveDeformableRegistrationFilter and itkImageToImageDiffusiveDeformableRegistrationFunction using ITK's finite differences framework:

$c_{S_{\mathrm {a} }}\left(u(\mathbf {x} ,t)\right)=\sum _{l=x,y,z}{\textrm {div}}\left(P^{T}P\nabla u_{l}(\mathbf {x} )\right)(e_{l})+{\textrm {div}}\left(w\left(n^{T}\nabla u_{l}^{\perp }(\mathbf {x} )\right)n\right)n_{l}n$ where $e_{l}$ is the $l^{th}$ canonical unit vector, i.e $e_{x}=[1,0,0]^{T}$ Further away from organ boundaries, $w$ approximates 0 and this tends to the diffusive regularization, which is equivalent of Gaussian smoothing. Therefore, uniformly smooth motion is required within each individual organ.