# A Novel Markerless Lung Tumor-Tracking Method Using Treatment MV Beam Imaging
## 2 Materials and Method
The tumor location on each MV projection frame was determined by the relative position of the tumor DRR fused on the background DRR that yielded the highest similarity between the composite DRR and the MV projection frame. Additionally, an image enhancement filter was used to improve the contrast ratio between the ROIs and the noise. A variation of the contrast limited adaptive histogram equalization (CLAHE) [19] filter was used to enhance poor soft tissue resolution and introduce high-gradient curves between the ROIs while suppressing the noise. The noise suppression was achieved using a contrast-limiting factor that allows the user to control the strength of the contrast by specifying the capacity of each bin. In general, CLAHE splits the global image into small contextual regions, performs histogram equalization on each region individually, and then stitches them back together. CLAHE performs well when the tumor signal is weak and when there are strong signals superimposed on it by neighboring anatomical structures. A tiling strategy was introduced where the global MV projection image and the corresponding composite DRR were divided into sub-images called tiles [18]. The tiles of the MV projection image and the composite DRR were evaluated to find similarities between corresponding tiles. The tile pairs of the MV projection and composite DRR were shifted globally and evaluated independently of each other to maximize the local similarities. As shown in Figure 3e,\(f\) after 2 \(\times\) 2 tiling (two rows and two columns), four tiles were normalized individually so that their average intensities were zero. The widow level of the upper left tile of DRR changed significantly, much closer to the corresponding MV image tile in Figure 3e. As a result, the similarity achieved was greater than the similarity between Figure 3c,d  
Figure 3: Sample of digitally reconstructed radiographs (DRR) matching and tiling results. (**a**) DRR of the background; (**b**) DRR of the tumor; (**c**) acquired megavoltage (MV) projection; (**d**) composite DRR without tiling; (**e**) MV projection with 2 \(\times\) 2 tilting (two rows and two columns); (**f**) composite DRR with 2 \(\times\) 2 tiling (two rows and two columns). All four tiles were normalized individually so that their average intensities were zero. The widow level of the upper left tile changed significantly, much closer to the corresponding tile in (**e**), and better similarity was observed for the upper left tiles using tiling-based matching than using global matching between (**c,d**). (without tiling). Normalized cross-correlation (NCC) was used to account for image similarity that exists between a pair of DRR and projection tiles:  
\[s(u,v)=\frac{\Sigma_{x,y}[\left\{P(p_{u}+x,\ p_{v}+y)-\overline{P}_{u,v}\right] \left[D(d_{u}+x,\ d_{v}+y)-\overline{D}_{u,v}\right]\right\}}{\sqrt{\left\{ \Sigma_{x,y}\left[P(p_{u}+x,\ p_{v}+y)-\overline{P}_{u,v}\right]^{2}\right\} \left\{\Sigma_{x,y}\left[D(d_{u}+x,\ d_{v}+y)-\overline{D}_{u,v}\right]^{2} \right\}}} \tag{1}\]  
Projections are represented by \(P\), and DRRs are represented by \(D\). P and D were represented as matrices of tiles U \(\times\) V (i.e., U columns and V rows tiles). The starting pixel \((p_{u},p_{v})\) of a projection tile \(P\) (\(u\), \(v\))(u,v) was determined by the tiling configuration. On the other hand, the starting pixel \((d_{u},d_{v})\) of a DRR tile \(D\) (\(u\), \(v\))(u,v) was not only determined by the tile configuration but also affected by the motions. \(\overline{P}_{u,v}\) and \(\overline{D}_{u,v}\) are the average intensities of the MV projection and DRR tiles \((u,v)\), respectively. In order to maximize the effectiveness of the algorithm, the tile configuration (matrix of small tiles) needs to be carefully designed. Factors such as tumor location, size, and MV projection dimensions are considered when splitting the global image into tiles.