Basics of treatment planning II Sastry Vedam PhD DABR Introduction to Medical Physics III: Therapy Spring 2015 Monte Carlo Methods 1
Monte Carlo! Most accurate at predicting dose distributions! Based on actual modeling of photon and electron transport through medium! Ability to simulate transport of individual entities (photon/ electron )! Stochastic approach based on probability distributions! Accuracy of resultant dose is directly dependent on the accuracy of the simulation setup Particle history! The transport of an incident particle, and of particles that it subsequently sets in motion! Uniquely determined by random selection from probability distributions that control each interaction! Dose distribution! Sum of energy deposition from each particle history (Essentially an integration problem)! Greater the number of particle histories, Lesser the uncertainty in the resultant dose estimate 2
Monte Carlo! Not a comprehensive review of the field of Monte Carlo based dose calculations in radiotherapy! Description mainly based on EGS4 (Electron Gamma Shower 4)! One of the most commonly used codes in radiation therapy applications EGS4! Adapted from simulations of particle transport in the field of high energy physics! Nelson, Hirayama, Rogers, Bielajew and others (1985)! Written in MORTRAN! Based on FORTRAN, with extensions to make it flexible and easier 3
EGS4 Main Components! Usercode! Relatively small part of EGS code! Specify geometry, incident beam and output requirements! Initiate each particle history! Record or score parameters of interest (dose per voxel )! Recognize when a transport step will take a particle into a new region! Output results EGS4 Main Components! EGS4 system code! Simulate particle transport for each particle initiated from the main usercode (SHOWER)! PEGS4! Dataset containing physical properties of each material used in simulation! Scattering cross sections! Mean free paths! Electron stopping powers For a user-defined energy range 4
EGS4! Geometry setup! External beam simulation! Define the extent and orientation of radiation field! Define array in which to score energy deposition! Cylindrical or cartesian geometry! Cartesian geometry More time for simulation Particle transport! Particle history determined from! Medium geometry and composition! Initial state of the particle! Incident position, angle and energy (determined randomly with certain user-defined constraints)! Random selection from the set of probability distributions governing possible interactions of photons and electrons! Stack! At any instant in history, stores position, direction and energy of one or more particles! Step! Transport of a particle to its next position! Variables of the particle are updated on the stack after each step 5
Step! Distance to next interaction! Particle transported in its current direction for a random distance! Selection of distance determined by mean free path corresponding to! Current photon energy! Medium in which the photon resides! Type of interaction! Photoelectric, Compton, Pair production! Chosen randomly with probabilities corresponding to photon energy and medium! New angle and energy! Determined from interaction cross section tables for each energy and medium! New particles! Some interactions may result in creation of new particles which may also be set in motion! Position, direction and energy of these particles are added to data stack Photon interactions! Photo electric effect! Incident photon loses all its energy in ejecting orbital electron! Energy left over is given to electron as kinetic energy! Compton scattering (Approx 70% for typical energies in RT)! Incident photon collides with a free electron, transferring some of its energy! Photon is scattered with the retained energy! Energy transferred, photon scattering angle and retained energy are determined by sampling from Klein-Nishina cross section data! Pair production! Photon energy is greater than 1.022 MeV (rest mass of an electron and positron)! Electron-positron pair created in conversion from energy to mass! Positron eventually annihilates with an electron, producing a pair of 0.511 MeV photons 6
500 kev photons 10 MeV photons 10 MeV photons: Pair production 7
Electron transport! Spatial distribution of energy imparted in photon interactions largely determines the dose distribution! Electron transport consumes most of the computing time (especially for higher energies, longer electron range)! Many short electron steps corresponding to each photon step! Electrons are transported until they fall below a user-defined cut off energy! Electron steps do not correspond to transport of particle from one discrete interaction to the next! Energy loss and multiple scattering interactions can be condensed Electron transport! Energy lost is a product of! Stopping power of the medium (function of incident electron energy)! Length of the step! Angle of deflection after each step! Sampling from an angular distribution characterized by scattering power (Medium and energy dependent) and step length! Continuous slowing down approximation (CSDA)! Energy is considered to be deposited evenly or continuously along each step! EGS4 Mixed approach! Energy losses below a threshold CSDA! Above threshold Treated in the same way as photon interactions! Lower thresholds Greater randomness! Energy loss straggling! Energy lost by electrons of a certain energy in a unit path length is not constant 8
Electron transport (Class I and II procedures)! Account for large energy loss events that occur due to! Production of delta rays (Collision)! Bremmstrahlung (Radiative)! CLASS I! Sample collision energy loss from a distribution! Include energy transmitted to delta rays! Sample radiative energy loss from a distribution! Photon is transported if the energy is above the photon transport cutoff Electron transport (Class I and II procedures)! CLASS I! Energy deposited in step 9
Electron transport (Class I and II procedures) Electron transport! Particle energy below threshold! History terminated! Residual energy deposited at site! Thresholds can be adjusted based on beam energy and other parameters to improve efficiency of dose calculation! ICSDA (For secondary electron transport)! Turns off all discrete energy losses! Forces pure CSDA approximation! Only energy loss modeled is that due to below threshold interactions! Decreases total energy loss per unit path length 10
Sampling from a distribution! Likelihood of a particular value for a transport parameter is dependent on the probability distribution governing the outcome of the event! Selection is.! BIASED! Way in which random numbers are used! Depends on type of distribution being sampled Direct sampling! Variable is chosen using a PDF (probability density function) that expresses the relative likelihood that the variable will have a certain value! PDF is normalized (area = 1.0) and integrated (CDF with a max value of 1.0)! Example for direct sampling! Path length selection! Distance a photon is likely to travel before its next interaction depends on mean free path of the medium for the current photon energy 11
Direct sampling Direct sampling 12
! Choosing interaction type Indirect sampling! Relative probabilities of branching ratios! Branching ratio! Cross section for each interaction type in relation to the total cross section for all interactions! If real numbers between 0 and 1 divided into interval of equal length! Likelihood of a random variable (between 0 and 1) falling in an interval corresponding to a particular interaction is equal to the branching ratio Uncertainty and statistics! Objective of Monte Carlo approach! Produce a result that is realistic and reproducible! Reproducibility! Successive simulations (with different set of incident particles) will give almost identical results! Completely reproducible distribution will be free of statistical uncertainty! While histories of N different particles will be different, the average behavior of the particles will be the same as that of N other particles 13
Uncertainty and statistics! Calculated by! Split a simulation into batches! Each batch is a separate simulation of equal number of particle histories! Results are averaged across all batches! Standard error in the mean is then computed Uncertainty 14
Uncertainty Efficiency and Variance Reduction! Efficiency is inversely proportional to both the variance of the results and the time taken for the simulation! Efficiency increased when! Variance for a particular simulation time is reduced! Time required to obtain results with a certain variance is reduced 15
Variance reduction methods! Geometry integration! Zonal discard! Reciprocity technique Reciprocity 16
Random number generator 17