PurposeThe main objective of this study was to develop a technique to accurately determine the air gap between the end of the proton beam compensator and the body of the patient in proton radiotherapy.MethodsOrthogonal x‐ray image‐based automatic coordinate reconstruction was used to determine the air gap between the patient body surface contour and the end of beam nozzle in proton radiotherapy. To be able to clearly identify the patient body surface contour on the orthogonal images, a radiopaque wire was placed on the skin surface of the patient as a surrogate. In order to validate this method, a Rando® head phantom was scanned and five proton plans were generated on a Mevion S250 Proton machine with various air gaps in Varian Eclipse Treatment Planning Systems (TPS). When setting up the phantom in a treatment room, a solder wire was placed on the surface of the phantom closest to the beam nozzle with the knowledge of the beam geometry in the plan. After the phantom positioning was verified using orthogonal kV imaging, the last pair of setup kV images was used to segment the solder wire and the in‐room coordinates of the wire were reconstructed using a back‐projection algorithm. Using the wire as a surrogate of the body surface, we calculated the air gaps by finding the minimum distance between the reconstructed wire and the end of the compensator. The methodology was also verified and validated on clinical cases.ResultsOn the phantom study, the air gap values derived with the automatic reconstruction method were found to be within 1.1 mm difference from the planned values for proton beams with air gaps of 85.0, 100.0, 150.0, 180.0, and 200.0 mm. The reconstruction technique determined air gaps for a patient in two clinical treatment sessions were 38.4 and 41.8 mm, respectively, for a 40 mm planned air gap, and confirmed by manual measurements. There was strong agreement between the calculated values and the automatically measured values, and between the automatically and manually measured values.ConclusionsAn image‐based automatic method has been developed to conveniently determine the air gap of a proton beam, directly using the orthogonal images for patient positioning without adding additional imaging dose to the patient. The method provides an objective, accurate, and efficient way to confirm the target depth at treatment to ensure desired target coverage and normal tissue sparing.