Development of independent dose verification plugin using Eclipse scripting API for brachytherapy

Abstract In this study, an independent dose verification plugin (DVP) using the Eclipse Scripting Application Programming Interface (ESAPI) for brachytherapy was developed. The DVP was based on the general 2D formalism reported in AAPM-TG43U1. The coordinate and orientation of each source position were extracted from the translation matrix acquired from the treatment planning system (TPS), and the distance between the source and verification point (r) was calculated. Moreover, the angles subtended by the center-tip and tip-tip of the hypothetical line source with respect to the verification point (θ and β) were calculated. With r, θ, β and the active length of the source acquired from the TPS, the geometry function was calculated. As the TPS calculated the radial dose function, g(r), and 2D anisotropy function, F(r,θ), by interpolating and extrapolating the corresponding table stored in the TPS, the DVP calculated g(r) and F(r,θ) independently from equations fitted with the Monte Carlo data. The relative deviation of the fitted g(r) and F(r,θ) for the GammaMed Plus HDR 192Ir source was 0.5% and 0.9%, respectively. The acceptance range of the relative dose difference was set to ±1.03% based on the relative deviation between the fitted functions and Monte Carlo data, and the linear error propagation law. For 64 verification points from sixteen plans, the mean of absolute values of the relative dose difference was 0.19%. The standard deviation (SD) of the relative dose difference was 0.17%. The DVP maximizes efficiency and minimizes human error for the brachytherapy plan check.


INTRODUCTION
Brachytherapy delivers a high dose to the target volume while realizing a steep dose falling away from the target. Compared with external beam radiotherapy (EBRT), brachytherapy can protect normal tissue while increasing the dose to the target volume. Brachytherapy treatments are conducted with a small fraction and large dose per fraction. Once there is a difference between the planned and delivered doses, it is hard to compensate for the negative effect caused by the difference [1]. Multiple works have recommended performing independent dose verifications to assess the dose calculated by the treatment planning system (TPS) before the brachytherapy treatment [2][3][4]. Currently the calculation-based verification is the realistic way to check the brachytherapy plan before dose delivery rather than measurementbased verification.
The whole process of brachytherapy treatment in our hospital is shown in Fig. 1. First, the patient underwent computed tomography (CT) simulation with applicators. The brachytherapy treatment plan is then made based on the planning CT images. We do not change applicator setup during treatment planning. The independent dose verification is conducted after brachytherapy treatment planning. If the relative dose difference is within the tolerance, the brachytherapy will be conducted and dose will be delivered. If not, the treatment will be re-planned until the verification pass. Currently, in our institution, a Microsoft Excel-based independent dose verification is under clinical practice. Shortcomings of current verification method were revealed. Software other than the TPS was not allowed to be installed on clinical treatment planning machines. To perform the dose verification, the plan information was transferred from the machine with the TPS to another machine with the Microsoft Excel application and pasted to the template file; then, the verification dose was calculated. This procedure is not efficient and may induce human error. Moreover, as the Microsoft Excel-based independent dose verification does not adapt the orientation of each source position in the calculation, the current acceptance range of the relative dose difference of a selected dose verification point is a ± 5% setting between the calculation results of the TPS and verification results. This is a relatively large range compared to the one used in the study reported by Carmona et al. [5], where the relative dose difference was within ±2%. A potentially large acceptance range may give a false positive verification judgement.
To overcome the shortcomings, an independent dose verification plugin (DVP) using Eclipse Scripting Application Programming Interface (ESAPI; Varian Medical Systems, Palo Alto, CA, USA) for brachytherapy was developed [6]. The purpose of this study was to simplify the dose verification procedure for brachytherapy and improve the accuracy of the verification dose calculation.

Description of dose verification plugin
In our institution, we use a Bravos unit (Varian Medical Systems) with the GammaMed Plus HDR 192 Ir active source and BrachyVision V16.1 (Varian Medical Systems) for brachytherapy treatment planning. For this reason, the DVP was dedicated to the Varian TPS and could be integrated with the TPS interface. The DVP was written in C# using ESAPI. With ESAPI, the DVP can access the plan information directly from the TPS and show the dose verification report on the clinical machine with few clicks. There is no need to export, copy and paste data between computers and files. The plan details, especially the orientation of each source position, were adapted in the dose verification calculation in the DVP. In this way, the DVP will show more accurate calculation results, and the acceptance range for the dose verification will be narrowed. The source file of the DVP was one single file. It is easy to update the plugin and distribute it between institutions.

Dose calculation
The DVP calculates the dose at a verification point (P ver ) independently and compares the TPS results at the same point to verify the dose calculation. The dose calculation algorithm of the DVP was the general 2D formalism reported in the Association of Physicists in Medicine's update, Task Group 43 (AAPM-TG43U1) [7].
where r is the distance from the center of the active source to P ver . θ is the angle subtended by the central axis of the active source and the line connecting the center of the active source and P ver . r 0 and θ 0 are specified to 1 cm and 90 • , respectively, according to AAPM-TG43U1. S k is the air-kerma strength on the treatment day. Λ is the dose rate constant of the active source. G L is the geometry function. g L is the radial dose function, and F L is the 2D anisotropy function. The DVP accesses the calibration S k and half-life of the active source as well as the calibration and treatment dates at 12 a.m. directly from the TPS with ESAPI. Subsequently, the value of S k at the day of treatment was calculated using the information above and the law of radioactive decay. The DVP also directly acquires from the TPS with ESAPI.
The active source in our institution is a line source. The DVP calculates the G L based on the line-source model reported in AAPM-TG43U1 [7].
where L is the active length of the source. β is the angle subtended by the tips of the hypothetical line source with respect to the P ver . The first step of calculating G L was to obtain the 3D coordinates of the active source center, both active source tips, and P ver . The active length of the source was stored in the TPS, and the DVP acquired it directly. The TPS stored the position and orientation of the source with a transform matrix. The third column is the source orientation, and the fourth column is the center position. The positions of both tips of the source were calculated by the center position plus/minus the results of half of the active length, multiplied by the source orientation. The position of P ver was defined in the TPS and directly acquired by the DVP. With the coordinate's information above, r, θ , β and G L were calculated.
In the TPS, g L and F L were calculated by interpolating and extrapolating the corresponding data table stored in the radioactive source model. In the DVP, these two functions were calculated independently with fitted dosimetric parameters and equations reported by Lliso et al. [8]. The function for g L was: where for the GammaMed Plus HDR 192 Ir source, h, i, j and k were equals to 1.001, 7.69 ×10 −3 , 2.1×10 −4 and 2.63, respectively. The general functional forms of F L were where k (r) = k 1 r k 2 + k 3 r + k 4 , a (r) = a 1 r a 2 + a 3 r + a 4 , a (r) = a 1 r a 2 + a 3 r + a 4 e (r) = e 1 r e 2 + e 3 r + e 4 , e (r) = e 1 r e 2 + e 3 r + e 4 The fitted parameters of F L for the GammaMed Plus HDR 192 Ir are summarized in Table 1.
Subsequently, the dose rate of each source position at P ver was calculated using equation 1, the DVP calculated the dose at P ver , using the following equation: where i is the index of the active source in the plan, and t is the dwell time.

Dose verification
The P ver dose calculated by the DVP was compared with the dose calculated by the TPS. The relative dose difference (D diff% ) was calculated using the following equation: where D TPS was the dose at P ver calculated by the TPS. According to Lliso et al. [8], the average absolute value of the relative deviation between the anisotropy function and Monte Carlo data was 0.9% for the GammaMed Plus HDR 192 Ir source. For the radial dose function, the value was 0.5%. Based on the linear error propagation theory, where g L and F L were the average relative deviations of g L and F L , respectively. g L • F L was the average relative deviation of g L multiplied by that of F L . We assumed that, other than g L and F L , there were no deviations in the other components of the dose calculation. In this case, we set ±1.03% as the acceptance range for D diff% .

Patient characteristics
This study was approved by the Institutional Review Board of Kyoto University Hospital (approval number: R1446). Our institution started treating patients with the Bravos system from April 2022. Three patients who underwent brachytherapy treatment were included in this study. Two patients were treated with tandem-ovoid applicators, and one was treated with a tandem cylinder. The fractional dose was 6 Gy. At the time of writing, two patients underwent 3 fractions, and one patient underwent 1 fraction. The patients underwent a computer tomography scan and were prepared for each fraction. For each plan, four verification points located at the bladder, rectum, point A at the left side and point A at the right side of the tandem, were determined by the on-site medical physicists or radiation technician, according to the International Commission on Radiation Units and Measurements Report 38 recommendations [9].

Clinical workflow
The user interface of the DVP is shown in Fig. 2. Before running the DVP, at least one reference point with a location should be selected as the dose verification point and stored in the reference point list of the current plan. The first window of the DVP was the dose verificationpoint selection window (Fig. 2a). The list of the combo box contained all non-abstract reference points of the plan. After selection and clicking the 'calculate' button, the calculation report was shown in the next window (Fig. 2b). The calculation report contains important treatment information, D DVP , D TPS, D diff% and the dose calculated by the DVP at each source position.

RESULTS AND DISCUSSION
For 16 plans, 64 verification points were selected and included in the statistic results. The mean of the absolute D diff% was 0.19%. The standard deviation (SD) of D diff% was 0.17%. Among all the 64 results, the calculation result of the DVP was smaller than that of the TPS for 83% of verification points (53 verification points). This was caused by the curve of the fitted g L , and F L was always below the curve of the Monte Carlo simulated data, as reported by Lliso et al. [8].
In the two situations, the absolute D diff% may be out of the acceptance range. First, if the verification point position was inside one of the source positions, a large dose difference was observed. As shown in Fig. 3a-b, the verification point was inside one of the source positions. D diff% of this verification point was 34.96%.
Second, when the verification point was intentionally positioned far from the sources, D diff% was out of the acceptance range, as shown in Fig. 3c-d. D diff% of this verification point was −3.11%. Both situations were caused by the dosimetric parameters used to calculate g L and F L in the TPS, and the DVP was not accurate when the verification point was too close or far from the sources. Once D diff% is greater than the tolerance, the location of the verification point needs to be checked for appropriateness. If the verification point is confirmed as appropriate, the plan may need optimization. In this way, the purpose of the dose verification for brachytherapy is achieved.
This work presented the DVP with GammaMed Plus HDR 192 Ir source. However, the DVP can be extended to verify brachytherapy with other type of active sources easily. All need to do is to change the fitted parameters of g L and F L to the parameters of the corresponding active source according to previous work [8].

CONCLUSION
An independent DVP dedicated to Eclipse TPS for brachytherapy was developed. For the GammaMed Plus HDR 192 Ir source, the acceptance range of the relative dose difference between the TPS and plugin was ±1.03%. For 64 verification points, the mean of the absolute values of the relative dose difference was 0.19%. The SD of the relative dose difference was 0.17%. The entire clinical workflow of the plugin contained a few clicks. Once the plugin is under clinical practice, it will maximize efficiency and minimize human error for the brachytherapy plan check before treatment. The code of the DVP will be shared upon reasonable request.