Quimera : a simulation platform based on the code Geant 4 for dose evaluation in radiotherapy

This work describes the development and validation of a simulation platform, called Quimera, based on the Monte Carlo (MC) code Geant4 for dose evaluation in radiotherapy. Quimera consists of two MC applications (qMATphantoms and qNCTphantoms) for dose evaluation from a phase-space and a graphical user interface (qGUI). qMATphantoms is aimed for modeling of physical phantoms used in quality control. NCT phantoms are built from computed tomography (CT) images of patient or physical phantom using a conversion method of CT numbers (NCT). qGUI has the function of creating or editing input files, running the MC applications and analyzing results. MC applications were validated by comparison of dose distributions, whose results were in agreement with the quality assurance standards. qGUI is a differential concerning other Geant4 applications for radiotherapy and can be used for dose distribution analysis from other MC applications. Quimera can be used for research, simple treatment planning and quality assurance in photon beam radiotherapy.


INTRODUCTION
According to the World Health Organization (WHO), cancer is the second leading cause of death in the world.The number of new cases is expected to rise by about 70% over the next two decades [1].One of the most important and commonly used techniques in cancer treatment is radiotherapy [2].During treatment planning in radiotherapy, it is determined the most appropriate way to irradiate the patient.Nowadays, the accuracy of dose calculation, the most important feature of treatment planning systems (TPS), must be between 1 and 2% [3,4].Traditionally, the three main algorithms for dose calculation are: pencil beam (PB), convolution-superposition (CS) and Monte Carlo (MC) methods, named of accuracy and computational complexity.Relative errors between experimental measurements and dose calculations using analytical algorithms (PB and CS) can reach more than 10%, for both beams of photons and electrons [5,6].Using MC simulations, errors can be below than 2% [7,8].Therefore, MC method is the gold standard in algorithms for dose evaluation, despite it is substantially slower than analytical methods [9][10][11][12].However, due to the large increase in computer processing power and the implementation of variance-reduction techniques, the use of MC simulations in a reasonable time for clinical practices has become possible [13,14].
Geant4 is an open-source toolkit for MC simulations of radiation transport.The code was written in C++ and exploits advanced software-engineering techniques.Geant4 was initially developed to support the high energy physics experiments of CERN (European Organization for Nuclear Research); since then there has been an increasing interest in the use of Geant4 in simulations of radiotherapy with external beam [32].Geant4 is a particularly appropriate tool for this purpose since it offers comprehensive functionality for the implementation of complex geometry systems [33]; Oliveira, et.Al. • Braz.J. Rad.Sci.• 2018 moreover, its electromagnetic physics models that have been validated for materials and photon/electron energy ranges relevant to radiotherapy [34].GATE was initially developed for PET (Positron Emission Tomography) and SPECT (Photon Emission Computed Tomography) simulations.From version 6.0 [35], some tools have been added for applications in radiotherapy.GAMOS was developed for MC simulations in medical physics.
TOPAS was initially developed for proton therapy, but currently it is for all forms of radiotherapy.
On the three platforms, the way to configure the simulations is by a scripting language.The user must write the commands and parameter values in text files which will be read by the code at runtime.Moreover, the way to run the simulations is restricted to the terminal application.This work describes the development and validation methodology of a simulation platform, called Quimera, based on the MC code Geant4 for dose evaluation in radiotherapy.In addition to treatment planning, the dose evaluation can be performed for research and quality control of treatment heads and TPSs.

MATERIALS AND METHODS
Quimera can be run on any Linux-based operating system.Quimera consists of a graphical user interface (qGUI) and two MC applications.The following sections describe the development and validation of the MC applications and the construction of qGUI.

Monte Carlo Applications
MC applications were built using Geant4 (version 9.6) and consist of two types: dose evaluation from a phase space (PhSp) in mathematical phantoms (qMATphantoms) or NCT phantoms (qNCTphantoms).In MC simulations for radiotherapy, PhSp is a file containing details of the particles passing through a region, representing the irradiation beam.For consistency purposes, the IAEA (International Atomic Energy Agency) has established a standard PhSp format [36], which contains the following particle details: position, direction, energy, type, and statistical weight.
Therefore, for dose evaluations on Quimera, a PhSp in IAEA's format must be provided as input.
The functions of G4IAEAphspReader class, developed by Cortés-Giraldo et al. [37] and available at https://www-nds.iaea.org/phsp/Geant4/,are used to read it.qMATphantoms is aimed for modeling of physical phantoms used in quality control of Linacs and MLCs or other experimental dosimetry analysis.In this work, a water phantom, a cylindrical phantom with acrylic wall and water inside, and the Gammex 467 tissue characterization phantom were modeled.At runtime, the chosen phantom is defined as sensitive volume (G4VSensitiveDetector) and is voxelized using the G4VReadOutGeometry class.In the function ProcessHits, the energy deposited in the voxel where the interaction occurred, its density and its coordinates are obtained.From the voxel volume, the absorbed dose is obtained and multiplied by the particle's statistical weight.Then, the weighted dose and the voxel's coordinates are passed to another class where the dose is added to the corresponding previous dose value.For uncertainty calculations, at the end of each history (event), the square of the absorbed dose is computed and added to the previous squared dose value, and the total number of histories for each voxel is incremented [38].At the end of the simulation, this information is recorded in a text file.
To validate qMATphantoms, the dose distributions obtained using qMATphantoms and DOSXYZnrc [39] from an IAEA PhSp were compared.The IAEA PhSp used was the "VarianClinaciX_6MV_20x20_w1" available at https://www-nds.iaea.org/phsp/,which represents a 20 x 20 cm beam of a Varian linear accelerator, model Clinac iX and nominal energy of 6 MV.This PhSp and the DOSXYZnrc dose distribution were generated from a MC modeling of a 6 MV Varian Linac photon beam [39].Dose distribution data comprise lateral dose profile at a depth of 1.5 cm and percentage depth dose (PDD) curve and were provided by Hedin et al. [40].Standard (options 1, 2, 3 or 4), Penelope or Livermore.All simulations described in this paper used the Livermore.The second window is to build and display calibration curves, using the method developed by Oliveira et al. [42].The third window is to display NCT histograms.

Graphical User Interface
Oliveira, et.Al. • Braz.J. Rad.Sci.• 2018 In qGUI, there is a specific window for each MC application.The MC simulations can be executed visually (using G4UIQt, the native window of Geant4) or interactively, in which Geant4 commands can be applied and information about the simulation progress is shown on the computer screen.In general, before starting a simulation, the user must inform input files, number of histories and number of slave nodes, in the case of parallel computing.
Dose distribution analysis can be done in several ways: 2D distributions (punctual, isodose curves or isodose regions) of dose and uncertainty, dose profile, dose per volume, relative differences between dose distributions (same dimensions), join dose distributions (same dimensions), and differential and cumulative DVHs.Volumes of interest to obtain DVHs and dose per volume are cylindrical.Thus, the center positions in the XY plane, the rays, the ranges in the Z axis and the identification numbers must be in a text file.

Monte Carlo Applications
The phantoms modeled with qMATphantoms are shown in Figure 1.The user can set the dimensions of the water phantom and cylindrical phantom, and the insert positions of the Gammex phantom by editing the corresponding text files.The NCT phantom built in the qNCTphantoms from the CT images of the cylindrical phantom is shown in Figure 2.  beyond the maximum dose region are 1.6% (0-4%) and 0.7% (0-2%), respectively.The average relative errors between the dose profiles in the high dose region and penumbra region are 0.6% (0-2%) and 10.6% (0-20%), respectively.These results are in agreement with the recommendations of IAEA TRS-430 [43], validating therefore the qMATphantoms.The comparisons between the dose distributions obtained in qNCTphantoms and qMATphantoms were made between the total dose and the cumulative dose-volume histograms (DVHs) in the planning target volume (PTV) -cylinder with diameter and height of 4 cm positioned in the phantom's centers.Total absorbed doses in the mathematical phantom and the NCT phantom were 0.450 ± 0.001 μGy and 0.455 ± 0.001 μGy, respectively.The relative error is 1.11%, relative to dose in the mathematical phantom.The cumulative DVHs are shown in Figure 4.The relative error between the areas is equal to 1.11%.Therefore, since the differences between dose distributions are below 2% [44], qNCTphantoms was validated.

Graphical User Interface
The menu items, presented in the main window of qGUI, is shown in Table 1.The windows to view and analyze CT images, to build and display calibration curves and to display NCT histograms are shown in Figure 5.The windows for dose distribution simulations and analysis are shown in Figure 6 and Figure 7.The window for dose evaluation with qMATphantoms is shown in Figure 6a, displaying the input tab and the simulation area, which is the same for qNCTphantoms.The tabs to set the sensitive volume parameters (qMATphantoms) and the PTV position (qNCTphantoms) are shown in Figure 6b and Figure 6c, respectively.The NCT conversion files can be used for different simulations, if the scanner and acquisition protocol are the same.
On the windows for analysis of dose distributions (Figure 7), some quantitative information is shown and several display parameters are available.The display areas were omitted.The window for display of DVHs is similar to the calibration curve window (Figure 5b).

CONCLUSIONS AND PERSPECTIVES
This study showed the development and validation methodology of a simulation platform for dose evaluation in radiotherapy.The system, called Quimera, is based on the MC code Geant4 and consists of two MC applications (qMATphantoms and qNCTphantoms) for dose evaluation from a PhSp and a graphical user interface (qGUI).In this first version, Quimera can be used for research, planning of simple treatments and quality control (TPSs, MLCs and Linacs) in photon beam radiotherapy.
Quimera is an initiative for collaborative development of a complete simulation platform that can be used in radiotherapy, for clinical and technical practice and research.However, there is much to implement to make Quimera a complete system for that, such as (1) several conversion methods of CT numbers and windows to display density and material distributions; (2) an algorithm for inverse planning [45,46]; (3) tools for image segmentation to select treatment volumes [47]; (4) for input and output DICOM-RT files [48]; (5) to run simulations in parallel using graphics processing unit (GPU), allowing accelerate simulations up to 600 times [49]; (6) and to incorporate tessellated volumes generated by computer aided design (CAD) programs [50].For those interested to use or develop collaboratively, the executable or source code can be requested from the authors by email.
/extended/medical/DICOM) and is aimed for treatment planning and quality control of TPSs.NCT phantoms are built from computed tomography (CT) images of patients or physical phantoms using a conversion method of CT numbers (NCT) to density and material type.The implemented conversion method uses a calibration curve to obtain the densities and density ranges to obtain the tissues (or materials).Calibration curve parameters and the density ranges can be set by using the qGUI.Compositions of the implemented materials were obtained from tables of ICRU 46[41], Geant4 material database, and other sources.The voxelized volume of materials is represented by the G4PhantomParameterisation class and is defined as a sensitive volume by the Oliveira, et.Al. • Braz.J. Rad.Sci.• 2018 G4MultiFunctionalDetector class.The text file with the dose distribution is generated in G4Event class, using the G4PSDoseDeposit class to obtain the necessary information.Dose distributions obtained using the qMATphantoms and the qNCTphantoms from an IAEA PhSp were compared to validate qNCTphantoms.CT images used in qNCTphantoms were obtained with a Siemens Biograph mCT scanner and a cylindrical phantom with acrylic wall and water inside.CT images required for construction of the calibration curve were obtained with the same scanner, using a Gammex 467 tissue characterization phantom.The same dimensions of the cylindrical phantom and the same image voxel size were used in qMATphantoms.The IAEA PhSp used was "VarianClinaciX_6MV_4x4" available at https://www-nds.iaea.org/phsp/,which represents a 4 x 4 cm beam of a Varian linear accelerator, model Clinac iX and nominal energy of 6 MV.The irradiations were made perpendicular to the XY plane, at the angles 0º, 45º, 90º, 135º, 180º, 225º and 270º.Geant4 MPI interface (G4MPI) and OpenMPI library (version 1.6.5)are used to run the MC simulations in parallel computing.The default production cut value is 1.0 mm, but the user can change it.The user can also choose the following Geant4's electromagnetic physics models:

Figure 3
Figure 3 shows the PDD curves and lateral dose profiles from the IAEA PhSp obtained in qMATphantoms and DOSXYZ.The relative errors were point-to-point calculated concerning values from DOSXYZ.The average relative errors between the PDD curves in build-up region and

Figure 3 :
Figure 3: Comparison between (a) the PDD curves and (b) lateral dose profiles from the IAEA PhSp obtained in qMATphantoms and DOSXYZ.

Figure 3 :
Figure 3: Comparison between (a) the PDD curves and (b) lateral dose profiles from the IAEA PhSp obtained in qMATphantoms and DOSXYZ.(Cont.)

FileFigure 5 :
Figure 5a.This image was magnified by setting the width and centralized.It is necessary to set the ROI's radius to get the NCT average.The ROI's location is set with the left mouse button, displaying a red circle superimposed on the image.In this case, one can view the histogram of the ROI's NCT.The graph and parameters of the calibration curve from the CT scanner used to acquire the cylindrical phantom images is shown in Figure 5b.By saving a calibration curve as a text file, the curve parameters are properly arranged for the file acts as an input for qNCTphantoms.The histogram displayed in Figure 5c is from the cylindrical phantom images.The NCT taken to build the histogram are defined by the center (level) and width (window) of the NCT range, using the slider controls.

Figure 7 :
Figure 7: Windows for display and analysis of dose distributions, 2D (a) and profile (b).The display areas have been omitted.
qGUI has the function of creating or editing input files, running the MC applications and analyzing results.qGUI was developed in C++ language by using the Qt (version 4.8.6).VTK (version 5.8) was used for viewing and analysis of CT images.The computational tools for data analysis were implemented using the ROOT libraries (version 5.34.19).qGUI has three windows conversion of CT numbers.The first window is to view and analyze CT images, where one can get NCT averages and histograms of circular regions of interest (ROI).

Table 1 :
Menu items of the main window of qGUI.
Oliveira, et.Al.• Braz.J. Rad.Sci.•2018 qGUI is a differential concerning other Geant4 applications for radiotherapy and can be used for dose distribution analysis from other MC applications.MC applications can run independent of the qGUI, by using a terminal application.Since Quimera was developed using object-oriented programming, one can add new MC applications, allowing the development of new researches, application in other radiotherapy techniques, including electron, proton and heavy ion beam, and tomotherapy, and other fields, such as brachytherapy and radiation protection.