## 2 Materials and Methods
### Irradiation Planning and Dosimetry  
Prior to the start of this study, the 4D-WPh body was externally marked and positioned relative to the nozzle using laser pointers integrated into the treatment room. CBCT data acquisition was performed using the integrated 140 kV X-ray system. The Feldkamp-Davis-Kress algorithm was applied to reconstruct a CBCT image, which was then loaded into the TPS to calculate the irradiation plan. The 4D-WPh body was outlined on the CBCT image (Figure 3a,b) along the outside, including the Plexiglas wall and the water filling, and a density of 1 g/cm\({}^{3}\) was set for this area prior to calculation. The outer border of the film holder and the PTV were also outlined. A universal single-field irradiation plan (Figure 3a) was used to irradiate the stationary and moving films for all the beam delivery modalities mentioned above. A voxel size of 1 mm x 1 mm x 1 mm was selected in the TPS. A cube-shaped PTV had a size of \(5\times 5\times 5\) cm\({}^{3}\) and a prescribed dose of 2 Gy. The plan included 35 iso-energy layers with an energy range of 100.2-133.0 MeV and 1177 beams with a beam size range of 3.7-3.1 mm. The number of protons per spot ranged from \(5.4\times 10^{6}\) to \(2.8\times 10^{8}\) in this plan. For irradiation with rescanning, the original plan was converted to a new rescanning-specific plan by scaling the number of protons per spot using the developed module. The number of rescans was calculated for each individual spot by dividing the original number of protons per spot by the maximum number of protons per spot, which was chosen to be \(1\times 10^{7}\). Spot scaling was also performed taking into account that low weight spots with less than \(5\times 10^{6}\) protons would not appear. As a result, each spot had a different number of rescans, resulting in 5 full volume rescans and 12 layered rescans for the high-energy layer where the high weight spots were located. This approach allowed for the combination of volumetric rescanning and layered rescanning. The volumetric rescanning required that the PTV be completely irradiated before starting the next volume rescan. In contrast, the layered rescanning involved repeatedly irradiating an energy layer until the entire prescribed dose was delivered to that layer and then transitioning to the next layer. Validation of the irradiation plan was performed with the stationary holders using a PinPoint 31022 IC (PTW, Freiburg, Germany) with a UNIDOS Webline electrometer (PTW, Freiburg, Germany) and an EBT3 radiochromic film (Ashland, OR, USA). The film changed its optical density as a function of the dose delivered, allowing for the dose to be measured. In the IC measurement (Figure 1b), the dose was measured at the central point of the PTV and at 6 points 2 cm from the central point in 6 orthogonal directions, resulting in a discrepancy between the calculated and measured dose within 3% for all the points. In the EBT3 measurement (Figure 1a), the 2D dose distribution (Figure 3c) was obtained 3 times with the film placed in a perpendicular orientation relative to the beam delivery angle (Figure 3b). The EBT3 film was also used to measure the 2D dose distribution during motion. The film, cut to a size of 100 mm x 92 mm, was placed in the holder so that it was in the central layer of the PTV in a perpendicular orientation relative to the beam delivery angle (Figure 3b). The PTV was centered in the 4D-WPh so that the film moved in the water relative to the stationary PTV. The moving film was irradiated in a single fraction using the different beam delivery modalities. A random start of irradiation relative to the motion phase was applied for FB irradiation with and without rescanning. The exposed films were scanned 24 h later in a landscape orientation at a resolution of 72 dots per inch using an Epson Perfection V700 (Epson, Tokyo, Japan). To convert the film images to the 2D dose matrices, the film was pre-calibrated with a cobalt-60 source. One sheet was taken from the film package used in this study.