A general-purpose Monte Carlo particle transport code based on inverse transform sampling for radiotherapy dose calculation

Ying Liang, Wazir Muhammad, Gregory R. Hart, Bradley J. Nartowt, Zhe J. Chen, J. Yu, Kenneth B. Roberts, James S. Duncan, Jun DengScientific 2020 · DOI

TL;DR

This paper introduces PTM, a new Monte Carlo (MC) code for simulating radiation transport in radiotherapy. PTM uniquely employs inverse transform sampling for both photon and electron transport, addressing a key bottleneck (thread divergence) that hinders performance on modern parallel architectures like GPUs. The code demonstrates high accuracy, achieving over 99.6% agreement with established MC codes and experimental measurements.

What Problem Does This Paper Address?

Accurate dose calculation is paramount in radiotherapy for effective cancer treatment. Monte Carlo (MC) methods are the gold standard for this, as they can precisely model the complex interactions of radiation with matter. However, traditional MC codes often rely on acceptance-rejection sampling, which leads to "thread divergence" when implemented on parallel processors (like GPUs). This occurs when some processing threads finish their tasks early and must wait for others, significantly slowing down simulations. While inverse transform sampling (ITS) offers a solution by eliminating this waiting, it had only been applied to photon transport. This paper tackles the challenge of extending ITS to coupled photon-electron transport, a crucial step for comprehensive radiotherapy dose calculations.

Methods

The core innovation of PTM is the consistent application of the inverse transform sampling (ITS) method for all particle interactions. Instead of repeatedly sampling and rejecting potential interactions until a valid one is found (acceptance-rejection), ITS directly samples an interaction based on its cumulative distribution function (CDF). This eliminates the need for multiple sampling attempts per interaction, thus avoiding thread divergence.

For photon transport, PTM models Rayleigh scattering, Compton scattering, photoelectric effect, and pair production using ITS.

For electron transport, a class II condensed history scheme is employed. This means that "catastrophic" events (those causing significant energy loss or particle creation, like inelastic scattering and Bremsstrahlung) are simulated explicitly, while less impactful events are "condensed" into a single step. To enhance accuracy, PTM incorporates a random-hinge electron step correction algorithm and a modified PRESTA boundary crossing algorithm.

Datasets

The paper does not introduce new datasets but rather uses existing, well-established benchmarks for validation:

  • EGSnrc simulations: PTM's results are extensively compared against those from the widely-used EGSnrc MC code (specifically, the DOSXYZnrc toolkit).
  • Experimental measurements: PTM's accuracy is validated against experimental data from:
  • A cobalt-60 teletherapy machine.
  • A 9 MeV electron beam from a Varian Clinac 2100 C/D linear accelerator.
  • A Fano cavity test.

Key Insights and Ideas

  • ITS as a GPU Enabler: The paper strongly advocates for ITS as a crucial technique for efficient MC simulations on GPUs. By eliminating thread divergence, ITS paves the way for significant speedups in radiotherapy dose calculations.
  • Coupled Photon-Electron Transport with ITS: The successful implementation of ITS for both photons and electrons in a single code is a major achievement, demonstrating its broad applicability beyond just photon transport.
  • Accuracy in Complex Geometries: PTM shows excellent agreement with EGSnrc and experimental data not only in homogeneous phantoms but also in heterogeneous media (e.g., water-lung-water, tissue-bone-tissue slabs), highlighting its robustness.
  • Electron Step Algorithms are Critical: The paper emphasizes the importance of sophisticated electron step correction and boundary crossing algorithms for accurate 3D dose distributions, even with condensed history techniques.

Key Results

  • High Accuracy: PTM achieved gamma indices better than 99.6% for all tested scenarios under the 2%/2 mm criteria when compared to EGSnrc simulations.
  • Agreement with Experiments: PTM demonstrated excellent agreement with experimental measurements, with dose differences typically less than 1-3% of the maximum dose.
  • Simulation Time: PTM was found to be 1.2-1.6 times slower than DOSXYZnrc for the same statistical uncertainty. The authors attribute this to PTM's more general geometry handling capabilities.

Limitations and Future Work

  • Spin Effects: The current implementation of PTM does not model electron spin effects. While the authors found negligible impact on photon dose distributions and acceptable results for electron beams, they acknowledge that including spin could improve accuracy further.
  • Bremsstrahlung Approximation: The linear approximation for the Bremsstrahlung energy-weighted spectrum was noted as a potential source of inaccuracy for electron beams in high-Z materials, leading to up to 10% dose difference in the falloff region.
  • GPU Implementation: The primary motivation for developing PTM was to facilitate future GPU implementation. The paper establishes a CPU framework and suggests that the ITS approach is well-suited for this next step.
  • General Geometry: While PTM handles general geometries, the authors note that DOSXYZnrc is optimized for voxelized geometries, contributing to the observed speed difference. Future work could focus on optimizing PTM's geometry handling for specific radiotherapy applications.

Summary updated

Abstract

The Monte Carlo (MC) method is widely used to solve various problems in radiotherapy. There has been an impetus to accelerate MC simulation on GPUs whereas thread divergence remains a major issue for MC codes based on acceptance-rejection sampling. Inverse transform sampling has the potential to eliminate thread divergence but it is only implemented for photon transport. Here, we report a MC package Particle Transport in Media (PTM) to demonstrate the implementation of coupled photon-electron transport simulation using inverse transform sampling. Rayleigh scattering, Compton scattering, photo-electric effect and pair production are considered in an analogous manner for photon transport. Electron transport is simulated in a class II condensed history scheme, i.e., catastrophic inelastic scattering and Bremsstrahlung events are simulated explicitly while subthreshold interactions are subject to grouping. A random-hinge electron step correction algorithm and a modified PRESTA boundary crossing algorithm are employed to improve simulation accuracy. Benchmark studies against both EGSnrc simulations and experimental measurements are performed for various beams, phantoms and geometries. Gamma indices of the dose distributions are better than 99.6% for all the tested scenarios under the 2%/2 mm criteria. These results demonstrate the successful implementation of inverse transform sampling in coupled photon-electron transport simulation.
BibTeX
@inproceedings{liang2020general,
  author = {Ying Liang and Wazir Muhammad and Gregory R. Hart and Bradley J. Nartowt and Zhe J. Chen and J. Yu and Kenneth B. Roberts and James S. Duncan and Jun Deng},
  title = {{A general-purpose Monte Carlo particle transport code based on inverse transform sampling for radiotherapy dose calculation}},
  booktitle = {Scientific},
  year = {2020},
  doi = {10.1038/s41598-020-66844-7},
}
Figure