## 4 Discussion
The amplitude of the breathing can be analyzed well based on high- and low-diaphragmatic information, but this method alone fails to identify whether the current breathing is in an inspiratory or expiratory state. As shown in Figure 4, the 3D trajectory of the tumor showed hysteresis, as evidenced through previous studies [44; 45], and thus inhale/exhale identification must be conducted to track the tumor in real time while the patient is breathing. The proposed method identifies the respiratory phase through two steps: (1) a structural-similarity based ranking and (2) comparing the hemidiaphragm area. Some may feel that step (1) can be skipped. However, step (1) is necessary to determine whether the current breath is in an inspiratory or expiratory state, thereby determining the respiratory phase candidates to be applied during the second step. Similar to the problems of the elevation-based method mentioned above, a low performance is shown when step (1) is not applied. The elevation-based method has roughly a 50% accuracy when distinguishing between inhale and exhale phase as it only has one image at its disposal, and mid-inhale and mid-exhale phases can look very similar. Moreover, the proposed method performs robustly for projections of every 10% segment of the respiratory cycle. Given that the SSIM is sensitive to slight movements of the diaphragm phantom, as shown in Figure 11, treatment projections with respiratory phases of finer than 10% should be identifiable. Several major limitations of this study should be addressed. First, we did not consider changes in the tumor position that occur from the heartbeat separately from those occurring from respiration. However, when the tumor was located in the upper part of the lung, the movement of the tumor was slight (patients 5 and 6), whereas a tumor close to the diaphragm showed a large movement (patients 1 through 4). Moreover, the movement of the tumor was mainly seen in the cranial-caudal direction (Figure 4, [5; 6; 44; 46]), which is the same as the motion pattern of the diaphragm. Based on these observations, most movements of the tumor can be explained by the motion of the diaphragm alone. Second, owing to the problem of the radiation dose administered to the patient, CBCT projections cannot be obtained by moving around the patient in all directions, and thus pseudo projections were created for every 10% segment of the respiratory phase instead. However, in the phantom study, the SSIM between the actual CBCT projections and their corresponding pseudo projections was close to 1 (0.9589 \(\pm\) 0.0233). Thus, it can be said that our pseudo projection is a good surrogate for an actual projection. In addition, because a pseudo image has a lower contrast than an actual projection, the diaphragm extraction on a pseudo projection is relatively difficult to detect. Because the proposed method was evaluated under worse conditions than those found in an actual situation, the use of an actual image is not expected to lead to a deterioration in the performance. Lastly, because kV imaging is needed in addition to treatment beam, the patient is exposed to an extra radiation dose. Patients with non-small-cell lung cancer are treated with a high dose of within 63 to 103 Gy during radiation therapy [47], compared to which, the amount of radiation delivered by the additional kV images is quite small. Thus, if a small increase in dose can reduce the therapeutic beam exposure to healthy tissue around the tumor, it will be of benefit to the patient.