# 2D/3D Multimode Medical Image Alignment Based on Spatial Histograms
## 3 Results  
Firstly, the CT image is transformed into a rigid body according to the initial space transformation parameters [8; 16; 36]. Then, the CT image is projected to generate a DRR image. Next, the WSHGDs of the DRR image and the reference image are extracted. Finally, the distance measured between the two WSHGDs is calculated. By taking the distance measure as the objective function, the Powell-Brent optimization algorithm optimizes the space transformation parameters until the optimization algorithm reaches the iteration stop condition. As a result, Manhattan distance and J-divergence distance are better performance distance measures. Manhattan distance is also known as city block distance (Formula (16)), and J-divergence distance can be calculated with Formula (17). \[CBD(h_{R},h_{D})=\sum_{all~{}d}|n_{Rd}-n_{Dd}| \tag{16}\]  
\[JCD(h_{R},h_{D})=\sum_{all~{}d}|n_{Rd}-n_{Dd}|\cdot ln\frac{a_{d}}{b_{d}} \tag{17}\]  
where \(a_{d}=max\{n_{Rd},n_{Dd}\}\), \(b_{d}=min\{n_{Rd},n_{Dd}\}\). In this experiment, the sum of Manhattan distance and J-divergence distance is used as the distance measure. The definition of the function \(\rho_{n}(n_{Rd},n_{Dd})\) is shown in Formula (18):  
\[\rho_{n}(n_{Rd},n_{Dd})=CBD(h_{R},h_{D})+JCD(h_{R},h_{D})=\sum_{all~{}d}|n_{Rd }-n_{Dd}|\cdot\left(1+ln\frac{a_{d}}{b_{d}}\right) \tag{18}\]  
Two statistical histogram models--WSHGD and WHGD--were used as the experimental control group to perform 2D/3D registration between CT and DRR images of the skull model to verify the effectiveness and accuracy of the WSHGD. The Powell algorithm was used for the optimization algorithm, and rigid-body transformation was used for the spatial transformation model. The one-dimensional search accuracy of the Powell optimization algorithm was set to 0.01. The overall iterative accuracy of the algorithm was set to 0.001. The maximum number of iterations was set to 1000. The rigid-body transformation parameters were arranged in the order \(\left(a,\beta,\theta,t_{x},t_{y},t_{z}\right)\). The first three parameters were the rotation along the X-, Y-, and Z-axes. Finally, the last three parameters were the translation along the X-, Y-, and Z-axes. Firstly, three groups of experiments were conducted to perform qualitative analysis. The truth value of the first group of experimental reference images was set to \(\left(20,20,20,10,10,10\right)\), the second group was set to \(\left(10,10,10,10,10,10\right)\), and the third group was set to \(\left(10,10,10,20,20,20\right)\). In the experiments, the initial values were optimized as \(\left(0,0,0,0,0,0\right)\), as shown in Figure 3 (the DRR image obtained by CT projection at the initial value). Due to the increased resolution of the DRR image, the skull information can be more clearly displayed. The results of the first group of experiments are shown in Figure 4. The second group of experimental results is shown in Figure 5, while the third is shown in Figure 6. The first column represents the reference image. After registration, the second column represents the DRR image generated by 3D CT projection. The third column represents the difference between the reference and registered DRR images. The first row corresponds to the registration results based on WSHGD features. The second row corresponds to the registration results based on WHGD features. Figure 4: _Cont_. Figure 3: DRR image at the initial value. Figure 4: Results of Experiment 1: (**a**) reference image 1; (**b**) DRR image based on WSHGD registration; (**c**) difference image after registration based on the WSHGD; (**d**) reference image 1; (**e**) DRR image registered based on WHGD; (**f**) difference image after registration based on the WHGD. Figure 5: The results of Experiment 2: (**a**) reference image 2; (**b**) DRR image based on WSHGD registration; (**c**) difference image after registration based on the WSHGD; (**d**) reference image 2; (**e**) DRR image registered based on WHGD; (**f**) difference image after registration based on the WHGD.