Improving normal tissue sparing using scripting in endometrial cancer radiation therapy planning

The aim of this study was to improve the protection of organs at risk (OARs), decrease the total planning time and maintain sufficient target doses using scripting endometrial cancer external beam radiation therapy (EBRT) planning. Computed tomography (CT) data of 14 endometrial cancer patients were included in this study. Manual and automatic planning with scripting were performed for each CT. Scripts were created in the RayStation™ (RaySearch Laboratories AB, Stockholm, Sweden) planning system using a Python code. In scripting, seven additional contours were automatically created to reduce the OAR doses. The scripted and manual plans were compared to each other in terms of planning time, dose-volume histogram (DVH) parameters, and total monitor unit (MU) values. While the mean total planning time for manual planning was 368 ± 8 s, it was only 55 ± 2 s for the automatic planning with scripting (p < 0.001). The mean doses of OARs decreased with automatic planning (p < 0.001). In addition, the maximum doses (D2% and D1%) for bilateral femoral heads and the rectum were significantly reduced. It was observed that the total MU value increased from 1146 ± 126 (manual planning) to 1369 ± 95 (scripted planning). It is concluded that scripted planning has significant time and dosimetric advantages over manual planning for endometrial cancer EBRT planning.


Introduction
Endometrial cancer (EC) is the second most common gynecological cancer among women worldwide and surgery is the primary treatment of choice (Sung, Ferlay et al. 2021). Based on the presence of clinicopathological and molecular features after surgery, patients are divided into certain risk groups (low-, intermediate-, high-intermediate, and highrisk) (Concin et al. 2021). While follow-up is sufficient in low-risk patients, adjuvant vaginal cuff brachytherapy (VBT) and/or external beam radiation therapy (EBRT) is recommended in intermediate-, high-intermediate, and highrisk patients, to decrease the risk of local and loco-regional recurrence (ASTEC 2009).
Pelvic EBRT for patients with EC is complex due to large and irregular-shaped target volumes, multiple-dose prescription levels, and several organs at risk (OARs) close to the target volumes (Cilla et al. 2019). Over the past decade, there has been a rapid increase in the use of intensity-modulated radiation therapy (IMRT) and volumetric-modulated arc therapy (VMAT) for pelvic EBRT (Heron et al. 2003;Yang et al. 2010;Shih et al. 2013;Knapp et al. 2019). It has been shown that a significant decrease in toxicity rates can be achieved using these techniques without a detrimental effect in local control rates (Klopp et al. 2018). However, these treatment modalities are quite complex and time-consuming compared to conventional 3-dimensional conformal radiotherapy (3D-CRT) planning. Additionally, inter-observer variability may affect the dose distribution, causing differences between individuals and the creation of subjective treatment plans (Berry et al. 2016). Today, with the development of computer technology, the planning process has been automated for IMRT and VMAT technology which may lead to more objective plans. One of these approaches is scripting functionality integrated with treatment planning systems (TPSs). The planning steps such as creating and expanding contours, performing logical operations on contours, adding radiation beams, determining gantry angles and setting optimization parameters can be performed automatically in 1 3 the TPSs using the scripting tool. In this way, it is possible to ensure that the treatment plans made in a clinic are of a certain standard and the planning process for radiotherapy (RT) can be shortened by automated processes.
The aim of this study was to improve the protection of the OARs, decrease the total planning time and maintain sufficient target doses using scripting functionality integrated TPS in patients with EC treated with adjuvant EBRT. This is the first study to investigate the time-reducing advantage of scripting during EC treatment planning.

Patients
Computed tomography (CT) data of 14 EC patients previously treated with postoperative EBRT were included in this study. The patient age at diagnosis was 28-78 years (median 56). The disease was staged according to the pathologic classification of the International Federation of Gynecology and Obstetrics (FIGO) (Bhatla et al. 2019). Seven patients had FIGO stage I disease. Lymphovascular invasion (LVI) was present in 57% of patients with stage I disease. Seven patients had stage II disease and 28% of them had LVI. Patients were required to have an empty rectum (with a circumferential diameter of ≤ 4 cm) and full bladder during simulation and daily treatment. Planning CT images were obtained in the supine position with a slice thickness of 1.25 cm. The data were then transferred to the RayStation™ (RaySearch Laboratories AB, Stockholm, Sweden) 3D TPS. The research protocol was approved by the institutional ethics committee (Non-interventional Clinical Researches Ethics Board) of Hacettepe University with protocol number GO 21/1357.

Manual planning
Two clinical target volumes (CTV), i.e. CTV45 and CTV50.4, were defined according to the Radiation Therapy Oncology Group guideline (Small et al. 2021). The CTV45 included the regional lymph nodes (obturator, external, internal and lower common iliacs), proximal 1/3 of the vagina and parametrial/paravaginal tissues, whereas the CTV50.4 included the latter two. The planning target volumes (PTV), i.e. PTV45 and PTV50.4, consisted of the CTV45 and CTV50.4, respectively, with a 0.7-cm margin. All treatment plans were developed using two full arcs from 181º to 179º in clockwise and counterclockwise directions via Elekta Versa HD™ (Elekta AB, Stockholm, Sweden). All patients received 45 Gy in 25 fractions to the CTV45 followed by an additional 5.4 Gy in three fractions to the CTV50.4. Optimization was performed to ensure that 95% of the PTVs were enclosed by at least 95% isodose of the prescribed dose. The small bowel, rectum, urinary bladder, sacral plexus and bilateral femoral heads were defined as OARs and contoured at each slice. Dose constraints for OARs are detailed in Table 1.

Scripting
The scripting tool was implemented in RayStation™ TPS using Python code. Scripting was designed to create a treatment plan with two arcs and various structures to improve the plan quality. In addition, it allowed users to perform dose optimization by automatically using optimization constraints predefined in the scripts. The automatically generated contours were the PTVs for the CTV45 and CTV50.4 with a 0.7-mm margin, OAR contours excluded from the PTVs, and the exclusion of a 2-cm expansion of the PTVs from the body: i.e. PTV45, PTV50.4, rectum-PTV, bladder-PTV, bowel-PTV, left femoral head-PTV, right femoral head-PTV, sacral plexus-PTV, and body-PTV. Treatment plans of all patients were optimized with the same planning objectives. The optimization parameters are listed in Table 2. All treatment plans presented here were obtained with only one optimization iteration without additional manual input in optimization. After obtaining an optimal solution for defined optimization parameters, the plan was evaluated using the plan acceptance criteria for OARs, given in Table 1.
The time period was recorded during the automatic process of generating contours, creating the plan and beams, and setting optimization parameters. The sum of these periods led to the calculation of the total treatment planning time.

Comparison of treatment plans
The manually and automatically created plans were compared in terms of the time required to delineate contours, create a plan and beams, and set optimization parameters. The dose-volume histogram (DVH) values of D99%, D98%, D95%, average, D50%, D2%, and D1% for all structures were recorded for both the manual and automatic plans. The D99%, D98%, D95%, D50%, D2%, and D1% are defined as the doses received by 99%, 98%, 95%, 50%, 2%, and 1% of the region of interest (ROI) volume, respectively. The mean values and standard deviation of these results were calculated for both manual and automatic planning and compared with each other. The 50% volume of the prescription dose was recorded to evaluate the differences in low-dose areas. The mean total monitor unit (MU) values were calculated for two different plans of each patient.

Statistical Analysis
The student t-test was used to assess the difference between the values. All statistical analyses were carried out using the SPSS software (version 20.0.0; IBM Corporation, Armonk, NY, USA). p < 0.05 was considered statistically significant.

Results
Both the manual and scripted plans were consistent with the constraints of Table 1. The automatic planning with scripting was seven times faster than the manual planning. While the mean total planning time for manual planning was 368 ± 8 s, it was only 55 ± 2 s for the automatic planning with scripting (p < 0.001). The durations are shown in Fig. 1 separately for the different planning stages and the planning process. A summary of the comparison between the OARs and target doses obtained with scripted and manual planning is given in Table 3. While the difference between the doses received by the target volumes was not statistically significant, some OAR doses were significantly reduced by scripted planning. The mean doses for all OARs were significantly lower for scripted treatment plans (p < 0.001). The maximum doses (D2% and D1%) for bilateral femoral heads and the rectum were significantly higher for the manual plans. The mean D2% and D1% values for the rectum in manual plans were reduced from 5145 ± 25 cGy and 5163 ± 28 cGy, respectively, to 5115 ± 24 cGy and 5140 ± 22 cGy in scripted plans. While the mean D2% and D1% values for the left femoral head in manual plans were 4031 ± 320 cGy and 4222 ± 297 cGy, they were 3283 ± 348 cGy and 3581 ± 401 cGy, respectively (p < 0.001). The mean D2% and D1% in manual plans for the right femoral head reduced from 3927 ± 380 cGy and 4114 ± 362 cGy to 3176 ± 350 cGy and 3477 ± 418 cGy in scripted plans, respectively (p < 0.001). Figure 2 shows an example of the dose reduction for the rectum and bladder in scripted planning. The purple color represents the dose ≥ 95% of the prescribed dose. The bladder-PTV and rectum-PTV have led to a decrease in the related dose in the bladder and rectum. In scripted planning, D50% doses were significantly reduced for the rectum, bladder and bowel compared to manual planning.
In addition to the OAR doses, the peripheral dose in manual plans decreased from 4726 ± 869 cGy to 4046 ± 624 cGy in scripted planning (p < 0.001). When automatic planning with scripted and manual planning was compared in terms of MU values, it was observed that the total MU value increased from 1146 ± 126 to 1369 ± 95.

Discussion
This study investigated the use of scripting via RayStation™ TPS in the EBRT for EC. The aim aim of the study was to reduce the dose to the OARs using structures automatically created by the scripting tool. This method was used to derive seven additional contours (rectum-PTV, bladder-PTV, bowel-PTV, left femoral head-PTV, right femoral head-PTV, sacral plexus-PTV, and body-PTV) as well as those used in manual planning. Since manually creating a VMAT plan is already a very time-consuming process, delineating these seven structures manually in daily practice will make the process even longer. The results presented here show that scripting allows saving approximately six minutes per one plan which yields a clear advantage over manual planning.

3
Although the time-reducing advantage of the scripting during treatment planning has been reported for other types of cancer, this study is the first one in the literature comparing the results for EC patients (Mitchell et al. 2017;Kim et al. 2018;Teruel et al. 2020). All manually and automatically generated treatment plans met the acceptance criteria set out in Table 1. However, the protection of the OARs was increased using scripted planning while target doses remained stable. All DVH parameters for the rectum were significantly reduced. The scripting technique also resulted in lower doses to the urinary bladder compared to the manual plans for almost all dosimetric endpoints analyzed. The mean doses and D50% values were also significantly lower for the small bowel. The results of the present study indicate that this technique allows for dose sparing of the rectum, small bowel and bladder and, consequently, reduce the risk and severity of toxicity. Previously, Yang et al. (Yang et al. 2020) reported that the IronPython language designed by RayStation™ TPS has a clinical application value in the design of automatic RT plans for nasopharyngeal carcinoma. Their results showed that the D1% received by the brain stem, spinal cord, optic nerves, chiasm, lenses and temporal lobes with scripted planning was significantly lower than those with manual planning and the dose was reduced by 1.8%, 2.7%, 4.9%, 1%, and 1.6% for the respective OARs. The authors concluded that the dose distributions for the target and OARs with the scripted plans ware similar to or better than those with the manual planning. Han et al. (Han et al. 2019) reported that automatic planning using Python scripting helps to reduce the dose to the normal brain and improve planning efficiency for hypofractionated multimetastatic brain stereotactic radiosurgery. On the other hand, there are studies that reported no significant difference between the scripted and manual plans for the OAR doses in breast, head and neck, and lung irradiation (Purdie et al. 2011;Krayenbuehl et al. 2018;Bai et al. 2019).
Total MU values were significantly increased with the scripted plan in the present study. In general, the number of MU increases as the number of the subfields increases. Therefore, the increase in the total value of MU is thought to be due to the higher number of the subfields with the scripted plans than with the manual plans. Previously, Han et al. (Han et al. 2019) showed that the total MU per fraction was significantly reduced by 20% with the RayStation™ scripted plans when compared with the Pinnacle™ (Philips Radiation Oncology Systems, USA) scripting tool. This result shows that Raystation's scripting tool is advantageous in terms of MU values although there is an increase in MU values compared to manual planning. Considering plans created with high MU values will  Table 2, and d total treatment planning time for manual and scripted planning exhaust the treatment machines more than those created with low MU values, which appears to be a disadvantage for the scripted planning. In addition, increasing MU values causes an increase in beam-on time which will affect the operating time of the device. In the present study, it was not measure how much the increase in MU values increased the irradiation time. However, considering the mean difference was 223 MUs, one can assume the beamon time will increase by approximately 20 s per treatment when the dose rate is 600 MU/min.
Since the PTV and OAR volumes overlap, dose constraints for the PTV would increase the dose of the intersected volume during optimization while OAR dose limitations would reduce the dose to this volume. In the present study these optimization problems were eliminated by creating additional structures. The creation of seven structures played an important role in the optimization process. Defining dose limitations to these structures helped to reduce the dose to the OARs, as shown in Fig. 2. Previously, Xhaferllari et al. (Xhaferllari et al. 2013) performed a similar study for IMRT planning of head and neck, prostate and anal cancers. These authors generated various derived contours such as PTV, planning organ-at-risk volumes (PRVs) for required OARs, and various dose-limiting ring structures for IMRT optimization purposes, and concluded that scripting improves IMRT planning quality and efficiency.

3
The scripted plans showed sharper dose fall-off than manual plans for the body in the present study. The 50% volume of the prescribed dose was used to compare the dose fall-off for the body. This finding confirms the usefulness of body-PTV as a dose-limiting structure for the areas outside the PTV. It is emphasized that it was reported that a decreased dose to the distant sites could reduce the risk of second cancers (Lindsay et al. 2001).
The treatment planning process is time-consuming and the plan quality is dependent on the experience of the planner. Automating this process is one of the recommended ways to reduce this dependence (Hussein et al. 2018). Recently, artificial intelligence (AI) has been suggested to automate the treatment planning process . Machine learning, a sub-branch of AI has been integrated into TPSs (McIntosh et al. 2021). Another promising AI technique is deep learning which yields rapid dose prediction during the planning process (Nguyen et al. 2018;Nguyen et al. 2019;Bakx et al. 2021). However, creating a deliverable plan is still very difficult with these methods and it is still not used widespread in planning systems. Another issue is that studies with AI have been mostly conducted on prostate and head and neck cancer patients (Bakx et al. 2021). Little is known about the performance of AI methods for other cancers. Although AI is promising in the future for automatic planning, scripting is currently more common in TPSs than AI. Therefore, it is currently still easier for planners to access and routinely use the scripts in the clinic.
The most obvious difference from other scripting studies is that this study was conducted for patients with EC. Previously, scripting was implemented for several treatment modalities such as spine stereotactic radiosurgery (SRS)/ stereotactic body radiation therapy (SBRT) (Teruel et al. 2020), multiple brain metastases SRS (Han et al. 2019), nasopharyngeal carcinoma VMAT (Yang et al. 2020), breast IMRT (van Duren-Koopman et al. 2018Guo et al. 2019), total body irradiation (Teruel et al. 2021), and lung IMRT (Martin et al. 2015). The current study demonstrated that scripting can generate treatment plans for EC with improved speed and robustness. In addition, the automatic creation of extra structures and their inclusion in the optimization resulted in improved normal tissue sparing.
The necessity of similarity of patient characteristics is the main limitation of automatic planning with scripting. In the present study, the script was designed to create two arcs for VMAT plans. The arc angles are standard and the gantry returns from 181º to 179º in clockwise and counterclockwise directions. In patients unsuitable for treatment at these gantry angles, e.g. with a hip prosthesis, scripted planning cannot be used. As it is recommended avoiding beam entrance from hip prostheses, gantry angles need to be rearranged in this case.
The results of the present study show that the treatment plans of EC patients can be made automatically using scripting. The scripted planning also reduces the changes in the plan quality due to the different experiences of the planners (Xia et al. 2020). Since the scripts developed in the present study include clinical protocols, standard dose prescriptions, standard margin for the PTVs, in-house standards and standard dose limitations, it is believed that scripting would assist the standardization of pelvic irradiation in EC.

Conclusion
To the best of the authors' knowledge, the present study is the first to demonstrate that automatic planning with scripting is advantageous over manual planning in the treatment of patients with EC. This study showed that the quality of the treatment plan can be increased with the scripting function of the TPS in patients with EC. Scripted planning has a significant time advantage over manual planning for this patient group. This result is important not only for our clinic, but also has potential to be generalized to other clinics that treat EC patients. On the other hand, the increase in the total MUs appears a disadvantage of the scripted treatment planning. Future research could focus on evaluating the impact of scripted planning on the overall treatment outcome for patients with EC as well as exploring other potential benefits and limitations of this approach.
Author contributions YY designed and performed the experiments, derived the models, and analyzed the data. MG assisted with plan evaluation. YY and SYS wrote the manuscript in consultation with MG and FY.

Data availability
The datasets generated during and/or analysed during the current study are available from the corresponding author on reasonable request.

Competing interests
The authors declare no competing interests.

Conflict of interest
There is no conflict of interest to declare.
Ethical approval All procedures performed in this study were in accordance with the ethical standards of the institutional and/or national research committee and with the 1964 Helsinki declaration and its later amendments or comparable ethical standards. The research protocol was approved by the institutional ethics committee of Hacettepe University with the protocol number GO 21/1357.

Informed consent
Informed consent was obtained from all individual patients included in the study.