The system comprises two components: (i) an in-house application (named C-DOG) for real-time acquisition of single MV EPID frames in TIFF format and (ii) software for reading the TIFF files and measuring the LD and SD at three user-defined locations during tangential breast RT. The latter software is named LEILA (Live EPID-based Inspiration Level Assessment).
2.2.1 Software and image processing algorithm for measuring the LD and SD in real time during tangential breast RTTo enable robust and fast real-time measurements in a clinical environment, the algorithm of the LEILA software was coded in C# (Microsoft® Visual Studio 2017). The MV images of tangential breast fields and RT phantoms (Section 2.1) were used to test the code.
LEILA's prototype was developed in MATLAB, where it was employed for retrospective analysis of the tangential breast fields. It contained a method to distinguish between ML and LM views as the gantry angle was not available for all images.
For the real-time version of LEILA, the gantry angle is provided by the C-DOG application. Additional parameters needed for measurements of LD and SD are the collimator angle, which is available from the DICOM plan file, and the pixel size of the EPID at the isocenter. The latter is calculated from the pixel spacing of the EPID and the source to image distance (SID), the default SID is 150 cm.
LEILA reads the image of the most recent TIFF file saved in real time in a user-specified folder and analyses image row profiles and their first derivatives (the differences between the adjacent elements) at multiple user-specified locations. Figure 1a,b shows a sample MV EPID image of a tangential breast field and the profile of its midline row. The peak denoted by 1 is the peak of the chest wall profile. Figure 1c shows two typical examples of chest wall profiles seen in images of tangential breast fields: a sharp peak (open symbols) and a broad peak (solid symbols). The pixel index of peak 1 provides the location of the bony chest wall for the calculations of the LD in LEILA. Figure 1d shows the first derivative of the row profile shown in Figure 1b: the peak denoted by 1′ is the peak of the bony chest wall profile, the negative peak denoted by 2 is the peak of the posterior field edge, peak 3 is related to the breast surface, and peak 4 is the peak of the anterior field edge.
To find the upper and lower borders of the radiation field (patient superior–inferior direction), the algorithm employs a threshold technique. The expression for the threshold coefficient, b, is given by (1)The floor function is defined as ⌊x⌋ = max, where Z denotes integer numbers. The Imax and Imin are the maximum and minimum pixel intensities in the image. The threshold denominator, d, needs to be determined experimentally for a particular EPID using retrospective images of breast treatments or phantoms. For the portal imagers of the TROG trial, the values of d were found to be in the interval [2.5; 6], with the most frequent value being 2.5. For the locally acquired EPID images in DICOM format, d = 2.5 confirmed the lengths of the radiation fields with submillimeter accuracy (the collimator angle was at 0o). To obtain the binary image matrix, the pixel intensities above b are replaced with value 1 and the remaining pixel intensities are replaced with value 0. The upper field border is found as the first row of the binary image having the mean row intensity below 0.99, the lower border of the radiation field is found in a similar way.
The vertical size of the radiation field is computed for the binary image and is compared with the planned value, which is available via the DICOM plan file. If the radiation field partially extends beyond the top or bottom boundary of the EPID, the algorithm will calculate the location of the field midline taking into account the part of the field extending beyond the boundary. Only up to 25% of the vertical field size are allowed to extend beyond the border of the EPID, this allows for measurements of LD and SD along the three default lines. The EPID coordinates should be chosen (if possible) such that the projected radiation field does not extend beyond the boundaries of the EPID.
Assessments of LD and SD are done at three user-defined lines of interest identified by their distance from the midline (central line of the radiation beam). The default positions of the three lines are: (i) the midline plus, (ii) the superior, and (iii) inferior lines calculated as half-way from the midline to the upper and lower borders, respectively. Figure 2a shows a portal image with LDs and SDs drawn at the three default locations (superior, midline (central), and inferior), and Figure 2b shows LDs measured on an image with the breast surface blocked by the MLC leaves. The drawing of LDs and SDs was implemented in LEILA's prototype as part of the analysis for visual verification of the algorithm's performance.
Portal MV images of tangential breast fields. (a) The distances from the skin to the posterior field edge (skin distances, SDs) are shown by the long black lines; the lung depths (LDs) are shown by the white lines. The inferior LD and inferior SD are crossing the heart shadow. (b) The superior, central, and inferior LDs detected for the partially blocked anatomy: the MLC leaves are blocking the skin
For each line of interest the algorithm assesses the presence of breast surface in the image. It uses the average of three adjacent rows of pixels (averaged profiles) at the position of the line. Using three rows was found to be a suitable compromise between reducing noise and maintaining peak information. A third-order one-dimensional median filter is used to filter noise in the averaged profiles, and a 1 × 3 and 1 × 5 average filter is used to filter the first derivatives of the averaged profiles.
If the breast surface is present, the program calculates SD as the distance between the posterior edge of the field (peak 2, Figure 1d) and the breast surface (peak 3, Figure 1d), otherwise SD will be reported as 0 mm. For the same average of three adjacent rows of pixels, LD is calculated as the distance from the pixel index of the maximum pixel intensity of the bony chest wall region (peak 1, Figure 1b) to the pixel index of the posterior edge of the radiation field (peak 2, Figure 1d). Greater variability of measured LD is expected for broad peaks of the bony chest wall, a typical example of a broad peak is shown in Figure 1c. The algorithm assumes that the bony chest wall peak is the brightest part of the image row next to the posterior border of the radiation field (Figure 2a,b).
Image rotation by a known angle can be applied if, for example, the collimator angle is not at 0o. To rotate an image by an angle specified in radians, the following transformation of the pixel coordinates19 is employed: (2)where x’ and y’ are the new pixel coordinates, x and y are the initial pixel coordinates, α is the angle of rotation, w is the width of the image in pixels, and h is the height of the image in pixels. 2.2.2 Software for real-time acquisition of MV imagesIn-house image acquisition software C-DOG was used to acquire TIFF files of single MV frames in real time.20 The software is using a frame grabber card Matrox Solios SOL 2M EV CLB (Matrox Electronics, Dorval, Quebec, Canada) connected to the clinical system control computer port to receive EPID frames. Apart from the pixel data of a single MV frame, additional information is recorded in the TIFF files but it was not used in this study. The image acquisition software records 10–13 images per second depending on the linac: it takes approximately 76 ms to save a TIFF file on a Varian TrueBeam StX linac and 105 ms on a Varian Clinac (Varian Medical Systems, Palo Alto, CA, USA).
Comments (0)