# Metal Artifact Reduction in X-ray CT via Ray Profile Correction
## 2 Methods
### Ray Profile Correction  
To compute the profile's surrogate values (the values subject to replacement), we use the observation that metal artifacts usually appear around implanted metals and that the degree of corruption tends to decrease with distance from the metal region. Using this observation, the noisy ray profiles are corrected by dividing it into two regions: metal and non-metal regions. A metal region is the part of a profile that traverses a metal-only CT volume. For these regions, since we usually know the material of the implanted metals and their linear attenuation coefficients, the surrogate values are replaced with the linearly interpolated values of the two profiles extracted from the prior and the metal-only CT volume. We use linear interpolation to take into account the partial volume effect around the metal boundaries. For the non-metal regions, the surrogate values are computed by linear interpolating between the noisy and prior profiles extracted from the uncorrected and the prior CT volume, respectively. The interpolation weight is given by the distance from the nearby metal boundaries along the ray path. It takes into account that, when a point in a ray profile is close to a metal, it is more likely deteriorated by metal artifacts and thus we put more emphasis on prior information. Conversely, when a profile point is sufficiently far away from metal, we can safely rely on its value in the uncorrected volume. As such, our method smoothly blends prior image information into the currently acquired imagery but only at locations where the current image information is likely unreliable due to metal artifacts. Our ray profile correction scheme is formulated as follows:  
\[p_{i}^{new}= \begin{cases}\text{lerp}(\rho,p_{i}^{clean},p_{i}^{metal}/\rho)& \text{if $i\in\text{metal region}$}\\ \text{lerp}(p_{i}^{clean},p_{i}^{noisy},k\cdot\exp(-p_{i}^{dt}/h))&\text{if $i\in\text{ non-metal region}$}\end{cases}  \tag{6}\]  
where \(\text{lerp}(\alpha,\beta,\omega)\) is the linear interpolation operator such that \(\omega\cdot\alpha+(1-\omega)\cdot\beta\). In this equation, \(p_{i}\) represents the sampled value of a ray profile at position \(i\) while its superscripts _new_, _metal_, _noisy_, and _clean_ indicate the corrected profile and the profiles extracted from the metal-only, uncorrected, and aligned prior volumes, respectively. The superscript \(dt\), denotes the distance transform of \(p^{metal}\) and henceforth, \(p_{i}^{dt}\) is the distance from the position \(i\) to the closest metal boundary along the ray path [34]. The value \(\rho\) is the linear attenuation coefficient of the implanted metals while \(h\) is a scalar that controls the smoothness of the weight factor and \(k\) is a constant value representing how similar the aligned prior volume is to the uncorrected one. In our study, \(k\) is experimentally determined as 0.7 and it will vary depending on the quality of the volume registration, as discussed in Section 2.1. Automatic determination of the values, \(h\) and \(k\), will be our future research topic. Figure 4: Metal localization: (**a**) uncorrected CT volume; (**b**) extracted high density materials using the BHT; and (**c**) final results with DBSCAN. Figure 5 shows an example of the proposed ray profile correction scheme that is applied along a ray depicted as a red line in a zoomed-in image at the upper-left corner. In the non-metal region, as the location along the ray is far from the metal region, the two profiles, \(p^{noisy}\) and \(p^{clean}\), become similar to each other; on the other hand, as the location is close to the metal region, \(p^{noisy}\) shows much higher intensities due to the metal artifacts. Thus, \(p^{new}\) in the non-metal region is calculated by relying more on the \(p^{clean}\) as the location is close to the metal region. The weight function in the non-metal region is shown in Figure 5c.