Automatic couch position calculation using eclipse scripting for external beam radiotherapy

Abstract Purpose The treatment couch position of a patient in external beam radiation therapy (EBRT) is usually acquired during initial treatment setup. This procedure has shown potential failure modes leading to near misses and adverse events in radiation treatment. This study aims to develop a method to automatically determine the couch position before setting up a patient for initial treatment. Methods The Qfix couch‐tops (kVue and DoseMax) have embedded reference marks (BBs) indicating its index levels and couch centerline. With the ESAPI, a C# script was programmed to automatically find the couch‐top and embedded BBs in the planning CT and derive the treatment couch position according to treatment isocenter of a plan. Couch positions of EBRT plans with the kVue couch‐top and SBRT plans using the DoseMax were calculated using the script. The calculation was evaluated by comparing calculated positions with couch coordinates captured during the initial treatment setup after image guidance. The calculations were further compared with daily treatment couch positions post image‐guided adjustment for each treatment fraction. Results For plans using the kVue couch‐top for various treatment sites, the median (5–95 percentiles) differences between calculated and captured couch positions were 0.1 (−0.2 – 0.9), 0.5 (−1.1–2.0), 0.10 (−1.3–1.3) cm in the vertical, longitudinal, and lateral direction respectively. For the DoseMax couch‐top, the median differences were 0.1 (−0.2–0.7), 0.2 (−0.3–1.1), and 0.2 (−0.7–0.9) cm in respective direction. The calculated positions were within 1 and 2 cm from the mean fraction positions for 95% patients on DoseMax and kVue couch‐top respectively. Conclusions A method that automatically and accurately calculates treatment couch position from simulation CT was implemented in Varian Eclipse for Qfix couch‐tops. This technique increases the efficiency of patient setup and enhances patient safety by reducing the risks of positioning errors.

ulation CT for triangulation points, and the therapists misinterpret couch shift instructions or align in-room lasers with the skin tattoos from previous treatment. Analysis of the Radiation Oncology Incident Learning System (RO-ILS) showed that 74 of the 396 events resulted from either wrong shift instructions or wrong shifts performed. 2 Gross treatment-site errors usually can be detected by the following imaging verification. However, recognizing a setup error typically initiates a root-cause investigation, which increases the time for patient on the table and puts pressures on therapists and physicists. Additionally, the setup errors could be missed on setup images due to insufficient training of the therapists, such as wrong identification of vertebral levels in spinal irradiation. 3 Given the fact that the captured couch position is subject to human errors, an automatic determination of the treatment couch position in advance could eliminate associated failure modes and mitigate potential pressures on the team during patient setup. In current clinical workflow of radiation treatment, the majority of patients are CT simulated and LINAC treated with the same immobilization on identical indexed treatment couches. The indexing builds a oneto-one correspondence from CT space to treatment coordinates, allowing the derivation of treatment couch position from simulation CT images before the initial treatment setup. Using this correspondence, Saenz et al. 4 predicted the couch position based on the radio-opaque landmark on immobilization devices. Instead, treatment couch coordinates were estimated from the couch either based on its embedded ball bearings (BBs) by Tsai et al. 5 or indexing notches by Sueyoshi et al. 6 Both methods involved manual selection of a point (a reference BB 5 or the user origin 6 ) on CT images during treatment planning, which is potentially subjected to user error and alters the planning workflow. In light of this, we developed an automated solution to determine the treatment couch position by computerized detection of the embedded BBs and index levels on the couch from simulation CT images. Moreover, we implemented the method as a scripting function that seamlessly integrates with the treatment planning system for efficient clinical utilization.

2.A | Qfix couch-top treatment position calculation
The majority of patients receiving radiotherapy at our institution are CT simulated and LINAC treated on a Qfix couch-top (Qfix, Avondale, PA). The Qfix kVue couch-top is used for conventional EBRT, while the Qfix DoseMax couch-top is utilized for SBRT. Incorporating their Virtual Indexing TM technique, both Qfix couch-tops have embedded radio-opaque BBs that are distributed on the couch surface in lateral rows with a 14cm longitudinal interval (Fig. 1). From the head downwards, the BB rows are labeled as index levels H5 to H1, 0, F1, F2, and/or F3 at the side along with the notches for fixing immobilization devices. At each row, one BB is located at the couch midline, and a second BB is laterally seated to the right for a F-Index and to the left for a H-Index. The distance between two BBs in a row corresponds to the index level (e.g. 4 cm distance for the H4-Index). The row of 0-index only has a single BB at the midline.
Following the International Electrotechnical Commission standard (IEC61217), the treatment couch is calibrated at the lateral (X), vertical (Y), and longitudinal (Z) position (TX 0 , TY 0 , TZ 0 ) of 0, 0, and 140 cm, respectively, when the couch BB at the 0-Index (reference BB) is aligned with the machine isocenter. With the coordinates of planning treatment isocenter (Xiso, Yiso, Ziso) and reference BB (X 0 , Y 0 , Z 0 ) in the TPS, the couch position at treatment (TX, TY, TZ) is calculated by.
As the equations show, as long as the coordinate (X 0 , Y 0 , Z 0 ) of the reference BB is decided from CT images, the treatment couch position can be calculated immediately when the treatment isocenter is specified during the planning. While (TX 0 , TY 0 , TZ 0 ) for the refer-   BB detection is then performed on the found 2D coronal couchtop slice. The first BB is identified by testing each pixel 5mm laterally from the slice midline. The other BB in the same row is searched on pixels every 1cm away from the first BB with a maximum distance of 5cm since the maximum index level is H5 (5cm laterally between the two BBs). Subsequently, the BB detection moves to the row in 14cm longitudinal distance until the whole coronal slice is assessed. The BB test on a pixel checks that its CT number is greater than a BB CT threshold (−350) and the size of the local-maximum region is less than 3 pixels in any direction (multiple direction evaluation in Fig. 2). The test is also conducted on the pixel in the slices immediately below and above the couch-top slice to account for possible tilt of the couch-top in a CT scan. The pixel passing the BB | 79 test and having the greatest contrast in the three slices is chosen as the coordinate of a couch-top BB.
The index level for a BB row is determined based on the direction and distance of the side BB to the medial one. The method calculates the longitudinal distances between BB rows using their CT coordinates, and compares the distance with the presumptive separation based on the determined index levels. The matching test selects a valid BB row to account for missing BBs in detection due to reduced CT contrast resulting from partial volume effect in the voxel. Finally, the coordinates (X 0 , Y 0 , Z 0 ) of the reference BB at the 0-Index is estimated from the valid row midline BB and its index level.

2.C | ESAPI scripting implementation
The method was implemented using C# script with the Eclipse

2.D | Clinical verification
The method was verified on patient data for 55 SBRT with the Qfix    The threshold-based BB detection on CT couch-top slices may fail when its CT contrast is substantially reduced due to partial volume effects from a small couch tilt and/or proximity to a high-density immobilization device. The method checked the validity of a detected BB by testing that the longitudinal distance between two BB rows calculated from their CT coordinates match with that derived from their index levels. A warning is reported if only a single index line or no valid BB row is found on the CT images. In these cases, or as an independent sec-  Patient setup using predetermined couch position and subsequent image guidance enables markless isocenter localization without the need of skin tattoos. 6 The permanent tattoos for conventional radiotherapy could have significant psychosocial impacts on patients, especially breast cancer patients and pediatric patients. 8,9 The implemented method may be useful for tattoo-less radiation treatment in the future.
In summary, the automatic method not only reduces the risk of human error during patient setup, improves the efficiency of treatment delivery, but also potentially enhances the patient experiences.

CONF LICTS OF INTEREST
None of the authors has conflicts of interest or funding to disclose related to the work of this publication.