# Automatic 3D MRI-Ultrasound Registration for Image Guided Arthroscopy
## 3 Methods
### Registration
#### 3.2.3 Initialization by Euclidean Distance Transform  
Registering the obtained set of label masks (Sections 3.1.1 and 3.1.2) extracted from US and MRI volumes can be posed as a pseudo/mono-modal registration problem for which there are many traditional registration approaches available. However, these methods tend to face issues like incorrect error estimation and underperformance due to a lack of efficient optimization. Since labels are encoded with numerical values, one incorrectly registered voxel with label difference of two gives the same error as two incorrectly registered voxels with label difference of one leading to incorrect estimation of registration error. Metrics like Dice are good for finding an overlap of segmentations but might not be sufficient as a metric  
Figure 4: Illustration of fat-pad along with its eigenvectors and obtained boundary points.  
for registration, since there are equivalences of values at multiple shifts, which would imply multiple local minima in the error surface, which could trap iterative methods. In addition, in this case, a bad initialization might lead to low capture range as the homogeneous label regions such as the background label, do not produce meaningful information for the optimization and therefore result in poor registration [17]. Furthermore, the structures in MRI are complete, whereas, in US, it is dependent on the placement of the probe, so complete volume overlap of the two masks is not expectable from a practical standpoint. Considering these issues, in our method, we transform the masks to a geodesic, using distance transform which makes the support region of the mask larger, thereby increasing capture range. Hence, this enables working with partial segmentations. Each label map is considered as a different binary image, \(I_{n}\), which has two classes foreground \(f_{g}\) and background \(b_{g}\).  
Distance transform assigns a number to a voxel which is the distance from that voxel to the nearest non-zero voxel. Euclidean distance transform \(\phi\) is applied on the pre-initialized \(I_{n}\) in Equation (1),  
\[\phi_{m,n}=\phi(I_{m,n})\ and\ \phi_{f,n}=\phi(I_{f,n}) \tag{1}\]  
where \(\phi_{m,n}\) and \(\phi_{f,n}\) are distance maps of moving and fixed modalities respectively, and are derived using Equation (2),  
\[\phi(I_{n}(X))=\begin{cases}0&,\ \ I_{n}(X)\in f_{g,n}\\ min(\|X-X_{0}\|),\ \ \forall I_{n}(X_{0})\in f_{g,n}\ and\ I_{n}(X)\in b_{g,n}\end{cases} \tag{2}\]  
\(\|X-X_{0}\|\) is the Euclidean distance between two points. This transform is applied on all the label classes separately. The initial transform is obtained by minimizing the following Equation (3):  
\[min_{T\in SE(3)}\sum_{n=1}^{N}\int_{S_{f}}|(\phi_{m,n}.T)(x)-\phi_{l,n}(x)|^{2 }dx \tag{3}\]  
where \(T\in SE(3)\) is the required rigid transformation to initialize \(\phi_{m,n}\), \(S_{f}\) is the set of coarse segmentations in fixed volume and \(N\) is the total number of segmentations. Since the distance transform of a label map is also dependent on the distance between the segmentation and boundary, the ROI of MRI should be selected accordingly for the minimization problem to work more efficiently. Intuitively, the dimensions and centre for cropping the ROI are selected based on the length and width of femoral cartilage, \(fc\). The centre of the segmented femoral cartilage is set as the centre for ROI, and the dimensions are determined by Equation (4):  
\[X_{MRI}=\frac{length\ of\ fc_{MRI}}{length\ of\ fc_{US}}\cdot X_{US} \tag{4}\]  
where \(X_{MRI}\) denotes the required \(x,y,z\) dimensions of ROI, and \(X_{US}\) denotes the \(x,y,z\) dimensions of US volume and length of femoral cartilage is the length along that particular axis.