geant4 simulations of hadron therapy and refinement of...

28
IN DEGREE PROJECT TECHNOLOGY, FIRST CYCLE, 15 CREDITS , STOCKHOLM SWEDEN 2019 Geant4 Simulations of Hadron Therapy and Refinement of User Interface EMIL EKELUND DAVID FOGELBERG SKOGLÖSA KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ENGINEERING SCIENCES IN CHEMISTRY, BIOTECHNOLOGY AND HEALTH

Upload: others

Post on 16-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

IN DEGREE PROJECT TECHNOLOGY,FIRST CYCLE, 15 CREDITS

, STOCKHOLM SWEDEN 2019

Geant4 Simulations of Hadron Therapy and Refinement of User Interface

EMIL EKELUND

DAVID FOGELBERG SKOGLÖSA

KTH ROYAL INSTITUTE OF TECHNOLOGYSCHOOL OF ENGINEERING SCIENCES IN CHEMISTRY, BIOTECHNOLOGY AND HEALTH

Page 2: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM
Page 3: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

i

This project was performed in collaboration with KTH, Department of Physics

Supervisor at KTH, Department of Physics: Chong Qi

Geant4 Simulations of Hadron Therapy and Refinement of User Interface

Geant4 simuleringar av partikelterapi och förfinande av användargränssnitt

E m i l E k e l u n d D a v i d F o g e l b e r g S k o g l ö s a

Degree project in medical engineering First level, 15 hp

Supervisor at KTH: Mattias Mårtensson and Tobias Nyberg Examiner: Mats Nilsson

School of Engineering Sciences in Chemistry, Biotechnology and Health

KTH Royal Institute of Technology

SE-141 86 Flemingsberg, Sweden http://www.kth.se/cbh

2019

Page 4: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

ii

Page 5: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

Abstract

Radiotherapy is one of the most used methods for treating cancer and the most common way to executesuch treatments is to irradiate tumors with high energy photons. This can damage healthy tissue along theirradiation line. By using hadron therapy and instead irradiate the tumor with charged particles (protonsor Carbon 12 ions), the energy can be concentrated to a more specific place in the body. However, themethod is not well studied and the tools available for simulating hadron therapy can be hard to use.

When simulating hadron therapy and other nuclear interactions a large amount of calculations need tobe executed. Monte Carlo methods is a numerical method to solve equations based on repeated numbersampling and is used in the simulation program Geant4. Hadron therapy was simulated with Geant4 andthe data was analyzed with the data analysis framework ROOT. New macros and analysis scripts werecreated with the intention to help new Geant4 users. The aim to make Geant4 easier to use was partiallymet. The implementation of code for the low energy region of Carbon 12 projectiles was unsuccessful.

iii

Page 6: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

Sammanfattning

Strålterapi är en av de mest använda metoderna för att behandla cancer. Det vanligaste sättet att utförastrålterapi på är att använda fotoner med hög energi som strålas mot tumören. Denna metod kan dockskada frisk vävnad längs strålningslinjen. Genom att använda hadron therapy (partikelterapi) och iställetbestråla tumören med laddade partiklar (protoner eller kol 12 joner) så kan den deponerade energin kon-centreras till en specifik plats i kroppen. Denna metod är dock inte välstuderad och de verktyg som finnstillgängliga för att simulera partikelterapi är svåra att använda.

När man simulerar partikelterapi och andra nukleära interaktioner måste ett stort antal beräkningargöras. Monte Carlo metoder är ett numerisk sätt att lösa ekvationer på som baserar sig på upprepadeslumptal, Monte Carlo metoder används i simuleringsprogrammet Geant4. Partikelterapi simuleradesmed Geant4 och datan analyserades med dataanalysverktyget ROOT. Nya macron och analysscript ska-pades med intentionen att hjälpa nya Geant4 användare. Målet att förenkla Geant4 uppfylldes delvis.Målet att implementera kod för lågenergiregionen vid användning av kol 12 joner uppfylldes inte.

iv

Page 7: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

Contents

1 Introduction 11.1 Aims . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 Background 22.1 Monte Carlo Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Bragg Peak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2.1 Spread-out Bragg peak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Linear Energy Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4 Geant4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4.1 The hadron therapy example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4.2 Detector and phantom geometry . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2.5 ROOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Method 63.1 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1.1 Proton projectiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.1.2 Carbon 12 projectiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.3 Modification of the hadron therapy example . . . . . . . . . . . . . . . . . . . . . . . . 8

4 Results 94.1 Proton projectiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.2 Carbon 12 projectiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114.3 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114.4 Modification of the hadron therapy example . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Discussion 135.1 Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145.3 Modification of the hadron therapy example . . . . . . . . . . . . . . . . . . . . . . . . 145.4 Possible improvements and future work . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6 Conclusion 16

7 References 17

AppendicesA Modified hadron therapy example and user guide

v

Page 8: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

vi

Page 9: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

1 Introduction

Today radiotherapy is one of the most used methods for treating cancer [1]. The most common way toapply radiotherapy is to irradiate the tumor with high energetic photons. However, this can cause damageto healthy tissue along the irridation line. Another method is to use charged particles like protons andheavier ions (helium and carbon). The interest in and usage of Charged Particle Therapy(CPT), alsoknown as hadron therapy is increasing rapidly because it is a very precise way to treat tumors [1].

By utilizing knowledge of the Bragg curve of charged hadrons, i.e how dose is distributed as theparticles pass through matter, the so called Bragg Peak can be located. The Bragg peak is a sharp energypeak that occurs right before the particles comes to rest. By using the Bragg peak one can concentratethe majority of the dose to a specific part of the body, in this case the tumor [1].

A problem with this method, a method that is not very well studied, is that one has to be awarethat the effectiveness of the hadron therapy treatment can be influenced by the limited understandingof the nuclear reactions involved, especially the underlying nuclear interactions. As a result, availablesimulation methods for hadron therapy are still not able to describe experimental data in a precise manner.According to Chong Qi, assistant professor at KTH, and the KTH nuclear physics group, they have doneseveral simulations on both the proton and carbon therapy with different codes. In particular, they alreadyknow that the INCL++ code inside Geant4, a simulation program for particles passing through matter,does not work well at low beam energies. A serious drawback is that different nuclear models for protonand heavier ion reactions have to be relied on, as well as different models for different energy regions.There is no universal model available, and the experimental data is still scarce.

In addition to the uncertainty in the low energy region for Carbon 12 projectils when using Geant4,the program can also be hard to understand and use. The learning curve is steep and can be intimidatingfor new users.

1.1 Aims• Modify the existing hadron therapy example in Geant4, making it easier to understand and use forbeginners.

• Implement Geant4 code that can simulate nuclear interactions at low energies when using Carbon12 projectiles.

1.2 LimitationsOnly protons and Carbon 12 ions were studied.

1

Page 10: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

2 Background

The concept of substituting photons with protons in cancer treatment was introduced by Robert Wilsonin 1946 and the first treatments began in the 1950s [2]. This early on in the development process, thetreatments were executed in nuclear physics research facilities with non-dedicated accelerators. Sincethe accelerators did not have enough power to enable the protons to penetrate into deeper layers of tissue,the number of parts of the body that was available for the treatment were few [2]. Progress in the late1970s in the accelerator technology field paired with advances inmedical imaging and computing allowedphysicians to use proton therapy more frequently in routine treatments [2]. However, it took some time,until the beginning of the 1990s before the first clinics had their own proton facilities [2]. The first everwas built in Loma Linda, USA. 2018 there where thirty proton centers up and running or being constructedall over the world [2].

0 5 10 15 20 25 30 35 40Distance Travelled (mm)

0.2

0.4

0.6

0.8

1

No

rma

lize

d d

ose

Distributed dose

Figure 1: Simple demonstration of the sharp Bragg peak at the end of the particle range. 70 MeV protonsradiated at a water phantom. Simulated with Geant4 and created with the analysis toolkit ROOT.

The next step in the evolution of radiation therapy was changing into carbon and other heavy ions [2].These provide a superior alternative to protons in the sense of a better local control of very aggressivetumors as well as a lower acute or late toxicity [2]. This improves the quality of one’s life both duringand post cancer treatment. By 2018 more than 120.000 patients have been treated with hadron therapyall over the world, among these 120.000, 20.000 were treated with carbon ions [2].

As seen in figure 1 most of the dose is deposited at the end of the particle range. Therefore, thedose to healthy tissue along that irridation line will be lower than when using regular photons, while stilldelivering the same dose to the tumor. When using traditional x-rays a cross fire setup is required toincrease the ratio of dose to the tumor as compared to normal tissue [3]. By applying charged particletherapy a fewer amount of beams can be used and as a result the radiation dose to the tumor can beincreased with a lower ratio of the dose distributed in healthy tissue. This is the major advantage of usingcharged particle therapy over normal x-ray therapy, but only a small fraction of radiotherapy patients,about 0.8%, are treated with protons, carbon ions or other heavy particles [3].

This naturally begs the question as of why so few patients are treated with charged particle therapy

2

Page 11: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

even though the dosimetry benefits are so extensive. Two of the reasons are unproven clinical data andrange uncertainties when using protons and heavy ions. However, the main opposition against using andbuilding new charged particle therapy centers is the cost [4]. A facility that combines proton therapy withion-therapy, so called combined centers, is the most costly [4]. These combined centers have a total costof 36.7 millione per year while a pure proton facility has yearly costs of 24.9 millione and a standardx-ray clinic that uses photons only has total yearly costs of 9.6 millione [4]. This results in yearly coststhat is 3.8 times higher for a combined proton and ion-facility and 2.6 times higher for a proton clinic ascompared to a standard photon facility.

2.1 Monte Carlo MethodsWhen simulating hadron therapy and nuclear interactions a large amount of calculations need to be exe-cuted. A common method to use in such cases is the Monte Carlo method.

Monte Carlo Methods or techniques is a numerical method to solve equations or integrals based onrepeated random number sampling [5]. Monte Carlo techniques are used in many different social sciencesand it can thus be applied in many different ways. You could describe it as a solution to a macroscopicsystem through simulations of microscopic interactions. As of 2011 about 300.000 papers have beenpublished on Monte Carlo methods, the portion of papers focused on medicine were about 10% [5].

Monte Carlo techniques have always been popular when it comes to particle physics, during the 1930sand the 1940s Monte Carlo methods were extensively used to develop mass destruction weapons such asthe atomic bomb [5]. However, over the last decades major breakthroughs have been made when it comesto the use of Monte Carlo methods in medical physics. Monte Carlo radiation transport algorithms havehad a big impact when it comes to radiation dosimetry [1]. When concluding experiments it is almostimpossible to determine the absorbed dose without using numerical methods [1]. Despite the recentbreakthroughs there is still room for improvement. There are many uncertainties that have not yet beenresolved, for example how the underlying nuclear reactions work [1]. The level of agreement betweendifferent models when it comes to particle prediction methods is reassuring, but the amount of experimentdata is not enough to provide a definite conclusion of what model or method is the best one [1].

Monte Carlo models are proving to be an essential tool when it comes to designing and constructingTreatment Planning Systems [1]. Monte Carlo models are used in all steps when designing a new hadrontherapy facility. First and foremost Monte Carlo methods are used to model the linear accelerators andthe beam line delivery system, but lately they have also been crucial when it comes to treatment roomdesign, shielding and overall protection from harmful radiation [1]. Monte Carlo methods are superior totraditional techniques in many ways, they can be summarized according to

• Monte Carlo techniques are able to consider advanced patient anatomy by using information fromCT-scans and other modalities [1].

• Monte Carlo methods can, while simulating use a more realistic model regarding the compositionof the human body. Traditional methods often use a water-equivalent method [1].

• Monte Carlo methods take into account the particle and nuclear interactions and can describe howboth the primary beam works and how the secondary particles behave [1].

There are several codes available to use for people interested in simulating proton and heavy ion therapy.The systems most commonly used are FLUKA, Geant4, MCNPX, VMCpro, and Shield-Hit. These codescan be different in some ways, the accuracy can vary and some systems have a well developed graphicaluser interface while some does not have a user interface at all [5].

3

Page 12: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

2.2 Bragg PeakA Bragg curve is a curve describing how dose is distributed as the particles pass through matter. Bylooking at the Bragg curve one can locate the Bragg peak. The Bragg peak is a phenomenon that occursat the end of the particle range when using charged protons and charged Carbon 12 ions [6, 7]. As seenin figure 1 a majority of the dose is distributed at the end of particle range due to the sharp Bragg peak.By utilizing the Bragg peak of protons and carbons one can concentrate the dose to the tumor in a moreefficient way.

2.2.1 Spread-out Bragg peak

By using different beam shaping devices, such as energy absorbers or modulators, a spread-out Braggpeak (SOBP) can be created [6]. The SOBP can be seen as an extension of the Bragg peak. By using theBragg peak of several beams, a larger SOBP can be created and thus a uniform dose distribution can beachieved at the target volume [7].

2.3 Linear Energy TransferLinear energy transfer is the amount of energy an ionizing particle transfers to the target medium as afunction of distance travelled [8]. It describes the action of radiation into matter. Linear energy transferis by nature a positive quantity and depends on the particle, the particle energy and the target material [8].

2.4 Geant4Geant4 is a toolkit developed by physicists and software engineers from all around the globe, it is im-plemented with C++ code using an object oriented approach [9]. It offers a possibility to simulate howparticles behave as they pass through matter. It contains an extensive package of functions, includingbut not limited to geometry, tracking hits and physic models. This presents a possibility to simulate awide range of different processes like hadronic, decay and electromagnetic. To enable the user to suit thesimulation to mimic the reality as close as possible, there is an extensive number of different materials,particles and elements. The energy range spans from 250 eV all the way up to TeV if needed.

Geant4 separates itself from earlier versions of Geant in theway it handles the particlemovement. Thesimulated particles are not moving by themselves but rather being transported in small steps. This allowsGeant4 to handle all particles in the same way independent of what kind of particle it is [9]. Everythingthat happens as the particle moves is then applied as the particle makes a step. The step is a time ratherthan a length for particles at rest. The particle is affected by different physical phenomenons in threedifferent stages: At rest, along step and post step. The length of a step is chosen as the shortest of eithera maximum allowed step set by the user, or a step length set by the actions of the processes that happenwhen the particle is transported [9].

Geant4 comes with many pre-compiled examples allowing the user to simulate a wide variety of dif-ferent applications. The examples range from basic physical processes to advanced medical applications,such as the example made to simulate hadron therapy [9].

2.4.1 The hadron therapy example

Hadron therapy is an advanced example inside Geant4 and is included as a standard example when in-stalling Geant4 [10]. The main focus is to provide a tool that addresses different needs in proton andion therapy. The different use cases can be the calculation of dose distribution in a water phantom, stop-ping powers for different geometrical setups and different materials, or the complete simulation of a real

4

Page 13: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

transport beam-line for hadron therapy [10]. In later versions linear energy transfer, LET, and relativebiological effectiveness can be calculated for simple setups. The example includes 21macros that demon-strates the different use cases. One macro demonstrates how proton and carbon 12 projectiles can be used.Other macros used shows how to visualize the simulation or how to modify the detector geometry. Bymodifying different parameters in the macros, the user can, at a basic level change the particle energyand at a more advanced level modify the detector geometry and other parameters [10]. To help with un-derstanding and navigating these different macros the responsible publishers have provided readme filesinside the program, and those are complemented by a web page explaining the general functions [10].

After a completed run of the program, the user will get a Dose.out file. The Dose.out file is in ASCII-format, a character encoding standard for electronic communication, and contains the dose distributed inthe phantom. This file can be analyzed to see how different parameters in the macro effects the distributeddose as a function of distance travelled in the phantom. The user can via a command tell the Dose.out filealso to contain information about the dose distributed by secondary particles, if a more complex analysisis desired [10]. The user can also use a command that tells the program to produce a Let.out file aftersimulating, that contains information about the linear energy transfer [10]. Two basic scripts for analysisin ROOT are included.

2.4.2 Detector and phantom geometry

The standard phantom used in the hadron therapy example is a water phantom. This is simply becausea water phantom represents the composition of the human body in a good enough way to draw con-clusions when doing simple simulations [10]. A detector is placed inside the water phantom with anadjustable voxel region and an adjustable voxel size. The standard setup uses a water phantom withdimensions 40x40x40cm and detector dimensions 4x4x4cm. The voxels inside the detector have dimen-sions 0.1x40x40mm.

2.5 ROOTROOT is a program developed by Cern to be used for analysis of large amounts of data. It is, similarto Geant4, written mainly in C++ and is object oriented, but it also uses other languages such as Pythonand R. The program is built using a class hierarchy in many layers currently containing more than 250classes arranged in around 20 frameworks and split into 9 different categories [11, 12]. ROOT is suitableto use together with Geant4 as ROOT scripts can be directly implemented in the Geant4 code, makingthe analysis of data streamlined.

5

Page 14: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

3 Method

All simulations using Geant4 and all analysis using ROOT were executed on Ubuntu (Canonical Ltd./Ubuntu Foundation, London, England) version 19.10. Version 10.5, releasedDecember 7 2018, of Geant4(Geant4 Collaboration) was installed and the advanced simulation example hadron therapy was compiled.The structure and hierarchy of files were then studied to get a better understanding of both the Geant4file-system but mainly the hadron therapy example structure. The data analysis framework ROOT (ReneBrun and Fons Rademakers, Lausanne, Schweiz) Release 6.16/00 – 2019-01-23 was installed.

3.1 SimulationsAs a start, the hadron therapy example was simulated using the standard macros provided. The macrosincluded a large amount of parameters that could be modified, an example of such parameters could beseen in figure 3. By changing what seemed to be the most basic parameters, for example beam energyor particle type, the changes in distributed dose, distance travelled and Bragg peak appearance couldbe studied. Comparing the results in the Dose.out file as a result of the parameter changes helped tounderstand what impact each parameter had. Redundant parameters were removed and comments wereadded to the code in order to explain relevant parameters. After initial simulations with the standardmacro, two separate macros were used, one for proton projectiles and one for Carbon 12 projectiles.

Figure 2: Phantom and detector geometry that was used for proton and carbon 12 projectiles. The redoutlines represented the water phantom and the detector was placed in the middle of the phantom.

6

Page 15: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

Figure 3: Example of how a fraction of the standard macro looked like for a proton beam line.

3.1.1 Proton projectiles

A water phantom with dimensions 40x40x40cm were irradiated with proton projectiles. Inside the phan-tom, a detector with dimensions 40x4x4 cm was placed. The voxel size was 0.1x40x40 mm. Simulationswere made with energies spanning from 60-260 MeV with an increment of 10 MeV per run, resulting ina total of 21 simulations. For each energy the source did irradiate 20.000 beams. The Dose.out files fromeach simulation were saved. The Let.out file was saved for the energies 60, 100, 140, 180, 220 and 260MeV. The Dose.out and Let.out files were analyzed at the energies 100 MeV and 180 MeV.

3.1.2 Carbon 12 projectiles

The same phantom used for protons were irradiated with Carbon 12 projectiles (figure 2). The macrocould simulate for energies∼750MeV and above. The source did irradiate 15.000 projectiles with energy3000 MeV. The Dose.out and Let.out file were saved for analysis.

3.2 AnalysisTwo ROOT scripts for analyzing the distributed dose as a function of distance travelled in the phantomwere created. The user was prompted to enter the filename of the file to analyze and was then presentedwith a graph containing the distributed dose as a function of distance travelled. One script showed the

7

Page 16: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

dose in Gy while the other script showed the normalized dose. The dose was normalized in one of thescripts between 0 and 1 using the following formula

zi =x(i)−min(x)

max(x)−min(x)(1)

where x = (x1, ..., xn). An example could be seen in figure 1. Normalization could be desired whencomparing several Dose.out files or when comparing the simulated dose to real world data.Another script for analyzing the linear energy transfer was created. The script shows the linear energytransfer as a function of distance travelled in the phantom.

3.3 Modification of the hadron therapy exampleTwo new macros were created, one for simulating proton projectiles and one for simulating Carbon 12projectiles. The new macros were based on already existing macros created for proton and carbon 12simulations, but with redundant parameters removed and with comments added to the code making iteasier to understand. All macros originally included in the example were removed, keeping only the twonewly created. The purpose with the new macros was to cover all relevant uses for proton and carbon 12simulations. Existing macros were analyzed one by one, and the macros not relevant for proton or carbon12 simulations were removed. Macros that showed examples of how to modify phantom and detectorgeometry were implemented in the new macros. Other macros that did not contribute to simple protonand carbon 12 simulations, for example beam lines with electromagnetic fields, were removed.

A new folder was created where all the simulation outputs were placed. Inside the simulation outputsfolder, the analysis scripts were placed.

8

Page 17: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

4 Results

A majority of the time was spent to understand the program better. The modification of the program waspossible after an extensive review of the file structure, file hierarchy and macro parameters. The completemodified example along with a simple user guide can be found in appendix A.

4.1 Proton projectilesAll simulations with protons were executed without complications. The simulations were executed withthe new macro created for proton projectiles.

0 10 20 30 40 50 60 70 80Distance Travelled (mm)

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

2.2

6−10×

Do

se

(g

y)

Distributed dose

Figure 4: The phantom were irradited with 100 MeV proton projectiles seen in figure 2.

0 20 40 60 80 100 120 140 160 180 200 220 240Distance Travelled (mm)

0

0.5

1

1.5

2

2.5

6−10×

Do

se

(g

y)

Distributed dose

Figure 5: The water phantom were irradiated 180 MeV protons projectiles seen in figure 2.

9

Page 18: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

By studying figure 4 and figure 5, some simple deductions could be made. By raising the energy from100 MeV too 180 MeV, the Bragg peak moved approximately 13.5 cm further into the phantom. Thedose at the top of the Bragg peak was also increased slightly, from ∼ 2.2 ∗ 10−6 Gy to ∼ 2.5 ∗ 10−6 Gy.

0 10 20 30 40 50 60 70 80Distance Travelled (mm)

0

5

10

15

20

25

30

35

40

Sto

pp

ing

po

we

r (M

eV

/mm

)

LET

Figure 6: Linear energy transfer for 100 MeV proton projectiles.

0 20 40 60 80 100 120 140 160 180 200 220 240Distance Travelled (mm)

0

10

20

30

40

50

60

Sto

pp

ing

po

we

r (M

eV

/mm

)

LET

Figure 7: Linear energy transfer for 180 MeV proton projectiles.

According to figure 6 and figure 7 the linear energy transfer showed similar results. The linear energytransfer curve had the same characteristics as the Bragg curve. For higher energies, the linear energy trans-fer peak moved further into the phantom and the stopping power was subsequently higher. The resultsshowed that the macro made for proton projectiles worked in a desired way. The macro modificationswas successful and worked for energies used in real world applications.

10

Page 19: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

4.2 Carbon 12 projectilesSome complications arose when creating the new macro for Carbon 12 projectiles. Energies below 750MeV showed unexpected results due to limitations in the Geant4 hadron therapy example. Projectileswith energies below 750 MeV did not produce any data in the water phantom. Energies above 750 MeVproduced worked as expected. Figure 8 showed a sharper Bragg Peak than proton projectiles.

0 20 40 60 80 100 120 140Distance Travelled (mm)

0

0.05

0.1

0.15

0.2

0.25

3−10×

Do

se

(g

y)

Distributed dose

Figure 8: Distributed dose a water phantom irradiated with Carbon 12 projectile in figure 2, the energywas 3000 MeV.

4.3 AnalysisNew scripts were created and included in the Geant4 package. The purpose of these scripts was to analyzedistributed dose and linear energy transfer.With normalized dose, as seen in figure 9, the user could if desired plot multiple simulations in the samegraph, thus showing how they differ from each other in a distinct way.

4.4 Modification of the hadron therapy exampleThe creation of a new macro for proton projectiles were successful. The macro for Carbon 12 projectilesworks for energies above ∼750 MeV, however both are included in the modified build. A less clutteredfile system was achieved. The analysis scripts were automatically included in the simulation outputsfolder.

11

Page 20: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

0 20 40 60 80 100 120 140 160 180 200 220 240Distance Travelled (mm)

0

0.2

0.4

0.6

0.8

1N

orm

aliz

ed

do

se

Distributed dose

Figure 9: The same simulated data as in figure 5 but with normalized dose, normalization executed withequation 1.

12

Page 21: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

5 Discussion

Hadron therapy started as a concept in the 1950s, making a it relatively new concept and therefore, theinformation available is slim. The companies that do actual hadron therapy treatments are very protectiveand secretive about their data, therefore there is a problem confirming if the data that was collected viathe simulations is in any way resembling the values from a real hadron therapy session. By extension thismeans that the only data available for comparison was similar simulations provided by our supervisor,naturally our collected data appeared to be correct since it was referenced against data acquired in thesame program without any major changes in how the physics were treated.

The lack of data could be due to the fact that there are so few clinics that perform hadron therapy, orbecause we are early in the development of the concept that there is a value in not providing competitorswith data. Companies and researchers are trying to establish their own brands on the market instead ofsharing relevant data.

Something that was much more expensive time-wise then expected was getting started with Geant4, bothparticipants in this bachelors thesis had to change operating systems fromWindows to Linux. Other thanthat installing Geant4 as well as choosing which packages and options that should be included requiredextensive research. Furthermore once the program was up and running, the internal documentation ex-plaining the code were subpar. The readme files and the wikipage are also outdated, referring to macrosthat no longer are included in the Geant4 package, explaining functions that were removed or changed.The result of this is that when you want to change a lot of the parameters in the simulation, you haveto start with guessing, alternatively testing all the parameters one by one until it is clear what should bechanged in order to achieve the desired results.

5.1 SimulationsAll simulations and modifications were made with the intention to help beginners and clinics interested insimulating hadron therapy. Therefore it was necessary to execute simple simulations, and the result fromthose simulations were then used when modifying the program. In order to modify the program a lot oftime was spent trying to understand the program structure and macro parameters. Due to the nonexistentor lack of information mentioned above, a lot of time was spent changing single parameters in order tounderstand the impact they had. By looking at figure 3 you can understand why new users get confusedand does not know what to change or how to change the parameters. A few parameters does not needany change at all, while some parameters can be changed in between every simulation. For example theparameters controlling the beam canon position or the beam angle can be left as it is.

In addition to the many parameters available, there are 21 macros included in the hadron therapyexample. Because of the lack or incorrect information about each macro, all of them had to be testedindividually. The results from each macro were then studied and macros that produced irrelevant data ormacros that were too advanced were deleted. This can save a lot of time and confusion for new users.

Themain use of the hadron therapy example is to simulate proton and Carbon 12 ion therapy, thereforethe main focus was to create macros suited for such use. The most interesting parameter to change isarguably the particle energy, for that reason, the focus was to create scripts that could simulate energiesused in real world applications. Another important topic was to create macros that could simulate relevantenergies without changing the phantom or detector geometry. The setup in figure 2 is suitable for allnormal use cases.

The data visualized in figure 4 and figure 5, namely distributed dose as a function of distance travelledin the phantom, is the most common use case of Geant4 hadron therapy simulations. Not only because ofthe distributed dose, but because of how the Bragg peak looks. A natural extension of simple dosimetry

13

Page 22: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

analysis is the analysis of linear energy transfer, both of the parameters help to determine how dangerousthe treatment can be for a patient. Figures 6 and 7 show the Linear Energy Transfer. The linear energytransfer curves follow the dose curves and that is a natural behavior. As the dose curve peaks and depositsmost of its energy the power needed to stop the projectiles is naturally higher.

For Carbon 12 projectiles, the data showed poor results due to some limitations in the hadron therapyexample code. When lowering the energy below a threshold (∼750 MeV), the projectiles could notpenetrate certain objects along the beam line. Due to limitations in the code, the program crashed whenaltering parameters that control the objects along the beam line. The objects along the beam line that canbe modified to allow projectiles to penetrate are for example modulators or collimators.

The simulations we were able to conclude however, showed expected results. Carbon 12 projectileshad a sharper Bragg Peak than protons according to figure 8 and can thus be even more effective forcancer treatment. Due to the sharper Bragg Peak, the energy can be concentrated to the tumor in a moreprecise way.For protons the simulations included energies between 60-260 MeV, while carbon 12 simulations onlyused one energy, 3000 MeV. When simulating with carbon 12, 3000 MeV is the total energy used, butsince the carbon 12 particles consists of 12 separate nucleons, the energy per nucleon is 3000

12 = 250MeV. The script for carbon 12 simulations were completed late in the project and that in combinationwith longer simulation times for carbon 12 projectiles, only one simulation could be completed.

5.2 AnalysisThe scripts that were developed with the purpose of analyzing the data were first and foremost writtenwith simplicity in mind. The reasoning behind this approach was that we believe the main purpose ofsimulations is that they should be used as a way of calculating the dose distribution prior to a treatment.In order to facilitate the usage of Geant4 and ROOT as medicinal analytic tools, there is a need to suit itto practitioners without an education that includes programming. A good and easy way to do this is toimprove the interface and make it more intuitive, and minimize the amount code that needs to be writtenin order to get the desired result. Other than enabling users without or with very little programmingcapability’s this will also make the programs easier to use as a whole. This will result in a learning curvefor new user that is not as steep. New users will in a much shorter time be able to feel comfortable withand master the simulation tools, enabling these user to train other new users. This should in the longrun mean that the process can be optimized as the different tasks can be split between more and moreoperatives, and thus a larger amount of patients can be treated in the available time. These scripts are, incomparison to the standard analysis scripts, much easier to use and work in a better way.

A script that can be useful for more experienced users is the script that normalizes the dose. Anexample can be seen in figure 9. The purpose of that script is to give the user a way of normalizingvalues in order to compare multiple simulations against each other, or to compare the simulation data toreal world data. Scripts for analysis was a natural extension of the original program and was a welcomemodification to help new users.

5.3 Modification of the hadron therapy exampleThe new macros we have completed allow new users execute simulations using both proton and Carbon12 projectiles. With the inclusion of new macros combined with a less cluttered file structure, new usersmight not be overwhelmedwith options and could consequently focus on simple and relevant simulations.With the analysis scripts placed inside the simulation outputs folder, the user can evaluate their simulateddata as soon as the simulation is done.

14

Page 23: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

5.4 Possible improvements and future workIn order to improve this report acquiring some data from an experiment executed in the real world wouldhave been instrumental. This will make it easier to know, whether the values achieved through simulationsis even remotely close to how the ions behave in actuality. Data of this nature is also necessary to knowwhether or not we are successful with the second part of our aims, to implement code that can simulatenuclear interactions at low energies with Carbon 12 projectiles.

The interface is improved, but there is still some code necessary every time one wants to run a simula-tion. If one is to allow hospitals to use it freely, one should strive to create an interface that is built aroundjust stating the desired values and clicking buttons, an interface that is completely free from any coding.Something else that needs improvement in the future is the fact that the included Carbon 12 macro onlyworks in the higher energy regions. So further work should be to modify the macros or the basic codeitself in order to get a Carbon 12 simulation that presents correct results for lower energy settings.

The changes made can hopefully contribute to further research and development at the KTH Depart-ment of Physics. A Masters Degree project could for example use the modified hadron therapy exampleas a starting point. Further improving the possibility to use Geant4 as a tool to simulate hadron therapy,and get results that is consistent with how hadrons behave when used in hadron therapy treatments.

15

Page 24: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

6 Conclusion

One aim with the project was to make Geant4 easier to use. This goal met, a new structure, macros andanalysis scripts are implemented and accessible.

The implementation of code that produced expected results for Carbon 12 projectiles at low energies wasunsuccessful, as the program stopped working when changes were made in the code.

16

Page 25: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

7 References

[1] G Battistoni, I Mattei, and S Muraro. Nuclear physics and particle therapy. Advances in Physics:X, 1(4):661–686, 2016.

[2] What is Hadron Therapy? | The European Network for Light ion Hadron Therapy, Mar 2019.[Online; accessed 25. Mar. 2019].

[3] Marco Durante and Harald Paganetti. Nuclear physics in particle therapy: a review. Reports onProgress in Physics, 79(9):096702, 2016.

[4] Andrea Peeters, Janneke PCGrutters, Madelon Pijls-Johannesma, Stefan Reimoser, Dirk De Ruyss-cher, Johan L Severens, Manuela A Joore, and Philippe Lambin. How costly is particle therapy?cost analysis of external beam radiotherapy with carbon-ions, protons and photons. Radiotherapyand Oncology, 95(1):45–53, 2010.

[5] Joao Seco and Frank Verhaegen. Monte Carlo techniques in radiation therapy. CRC press, 2013.

[6] Harald Paganetti and Michael Goitein. Radiobiological significance of beamline dependent protonenergy distributions in a spread-out bragg peak. Medical physics, 27(5):1119–1126, 2000.

[7] Tatsuaki Kanai, Yoshiya Furusawa, Kumiko Fukutsu, Hiromi Itsukaichi, Kiyomi Eguchi-Kasai,and Hiroshi Ohara. Irradiation of mixed beam and design of spread-out bragg peak for heavy-ionradiotherapy. Radiation research, 147(1):78–85, 1997.

[8] Report 85. Journal of the International Commission on Radiation Units and Measurements,11(1):NP–NP, 04 2011.

[9] Sea Agostinelli, John Allison, K al Amako, John Apostolakis, H Araujo, P Arce, M Asai, D Axen,S Banerjee, G Barrand, et al. Geant4—a simulation toolkit. Nuclear instruments and methodsin physics research section A: Accelerators, Spectrometers, Detectors and Associated Equipment,506(3):250–303, 2003.

[10] AdvancedExamplesHadrontherapy<Geant4<TWiki, May 2019. [Online; accessed 2.May 2019].

[11] Rene Brun and Fons Rademakers. Root—an object oriented data analysis framework. NuclearInstruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectorsand Associated Equipment, 389(1-2):81–86, 1997.

[12] ROOT aData analysis Framework |ROOT aData analysis Framework, Apr 2019. [Online; accessed3. Apr. 2019].

17

Page 26: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

18

Page 27: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

Appendices

A Modified hadron therapy example and user guideThe complete modified hadron therapy for Geant4 example can be found on the following GitHub link:https://github.com/emilekelund/Geant4-project

User guide:

1. Install the latest version of Geant4 and ROOT. When installing Geant4, some extra options canbe passed to the CMake command. We recommend using the commands to install the Geant4datasets, the multithread option to ON for faster simulations and the option to use OPENGL_X11for visualizing the simulations. Instructions are available at the following links,Geant4 instructionsROOT instructions

2. Download the modified hadron therapy example above and compile it like any other Geant4 ex-ample.

3. Execute a simulation with one of the two macros included. The proton.mac simulates proton pro-jectiles and carbon.mac simulates carbon 12 projectiles.

4. The data from your simulation can now be found in the SimulationOutputs folder. Along with thedata you can find three scripts for analysis.

5. To analyze your data, open a terminal window inside the SimulationOutputs folder. Start ROOTand execute the analyze script of your choosing.

The following YouTube video shows steps 2-5: https://youtu.be/uU-wJ8CYdmM

1

Page 28: Geant4 Simulations of Hadron Therapy and Refinement of ...kth.diva-portal.org/smash/get/diva2:1331415/FULLTEXT01.pdf · DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM

TRITA CBH-GRU-2019:061

www.kth.se