Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

The TOPAS Tool for Particle Simulation

making Monte Carlo particle transport simulation


accessible to the busiest physicist
Joseph Perl - TOPAS MC Inc and SLAC National Accelerator Laboratory

Bruce Faddegon, José Ramos - University of California San Francisco

Harald Paganetti, Jan Schümann, Jungwook Shin,

Aimee McNamara, David Hall - Massachusetts General Hospital

University of Wollongong, 20 September 2017

Work supported by the U.S National Institutes of Health under contract numbers 1R01CA140735-01 & 2R01CA140735-05
and by TOPAS MC Inc
Tool for Particle Simulation

4D 100s of users in
academic research
& industry

world wide

Fully Multithreaded!
20 September 2017 TOPAS J. Perl 2
TOPAS User
Application Parameter File
( C++ ) ( text file )
Uses and Extends provides user's
Geant4 for Radiation customization of
Therapy simulation parameters

Other Other
Parameter Files Parameter Files
( text file ) ( text file )
additional simulation additional simulation
parameters parameters

Other
Geant4 Parameter Files
Simulation ( text file )
additional simulation
Toolkit parameters
( C++ )
Standard Geant4 Geant4 Data
Files etc.
Standard Geant4 parameter file
Physics Cross- hierarchy may be
Section Data Files arbitrarily complex

20 September 2017 TOPAS J. Perl


20 September 2017 TOPAS J. Perl
20 September 2017 TOPAS J. Perl
IBA Nozzle at MGH, Boston

20 September 2017 TOPAS J. Perl


Highly Flexible: Configure Pre-Built Components
UC San Francisco - Crocker Nuclear Laboratory Propeller

Massachusetts General Hospital - IBA RMW

Samsung Medical Center - Sumitomo Ridge Filter MLC

20 September 2017 TOPAS J. Perl 7


Cobalt Therapy

AlcyonII with M. Diagne, Senegal


20 September 2017 TOPAS J. Perl 8
Change Parameters, not Code
Each of those little movies was done with the exact same complied code.
The code is built by us, tested formally, and tested by many users.
The user doesn’t have to write this code or understand Geant4.

What was different from one of those examples to the next was what set
of “parameter files” that drove it.

Parameter Files specify everything:


• Geometry
• Particle Sources
• Physics
• Scoring
• Graphics
• Time Features
Achieves Ease-of-Use with minimal sacrifice to Flexibility.
A construction set where the pieces fit together easily, intuitively.
Encourages creativity.

20 September 2017 TOPAS J. Perl 9
It’s not just about the learning curve

It’s about Reliability

20 September 2017 TOPAS J. Perl 10


Control by simple text Parameter Files
One or more lines, each setting some parameter:

Ge/BigBox/Material = “Air” # filling box with air

Ge/World/Invisible = “True”

Ge/Phantom2/NumberOfVoxelsX = 2

Ge/BigBox/HLX = 4. m

Gr/View1/Zoom = 2.5

20 September 2017 TOPAS J. Perl 11


Control by simple text Parameter Files
One or more lines, each setting some parameter:

s:Ge/BigBox/Material = “Air” # filling box with air

b:Ge/World/Invisible = “True”

i:Ge/Phantom2/NumberOfVoxelsX = 2

d:Ge/BigBox/HLX = 4. m

u:Gr/View1/Zoom = 2.5

20 September 2017 TOPAS J. Perl 12


Control by simple text Parameter Files
One or more lines, each setting some parameter:

s:Ge/BigBox/Material = “Air” # filling box with air

b:Ge/World/Invisible = “True”

i:Ge/Phantom2/NumberOfVoxelsX = 2

d:Ge/BigBox/HLX = 4. m

u:Gr/View1/Zoom = 2.5

dv:Ge/RMWLexan_Brass/Angles= 4 69.11 92.29 111.04 126.02 deg

And simple ways to add, multiply, etc.:


Ge/Compensator/ZTrans = Ge/Aperture/DistalEdge +
Ge/Compensator/HLZ mm
20 September 2017 TOPAS J. Perl 13
Control by simple text Parameter Files
One or more lines, each setting some parameter:

s:Ge/BigBox/Material = “Air” # filling box with air

b:Ge/World/Invisible = “True”
Line
orde
i:Ge/Phantom2/NumberOfVoxelsX = 2 r do
esn
’t m
atte
d:Ge/BigBox/HLX = 4. m r

u:Gr/View1/Zoom = 2.5

dv:Ge/RMWLexan_Brass/Angles= 4 69.11 92.29 111.04 126.02 deg

And simple ways to add, multiply, etc.:


Ge/Compensator/ZTrans = Ge/Aperture/DistalEdge +
Ge/Compensator/HLZ mm
20 September 2017 TOPAS J. Perl 14
s:Ge/MyBox/Type="TsBox" 100 Protons into Simple Box of Air
s:Ge/MyBox/Material="Air"
s:Ge/MyBox/Parent="World"
d:Ge/MyBox/HLX= 20. cm
d:Ge/MyBox/HLY= 10. cm
d:Ge/MyBox/HLZ= 30. cm
d:Ge/MyBox/TransX=0. m
d:Ge/MyBox/TransY=0. m
d:Ge/MyBox/TransZ= .5 m
d:Ge/MyBox/RotX=0. deg
d:Ge/MyBox/RotY=0. deg
d:Ge/MyBox/RotZ=0. deg

20 September 2017 TOPAS J. Perl 15


s:Ge/MyBox/Type="TsBox" 100 Protons into Divided Box of Water
s:Ge/MyBox/Material="Water"
s:Ge/MyBox/Parent="World"
d:Ge/MyBox/HLX= 20. cm
d:Ge/MyBox/HLY= 10. cm
d:Ge/MyBox/HLZ= 30. cm
d:Ge/MyBox/TransX=0. m
d:Ge/MyBox/TransY=0. m
d:Ge/MyBox/TransZ= .5 m
d:Ge/MyBox/RotX=0. deg
d:Ge/MyBox/RotY=0. deg
d:Ge/MyBox/RotZ=0. deg
i:Ge/MyBox/XBins = 3
i:Ge/MyBox/YBins = 4
i:Ge/MyBox/ZBins = 8

20 September 2017 TOPAS J. Perl 16


Hierarchical Control System
User File
Overall control

Nozzle
Definition

Default File
Basic definitions

20 September 2017 TOPAS J. Perl


Hierarchical Control System
User File
Overall control

Gantry 1 Gantry 2
Nozzle details Nozzle details

Nozzle
Definition

Default File
Basic definitions

20 September 2017 TOPAS J. Perl


Hierarchical Control System
User File
Overall control

Patient or Phantom
CT file names, etc.
Gantry 1 Gantry 2
Nozzle details Nozzle details

General Patient
handling parameters,
HU conv. tables, etc. Nozzle
Definition

Default File
Basic definitions

20 September 2017 TOPAS J. Perl


Hierarchical Control System
User File
Overall control

Patient or Phantom Flat Panel Imager


CT file names, etc. Customization
Gantry 1 Gantry 2
Nozzle details Nozzle details

General Patient
handling parameters, Flat Panel Imager
HU conv. tables, etc. Nozzle Definition
Definition

Default File
Basic definitions

20 September 2017 TOPAS J. Perl


Hierarchical Control System
User File
Overall control

Patient or Phantom Flat Panel Imager


CT file names, etc. Customization
Gantry 1 Gantry 2
Nozzle details Nozzle details

General Patient
handling parameters, Flat Panel Imager
HU conv. tables, etc. Nozzle Definition
Definition

Vendor confidential
information is nicely
Default File encapsulated into
Basic definitions distinct parameter files

20 September 2017 TOPAS J. Perl


Patient Workflow
A script converts some
patient-specific information
from our TPS into
TOPAS parameter files User File
Overall control

Patient or Phantom Flat Panel Imager


CT file names, etc. Customization
Gantry 1 Gantry 2
Nozzle details Nozzle details

General Patient
handling parameters, Flat Panel Imager
HU conv. tables, etc. Nozzle Definition
Definition

Vendor confidential
information is nicely
Default File encapsulated into
Basic definitions distinct parameter files

20 September 2017 TOPAS J. Perl 22


Liver Study - Dose
TPS - Pencil Beam

0-

Difference

TOPAS - Monte Carlo


“Component” - an extra layer in geometry
beyond solid, logical vol, physical vol
Simple Components

Specialized Components
compensator
aperture
range mod wheel
wire chamber
propeller
patient
group

20 September 2017 TOPAS J. Perl 24


DICOM including RTStruct

20 September 2017 TOPAS J. Perl 25


Particle Sources
Any particle type including Heavy Ions

Parameterized source

Phase Space Input

Twiss source

Will soon start adding Brachytherapy seeds (collab. w Univ Laval)

20 September 2017 TOPAS J. Perl 26


Physics Models
Defaults to standard best for proton therapy

But can select any of dozens of Geant4 Reference physics lists


or can build a Geant4 Modular physics list

Heavy Ion therapy is fully supported


As are the nano-scale processes of the Geant4-DNA extension

20 September 2017 TOPAS J. Perl 27


Scoring
Dose, Fluence, Surface Current, etc. All with statistical information.

Phase Space Output

Filter by

particle type,
energy,
creator process,
origin volume,
ancestor attributes,
etc.

20 September 2017 TOPAS J. Perl 28


4D Everywhere

4D in motion
4D in component size
4D in magnetic and electric fields
4D in source position, characteristics and beam current
4D in VR, splitting planes, directional biasing, etc.
4D in scoring
4D in visualization

20 September 2017 TOPAS J. Perl 29


20 September 2017 TOPAS J. Perl 30
20 September 2017 TOPAS J. Perl
20 September 2017 TOPAS J. Perl 33
Time Features
0 sec 2.0 sec 3.4 sec 10.0 sec

d:Ge/Magnet/Strength
= 0.2 T

20 September 2017 TOPAS J. Perl 34


Time Features
0 sec 2.0 sec 3.4 sec 10.0 sec

d:Ge/Magnet/Strength
= Tf/Field/Value T

s:Tf/Field/Function = "Sine"
d:Tf/Field/StartTime =0.0 ms
d:Tf/Field/EndTime =100.0 ms
d:Tf/Field/Rate = 0.1 T/ms
d:Tf/Field/StartValue = 0.0 T

20 September 2017 TOPAS J. Perl 35


Simple
Raster
Scanning

20 September 2017 TOPAS J. Perl


Simple Raster Scanning

20 September 2017 TOPAS J. Perl 37


Tracking

a Moving
Target

20 September 2017 TOPAS J. Perl


Tracking a Moving Target

+
20 September 2017 TOPAS J. Perl 39
Tracking a Moving Target

+
20 September 2017 TOPAS J. Perl 40
Depth
Motion
Tracking

20 September 2017 TOPAS J. Perl


Lissajous

Dose distribution
Mean position of
protons every 0.5 ms

Whole paper in PMB just on this topic,


Jungwook Shin et. al.

20 September 2017 TOPAS J. Perl


20 September 2017 TOPAS J. Perl
4D scoring: 1D time-sliced histograms

20 September 2017 TOPAS J. Perl


Patient Calculation
Bottom line is accurate patient dose calculation.
Energy Deposit
Gamma index for 2mm and 2%
TOPAS vs previous MGH Geant4

Several publications on this topic, such as:



Jan Schümann et. al. in PMB
20 September 2017 TOPAS J. Perl 45
Liver Study - Dose
TPS - Pencil Beam

0-

Difference

TOPAS - Monte Carlo


Head and Neck Study - Dose
65 5
TPS - Pencil Beam Gy TOPAS - Monte Carlo Gy Difference

0 -5
Gy
10 beams (6 directions + 4 boost)
Head and Neck Study - DVH (Absolute)

ctv-primary - TOPAS
ctv-primary - TPS
ctv-combined - TOPAS
ctv-combined - TPS
RT Parotid - TOPAS
RT Parotid - TPS
LT Parotid - TOPAS
LT Parotid - TPS
Variance Reduction
Geometrical Splitting, Directional Splitting,
Importance Sampling, Weight Window,

See Medical Physics paper on this topic,



José Ramos-Méndez et. al.

20 September 2017 TOPAS J. Perl 49


Fully Multithreaded
TOPAS exploits the full Multithreaded capability of Geant4.
Our users can trivially adjust any TOPAS simulation to use
dozens or even hundreds of threads on a single computing node.

Work is automatically distributed among the threads and results


seamlessly collated.

Complex issues such as sharing a single phase space input file


among multiple threads are handled without the user having to
take any special action.

Just set a parameter:


i:/Ts/NumberOfThreads = 8 # How many threads to use

20 September 2017 TOPAS J. Perl 50


topasmc.org
We created a non-profit organization,
TOPAS MC Inc., to distribute TOPAS.
Over 280 registered users from 121 Institutions in 24 Countries.
including industrial users from most of the largest proton therapy vendors.
General paper from 2012 has surpassed 150 citations.
30 User Presentations just at AAPM 2017.

20 September 2017 TOPAS J. Perl 51


20 September 2017 TOPAS J. Perl 52
topasmc.org
And Yes, we charge most users for TOPAS.
That’s how I could afford this trip,
and all of the many 3rd party tools that make TOPAS so reliable.

We seek public & private funding to make TOPAS free for all non-profit users.
We hope to eventually become Open Source.
But for now we thrive and provide excellent user support by charging license fees.

20 September 2017 TOPAS J. Perl 53


Well-staffed User Forum

20 September 2017 TOPAS J. Perl 54


Github Issue Management

20 September 2017 TOPAS J. Perl 55


Travis CI Continuous Integration Testing

20 September 2017 TOPAS J. Perl 56


Meeting the challenges of quality control in the
TOPAS Monte Carlo simulation toolkit for proton therapy
DC Hall1, J Perl2, J Schuemann1, B Faddegon3 & H Paganetti1
www.topasmc.org
dchall@mgh.harvard.edu
1Massachusetts General Hospital & Harvard Medical School, 2SLAC National Accelerator Laboratory, 3University of California, San Francisco

Introduction
Monte Carlo particle transport (MC) simulation codes have become important tools in proton therapy
and biology, both for research and practice. TOPAS [1] is an MC software layered upon the Geant4
general-purpose toolkit, designed specifically for medical physics applications. It serves users worldwide
(224 licensed users at 98 institutions in 22 countries).

Main features:
§ reproducible simulations configured by user-friendly parameter files
§ geometry components, electromagnetic fields, particle sources and scorers are positioned in space
§ their parameters can be changed in time (e.g. a rotating modulator wheel, moving MLC leaves)
§ other settings are also available (e.g. graphics, physics, variance reduction)
§ a versatile extension system enables users to add new features as needed

Quality control (QC) of stochastic simulation software is inherently difficult, and the versatility of
TOPAS introduces additional challenges. But QC is vital as the TOPAS development team implements
new features, addresses user feedback and reacts to upgrades of the underlying software (i.e. Geant4). Figure 1. The MGH double scattering Figure 2. Parameter file demonstrating how to
treatment nozzle simulated in TOPAS. score the Bragg peak of a 150 MeV proton beam.

Frequent short regression tests


TOPAS development has recently adopted continuous integration and testing. Each time a change is committed to
the code repository, TOPAS is automatically built and tested on Travis-CI remote servers. Our build matrix consists of
§ two operating systems (Ubuntu 12.04 and OS X 10.9)
§ three Geant4 versions (9.6.p04, 10.1.p02, 10.2.p01)

Once TOPAS is built, 67 separate module tests are executed to check that various components are functioning. The
results of these tests are then quantitatively compared to those of the latest stable version. If any test fails, a
notification email is sent to the developer responsible for the change. Code coverage statistics highlight untested
portions of code and guide the development of new tests.
AAPM 2016 poster on Quality Control

Continuous integration and testing has proven effective in catching regressions at the time they are introduced. For
by David Hall et. al.
example, implementing a new feature that requires code refactoring might accidentally break a different feature
elsewhere. Automated testing on multiple operating systems is also important, since developers often only test
changes locally before committing. Figure 3. The TOPAS continuous integration dashboard.
20 September 2017 TOPAS J. Perl 57
ReadTheDocs Documentation System

20 September 2017 TOPAS J. Perl 58


20 September 2017 TOPAS J. Perl 59
20 September 2017 TOPAS J. Perl 60
Innov 2015
a tion in AAPM A
Me d i c ward
al Ph for

ysics
Educ
ation
Feedback from

Users
• Proved to be easy to learn (one day to comfort, two days to mastery)
• Easy to help our users (exchange of parameter files)
• Easy to simplify a problem into a test (simple parameter file)
• TOPAS users are a community that help each other and advance
together

20 September 2017 TOPAS J. Perl 62


Extensions Mechanism
Most TOPAS users will never need to write any compiled code.
They simply configure pre-built objects through the TOPAS Parameter Control System.
But for those that find limitations in what we already provide, we allow the user to plug in extensions.

TsExtension
Manager
We provide as skeleton.
User adds lines to call their
C++ extensions

UserWritten UserWritten UserWritten UserWritten UserWritten UserWritten


GeometryComponent PhysicsList VolumeScorer SurfaceScorer OutcomeModel Filter

User writes only parts above this line

TOPAS base classes do all the hard work

TsV G4V TsV TsV TsV TsV


GeometryComponent PhysicsList VolumeScorer SurfaceScorer OutcomeModel Filter

TsV
Scorer

TsParameter
Manager
Allows User Extensions to
exploit the TOPAS
Parameter Control System
20 September 2017 TOPAS J. Perl 63
20 September 2017 TOPAS J. Perl 64
20 September 2017 TOPAS J. Perl 65
• moving from the macro scale to the organ and cellular scale
nBio
• building in outcome models
• building in organ and cellular effect models, LET, RBE
• Geant4-DNA
• a multi-scale platform How can Geant4-DNA model
radiation biology ?
• not just for physicists but
 4

also for biologists Physics stage


step-by-step modelling of •  Excited water molecules
physical interactions of incoming •  Ionised water molecules
& secondary ionising radiation •  Solvated electrons
with biological medium (liquid
water)

Physicochemistry/chemistry stage
•  Radical species production
•  Diffusion
•  Mutual interactions

Geometry stage
DNA strands, chromatin fibres, chromosomes, whole cell nucleus, cells…
for the prediction of damages resulting from direct and indirect hits

Biology stage Biology stage


DIRECT DNA damages INDIRECT DNA damages (dominant @ low LET)

t=0 t=10-15s t=10-6s

20 September 2017 TOPAS J. Perl 66


20 September 2017 TOPAS J. Perl 67
TOPAS-nBio: THE DEVELOPMENT OF A MONTE CARLO
SIMULATION TOOLKIT FOR RADIOBIOLOGY
AL McNamara1, J Ramos-Mendez2, J Perl3, K Held1, B Faddegon2, H Paganetti1 & J Schuemann1
1.  Massachusetts General Hospital & Harvard Medical School, Boston, MA
2. University of California San Francisco, CA
3. Stanford Linear Accelerator Center, Menlo Park, CA

Purpose Results
Understanding how ionizing radiation Users interact with TOPAS-nBio through easy-to-use input parameter files and can design complex
radiobiology experiments. A comprehensive library of biological geometries have been developed for the
interacts with cells is vital for improving and
toolkit.
developing new cancer radiotherapies. A full
A.  Cell: TOPAS-nBio offers users an assortment of cell shapes and sizes, including irregularly shaped
description of the biological radiation
cells (e.g., fibroblasts). Users also have the option of adding organelles to the cell (e.g., cell
response requires detailed knowledge of not nucleus, mitochondria).
only the physical interactions within a B.  Nucleus: DNA is the primary target of radiation damage. Damage to DNA from radiation in the form
realistic cell geometry, but also an accurate of strand breaks and complex lesions is highly dependent on the folding hierarchy of the genome.
description of the radiochemical reactions Two models of chromosome territories are provided: a box model and a fractal walk model. Each

and biological processes initiated. territory is comprised of chromosome fibers arranged in either a “flower” geometry or fractal loops.
Each fiber further consists of a DNA double helix wrapped around histone proteins.
Computational radiobiology offers a
C.  Molecule: TOPAS-nBio provides users with an interface with which to read protein database (PDB)
powerful tool for quantitatively investigating
files, to allow simulation of radiation damage to nucleic acids and protein molecules. It also provides
the radiation interactions within the cell. models of plasmids and other simple DNA strand models.
Current codes, however, generally require D.  Neuron: TOPAS-nBio has the ability to read in geometry files from the extensive NeuroMorpho.org
advanced programming skills. Here we database, giving users the capability of simulating over 50000 different types of neurons. Since
present a new simulation tool, TOPAS-nBio, radiation damage to synapses may contribute to cognitive dysfunction, as observed in rodents,

that gives non-experts the ability to easily TOPAS-nBio also include several dendritic spine models.

develop radiobiology models. Spherical lymphocyte with cell Mitochondrion with spherical
nucleus (blue) and mitochondrial DNA (purple)
mitochondria (green). Proton and gold nanoparticles on the
track is shown in yellow. membrane. Proton track is
shown in yellow.

20 September 2017 TOPAS J. Perl 68


ability to easily
els. Spherical lymphocyte with cell Mitochondrion with spherical
nucleus (blue) and mitochondrial DNA (purple)
mitochondria (green). Proton and gold nanoparticles on the
track is shown in yellow. membrane. Proton track is
shown in yellow.

Cell Fibroblast cell with cell nucleus


mulations enable the (red) and mitochondria (green).

ondary electrons down to


ergy range significant for
AS1, a MC application,
ulation toolkit giving
skills the ability to model

Nucleus
nBio, extends TOPAS to
help bridge the gap
Nucleus with chromosome fibers arranged
PAS-nBio utilizes the in a fractal pattern to mimic chromosome
Chromosome loops in “flower” Chromosome fiber with double helix (yellow
territories (colored regions). Nucleus with chromosome territories.
arrangement. and black) wrapped around histones (blue).
f Geant4-DNA to model
ll (e.g. DNA strand
and molecular Molecules from the protein data bank (PDB) with atom
type represented by color.
the toolkit, since
Dinucleosome

Molecule
36O

dependent on the
0.34 nm

1 nm

2.3

ents. These geometries nm

RNA 1 nm
cells and organelles) to 2.37 nm
Circular plasmid model. Base pairs are shown in yellow
Simple DNA strand. Left: single
strand, right: double stand.
and sugar phosphate backbone in red and blue.
g., DNA and proteins).

Neuron
Spiny dendrite model
Neuron with soma with mushroom (red),
(red), axon (green), Mushroom spine
stubby (yellow) and
dendrites (blue and geometry with
thin (blue) spines as
yellow). Geometry ribosomes (black).
well as mitochondria
ers with a from NeuroMorpho
database.
(green). Proton track
20 September 2017 TOPAS shown in blue. J. Perl 69
arlo simulation tool
Tool for
Particle Simulation

To use Monte Carlo transport for radiation therapy research in the past, one had
to be both an expert in Monte Carlo and an expert in medical physics.

With TOPAS, it is sufficient to be an expert in medical physics or biology

TOPAS has been developed by:


David Hall
Bruce Faddegon
Aimee McNamara
Harald Paganetti
Joseph Perl
Jan Schümann
Jungwook Shin
José Ramos

Thank
You
NIH !!!!

TOPAS supported by the U.S National Institutes of Health under contracts



2R01CA140735-05 and 1 R01 CA187003-01A1 and by TOPAS MC Inc
20 September 2017 TOPAS J. Perl 70

You might also like