A fast, independent dose check of HDR plans

High dose rate (HDR) brachytherapy often involves optimization routines to calculate the dwell times and positions of a radioactive source along specified applicator paths. These routines optimize the dwells in such a way as to deliver the prescribed dose at one or more points while satisfying various constraints. The importance of independently verifying the doses calculated by the optimization software prior to treatment delivery has been recognized in various works, and is a requirement of various regulatory agencies. Most previous methods are specific to particular treatment configurations, or require a full replanning of the case. In this work we describe an in‐house software which provides an independent verification of dose calculations in less than 3 min, which adds negligible additional waiting time for the patient, regardless of the number of applicators, paths of the applicators, or complexity of the dwell times and positions. In order to verify errors which may occur between the planning and delivery stages, the verification code directly uses the treatment file used to control the HDR afterloader to compute the dose. Since this file references the source positions in the frame of reference of the catheters, an algorithm is described to convert these positions to Cartesian coordinates. We validate the code for various arbitrary cases ranging from a single catheter to complex multicatheter plans, and show results for various clinical plans. The maximum discrepancy observed for these clinical plans is 2%. PACS number(s): 87.53.–j, 87.90.+y


INTRODUCTION
High dose rate ͑HDR͒ brachytherapy treatment planning entails the identification of applicators on co-registered simulator films or 3D images such as CT. The dwell times along these catheters are then optimized in an attempt to deliver prescribed doses at one or more anatomical points while simultaneously satisfying various constraints. The importance of independently verifying the dosimetry prior to treatment delivery has been recognized in various works, and is a requirement of various regulatory agencies such as the United States National Regulatory Commission ͑NRC͒.
There are two basic approaches to verifying HDR plans. The first relies on calculating a dose index or other characteristic parameter based on the variables defining the implant, such as total dwell time and activity. 1 The calculated value for a given plan can then be compared to an expected value, depending on the type of implant. This expected value can be extracted from institutional experience for the given implant type. The second verification approach uses an independent dose calculation scheme to verify the dose at one or more points. The two verification approaches are complementary, since they both check different aspects of a plan; the first gives the user confidence that the plan is sensible, whereas the second makes sure that the dose is correct at critical points. It can be argued that the accuracy of dose calculations is verified upon commissioning of the treatment planning computer and checked at regular intervals. Checking the dose calculation on a per-plan basis, however, ensures that the correct source is being used, that the source data has not been modified, that the correct activity, treatment date and decay are used, and that any bugs in the planning software did not affect the dose calculation.
In this work we focus on the second verification approach, i.e., verification of dose calculations prior to treatment. Most previously published techniques are specific to particular treatments, such as single catheters, 2-4 GYN three-catheter HDR, 5 planar implants, 6 or esophageal HDR. 7 Saw et al. 8 published a technique which uses an LDR brachytherapy treatment planning system to re-plan the patient using the optimized dwell times. Although this is an important general method to verify dosimetry, the length of time required to input the data for simple treatments is on the order of 20 min, which may be considered overly time-consuming for routine use. Furthermore, the time required for replanning would increase dramatically for complex treatments with a large number of applicators, such as prostate HDR. Another issue which these published verification techniques do not address is the verification of the treatment file ͑the computer file generated by the treatment planning software to control the HDR afterloader͒. There is a possibility that either an error occurs in the generation of the file or that the wrong file is used.
In this article we describe an in-house code used for the sole purpose of verifying HDR dosimetry. The code imports the positions of applicators and the optimized dwell times along these catheters, and calculates the dose at any desired point. The time required for verification is approximately 1-3 min, regardless of the number of applicators. This verification method adds negligible additional waiting time for the patient while providing a valuable independent check. In addition, the code uses the treatment file directly to obtain the dwell times and source positions to calculate the dose. An algorithm is described in the next section to convert these dwell positions, which are referenced along the paths of the applicators, to Cartesian coordinates to allow dose calculation.

A. Description of verification code
In our clinic we use the VariSource HDR unit ͑Varian Medical Systems͒ along with BrachyVision ͑Varian Medical Systems͒ for treatment planning. For this reason, the in-house verification code was designed specifically for the VariSource/BrachyVision combination, although it could easily be modified for other HDR units and/or planning software. The BrachyVision planning system provides many different possibilities for dose optimization. Depending on the type of implant, we either ͑i͒ optimize using equal dwell times along applicators, ͑ii͒ use geometric optimization, which adjusts dwell times in an attempt to produce a uniform dose around applicators, or ͑iii͒ optimize by constraints, which attempts to deliver a specified dose to a point, a line, or multiple points and lines. We find it is often beneficial to alter the optimized plan by either ''pulling'' the isodose lines with the mouse, or by directly modifying the dwell times. The complex nature of this treatment planning process means that many approaches can be used to arrive at a final plan, making it possible that a bug not discovered during commissioning can affect the dosimetry if the planning steps are completed in a different order than usual. This makes a second check of the dose especially useful.
In order to verify errors which may occur between the planning and delivery stages, the in-house verification code uses the treatment file ͑i.e., the file used to control the HDR afterloader during treatment͒ to directly compute the dose. Since this file references the source positions in the frame of reference of the applicators, but contains no information regarding the applicator paths, the code must convert the source locations to Cartesian coordinates. This requires extra informa-tion from the treatment planning computer regarding the paths of the applicators. The input to the verification code is thus ͑1͒ the source strength, reference date, and treatment date, which are entered independently by the user; ͑2͒ the treatment file; ͑3͒ text files containing the digitized points corresponding to the path of each applicator; and ͑4͒ coordinates of dose points.
The verification code uses the TG-43 protocol 9 for the calculation of dose rate, i.e., where S k is the air kerma strength of the source, ⌳ is the dose rate constant, G(r,) is the geometry factor, g(r) is the radial dose function, F(r,) is the anisotropy function, r is the distance between the dose point and the center of the source, is the angle subtended by the central axis of the source and the line connecting the center of the source and the dose point, and r 0 and 0 are reference parameters ͑taken to be 1 cm and 90°, respectively͒. The air kerma strength, radial dose function, and anisotropy function can be found in the literature for various commercial HDR sources. For example, our clinic uses the VariSource HDR system and we use the data of Wang and Sloboda 10 for the 10 mm source and Angelopoulos et al. 11 where L is the length of the source. Unfortunately, this solution diverges at ϭ0 and thus, for this case we take the limit of Eq. ͑2͒ as tends to zero, i.e., . ͑3͒ Note that for the case rӷL this solution is in agreement with the geometry factor for a point source.
During the treatment planning stage, the locations of the applicators are digitized from coregistered simulator films or from 3D images such as CT. The digitized points for the ith applicator can be represented as (x i j dig ,y i j dig ,z i j dig ), where the index i runs between 1 and N ap , and the index j runs between 1 and M i , where N ap and M i are the number of applicators and the number of digitized positions along the ith applicator, respectively. Once the points are digitized into the treatment planning computer, an optimized plan is generated. A treatment file, which is used to control the afterloader during treatment, is then written to a diskette. This file contains the required dwell positions l ik dwell and associated dwell times ⌬t ik along the paths of the applicators, referenced from the distal end of the ith applicator. Here the label i refers once again to the applicator number and the label k indexes the dwell positions along the path of that applicator. The label k runs from 1 to the number of dwell positions along the ith applicator, N i .
Assuming these digitized points (x i j dig ,y i j dig ,z i j dig ) are connected by straight lines, one can transform the dwell positions l ik dwell into Cartesian coordinates (x ik dwell ,y ik dwell ,z ik dwell ) by first finding the indices of the digitized points jϭJ and jϭ(Jϩ1) which bound the given dwell position. This is accomplished by finding the distances of these points along the applicator, l i j dig , which satisfy The length l tip represents the distance between the end of the applicator and the most distal source position.
Once the indices of the two bounding points J and (Jϩ1) are found, the (x ik dwell ,y ik dwell ,z ik dwell ) can be calculated by interpolating along the line segment joining these two points ͑see Fig. 1͒, i.e., and similarly for y ik dwell and z ik dwell . With these Cartesian dwell coordinates (x ik dwell ,y ik dwell ,z ik dwell ) and corresponding dwell times ⌬t ik , the dose at any point (x,y,z) can be calculated using where Ḋ (r,) is calculated from Eq. ͑1͒, r ik and ik are the distance and angle between the source location and the dose point respectively ͑see Fig. 1͒, i.e., and cos ik ϭ where and The graphical user interface ͑GUI͒ windows-based software ͓Fig. 2͑a͔͒, written using Visual Basic ͑Microsoft Corp͒, requests the activity and date information, reads the text files, and calculates the dose at any point. It subsequently generates a form ͓Fig. 2͑b͔͒ with the planned dose, verification dose, and associated percent error for the points of interest, which is used as a formal

B. Code evaluation
To evaluate the check software, we first compared its calculations to a single dwell position calculated using the BrachyVision planning system. We then used it to validate the calculations for four plans with arbitrarily complex geometries. The plans were much more complex ͑many catheters with tortuous paths and sharp discontinuous turns͒ than would be used clinically in order to push the limits of the calculation code. Each plan had up to seven dose verification points.
To demonstrate the utility of the software for clinical cases, we use it to verify the dose for three vaginal cylinder cases, one endometrial case, one endobronchial case, one intraluminal case ͑all based on orthogonal simulator films͒, and two CT-based nine-catheter interstitial implants. Depending on the complexity of a given plan, we have chosen between two and five points per plan to verify the dose.

RESULTS
For single-dwell position plans, the in-house verification software agrees with the BrachyVision calculations within 1%, except for points lying along the source axis (ϭ0), where discrepancies on the order of 10% are observed. This discrepancy occurs because the anisotropy function at ϭ0 is not given in the tables used and so the value is very sensitive to the extrapolation method. When the anisotropy on both the planning and check algorithms are turned off, this discrepancy disappears.
The percent deviation between the dose calculated by BrachyVision and that calculated by the verification software for the complex nonclinical plans are shown in Fig. 3. It is seen that all dose points are within 4%, and that 14 out of 20 fall within 1%. This is good agreement considering the tortuous paths chosen for the applicators in these plans. Good agreement was found for the clinical plans. For the plans based on orthogonal films, all of the dose points were well within 1% of the planned dose. For the two CT-based implants all dose points were also within 1% of the planned dose except for two dose points, which were within 2%.

DISCUSSION
The code described in this article is a quick, useful method to check the dose calculation prior to each treatment. It requires approximately 1-3 minutes, and thus does not significantly increase the patient's waiting time. It must be stressed, however, that the software check is only one part of a complete patient quality assurance protocol. For instance, the software uses the same coordinate system, digitized applicator paths, and dose point coordinates as the treatment planning system and thus will not pick up errors such as incorrect digitization of applicators, incorrect position of dose points, or improper magnification of simulation films. These types of errors can, however, be discovered by inspection of the treatment plan printouts and the simulation films.
The main utility of the second check philosophy implemented in this article is to gain confidence that the dose calculation is accurate. Even though the accuracy of dose calculations is fully verified upon commissioning and during periodic quality assurance tests, checking the dosimetry prior to each treatment assures that ͑1͒ the correct source is being used; ͑2͒ the source data has not been modified; ͑3͒ the correct activity, treatment date and decay are used, since these data are entered independently in the check program ͑this is important with BrachyVision since it keeps track of the activity decay automatically͒; ͑4͒ that no errors occur in the creation of the treatment file since the software uses this file directly to calculate the dose; ͑5͒ that the treatment file corresponds to the correct plan; and ͑6͒ that any bugs ͑known or unknown͒ in the planning software did not affect the dose calculation. In addition, some extra features have been built in to the code to assist in the treatment QA: the number of applicators, the number of dwell positions for each applicator, and the distance of the first dwell positions for each applicator, referenced from the distal end, are printed out which can be used to verify against the treatment plan ͓see Fig.  2͑b͔͒.

CONCLUSION
A dedicated in-house software is described which independently checks the dosimetry at select points for HDR plans. The code uses the optimized dwell times and positions along the applicators directly from the treatment file used to control the afterloader during treatment. The code is written to work with a specific treatment planning system, but can conceivably be modified for other systems. Other than some discrepancies along the source axis, the source modeled the point source within 1% of the treatment planning computer. The code was also tested for various nonclinical plans designed to test the limits of the algorithm. These plans had multiple catheters and complex applicator paths. Most dose points ͑14 out of 20͒ were within 1%, with a maximum discrepancy of 4%. The code was used to verify eight clinical plans, using between 1 and 8 applicators, with a maximum discrepancy of 2%. This shows that the code is a quick way of independently checking dosimetry, which is an important part of a complete quality assurance program for HDR brachytherapy.