🔵 Spot-Scanning Proton Therapy Delivery Simulator
This simulation demonstrates the spot-scanning method of delivering proton therapy, a technique that allows for highly conformal dose distributions and reduced treatment time.
Treatment Plan Spot Map Generation
Before a single proton is delivered, an inverse dose-optimization algorithm divides the target volume into iso-energy depth layers and populates each with a dense grid of spot positions. Every spot is assigned a beam energy, position, and weight (in monitor units) so that the sum of thousands of individually-shaped Bragg peaks reconstructs the prescribed 3-D dose distribution — the essence of intensity-modulated proton therapy (IMPT).
- 1k–10k: Spots per field (typical) (depends on volume & spacing)
- 10–30+: Energy layers per field (covers full tumor depth)
- IMPT: Planning method (inverse spot-weight optimization)
- 3–8 mm: Spot sigma (isocenter) (beam-line dependent)
From passive scattering to pencil beam scanning
Early proton therapy used passive scattering: a broad beam was spread laterally by scattering foils and shaped in depth by a rotating modulator wheel, then collimated by a patient-specific aperture (a machined brass block) and shaped distally by a patient-specific range compensator (a milled wax or Lucite insert). Every field needed custom hardware fabricated in advance.
Pencil beam scanning (PBS) eliminates all of this. A narrow "pencil" beam (typically a few millimeters wide at the target) is steered magnetically to any lateral position and its energy is changed to reach any depth — so the dose is built up from thousands of individually weighted spots rather than shaped by physical hardware. No apertures, no compensators, faster planning turnaround, and dramatically better conformality to concave and irregular target shapes.
Because PBS needs no patient-specific hardware, treatment planning changes (adaptive replanning) can be turned around in hours instead of days — a major advantage when a tumor shrinks or a patient's anatomy shifts mid-course.
Iso-energy layers and the spot grid
Proton range in tissue is a near-deterministic function of beam energy, so each discrete energy corresponds to a distinct depth at which the Bragg peak — the sharp dose maximum near the end of the proton track — is placed. The planning system slices the target into iso-energy layers along the beam axis, typically spaced a few millimeters apart so that adjacent Bragg peaks overlap smoothly.
Within each layer, spots are laid out on a lateral grid whose spacing controls how finely the dose can be sculpted: tighter spacing gives smoother, more conformal coverage but multiplies the spot (and therefore delivery-time) count. This spot-spacing-versus-delivery-time trade-off is a first-order planning decision, mirrored in this simulator's spot-spacing slider.
Inverse optimization — solving for spot weights
Rather than hand-shaping dose the way passive scattering does, IMPT planning poses an optimization problem: given thousands of candidate spots, find the weight of each one that minimizes deviation from prescribed target dose while respecting dose limits to nearby organs at risk. This is mathematically analogous to intensity-modulated radiation therapy (IMRT) planning for photons, but the extra degree of freedom — range/depth — makes proton optimization both more powerful and more sensitive to range and setup uncertainty, which planners account for with robust optimization across simulated error scenarios.
Magnetic Beam Steering — Scanning Magnets
With the spot map computed, delivery begins. A pair of fast dipole magnets — one bending the beam in the horizontal (X) plane, one in the vertical (Y) plane — deflect the narrow pencil beam so it visits every planned spot position in the active energy layer, tracing a zig-zag (boustrophedon) raster pattern across the layer's footprint.
- 2: Scanning magnets per nozzle (independent X and Y dipoles)
- ~1–5 ms: Spot-to-spot move time (magnet settling included)
- ~3–10 mm: Beam spot diameter (σ at isocenter, energy dependent)
- Raster / zig-zag: Scan pattern (boustrophedon spot order)
How magnetic scanning replaces mechanical shaping
The scanning magnets sit in the treatment nozzle just upstream of the patient. By varying the current through each dipole, the magnetic field bends the charged proton beam by a controllable angle, translating into a controllable lateral displacement at the patient plane — exactly like the electron beam in an old CRT television was steered to paint a raster image, except here the "pixels" are millimeter-scale dose spots and the "brightness" is delivered dose.
Because the beam position is set electronically rather than by physical apertures, the same nozzle hardware treats every field and every patient — only the magnet current pattern and spot weight table change. This is what makes PBS scalable and adaptable in a way passive scattering never was.
Raster order and dose-rate considerations
Spots within a layer are typically delivered in an efficient raster or serpentine order — sweeping across one row, stepping down, sweeping back — to minimize the cumulative magnet travel distance and therefore minimize delivery time. Some systems use continuous-scanning ("line scanning") where the beam stays on while sweeping and dose is modulated by dwell/speed, while most clinical systems use discrete "spot scanning," briefly switching the beam off (or gating it) between static spot positions.
Scanning magnet response time and settling accuracy directly bound how fast a field can be delivered — faster, more precise magnets shrink treatment time and reduce the window during which anatomical motion can desynchronize with the beam.
No compensators, no apertures — but new precision demands
Eliminating patient-specific hardware removes a whole category of fabrication error and neutron-producing material in the beam path (scattering foils and apertures generate stray neutron dose). But PBS shifts the burden onto the control system: magnet calibration, spot position verification, and beam monitoring must be extremely precise, because there is no physical aperture edge to "clean up" a mispositioned spot. Modern nozzles verify spot position and dose in real time before advancing to the next spot, an interlocked safety loop unique to scanned delivery.
Spot Dose Delivery & Layer Completion
At each spot position the beam dwells just long enough to deliver its planned weight in monitor units, verified in real time by transmission ionization chambers in the nozzle. Once the last spot of a layer has reached its target charge, the layer is locked in as dosimetrically complete before the machine moves on.
- ~1–5 ms: Spot dwell time (typical clinical spot)
- Real-time: Dose verification (transmission ion chambers)
- ±2–3%: Spot dose tolerance (per-spot charge accuracy)
- 10s–1000s: Spots per energy layer (set by layer area & spacing)
Charge-controlled spot delivery
Delivery is not simply time-based — it is charge-based. Nozzle-mounted ionization chambers integrate the dose deposited at the current spot in real time; as soon as the measured charge reaches the planned monitor-unit value for that spot, the beam is switched off (or the magnets are commanded to the next position) regardless of exactly how long that took. This closed-loop control compensates automatically for small fluctuations in beam current from the accelerator, keeping delivered dose within tight tolerance of the plan.
Weight modulation — how IMPT sculpts dose
Spot weight is what makes IMPT "intensity modulated": spots near the edge of the target or adjacent to an organ at risk are typically given lower weight and finer spacing to sharpen the fall-off, while spots in the tumor core carry higher weight to build up the bulk dose efficiently. Overlapping Bragg peaks from many neighboring spots — in the same layer and in adjacent layers — sum together, so no single spot needs to (or should) deliver the full local dose on its own; the final distribution emerges from the superposition of the entire spot map.
This is directly analogous to how IMRT sums many photon beamlets from different angles, except in IMPT the depth dimension is also actively shaped by the Bragg peak itself rather than by beam angle alone.
A single proton field can be built from many thousands of individually weighted spots, each contributing a small, precisely placed piece of a Bragg-peak dose kernel — the aggregate distribution is verified against the plan before the beam is enabled.
Layer completion as a delivery checkpoint
Marking a layer "complete" is a meaningful clinical checkpoint, not just a visual flourish: it confirms every spot in that depth slice received its planned charge within tolerance, interlocks can hold delivery if any spot is out of range, and the treatment control system logs per-spot delivered charge for later dosimetric verification. Only once a layer passes this check does the system authorize the energy change to proceed to the next depth.
Energy Layer Switching — Depth Stepping
Proton range in tissue is governed by initial kinetic energy, so reaching a new depth means changing beam energy — either by inserting/removing physical range-shifter plates and degrader wedges, or by re-tuning the accelerator itself to output a different energy. Layers are usually painted from the deepest (distal) part of the tumor toward the shallowest (proximal) surface.
- 70–230 MeV: Clinical proton energy range (≈4–32 cm range in tissue)
- ~0.1–2 s: Energy layer switch time (system dependent)
- 2–5 mm: Typical layer spacing (water-equivalent depth)
- Distal → proximal: Delivery order (deepest layer first, typical)
Two ways to change beam energy
Cyclotron-based systems produce protons at a single fixed energy and use a rapid energy-selection system — a variable-thickness degrader followed by a magnetic energy-selection slit — to strip energy down to the value needed for each layer. This is mechanically fast but wastes some beam and produces secondary radiation at the degrader.
Synchrotron-based systems can accelerate protons to a different energy on each machine spill, avoiding the degrader entirely, but historically layer switching took longer because it required a new acceleration cycle. Modern "multi-energy extraction" synchrotrons and fast-cycling designs have substantially closed this gap, and continuous energy modulation is an active area of accelerator development.
Why distal-to-proximal ordering is typical
Painting the deepest layer first places the sharp, high-gradient distal falloff of the Bragg peak against healthy tissue before any shallower, lower-energy layers have deposited entrance dose on top of it. Because every proton passing through to a deep layer also deposits some "plateau" dose in the shallower tissue it traverses, layer order and weight optimization must account for this entrance-dose contribution from every deeper layer — another reason IMPT optimization solves for all layers jointly rather than layer by layer in isolation.
Every proton that reaches a deep layer also deposits low-LET plateau dose along its entire upstream path — so shallow tissue receives a mix of its own layer's dose plus entrance dose from every deeper layer's protons passing through.
The delivery-time cost of finer depth resolution
More energy layers give finer control over the distal dose falloff and better conformality to a target with a complex depth profile, but each layer switch adds a discrete time penalty — beam-off while the degrader or accelerator re-tunes — on top of the per-spot dwell time already accumulated within that layer. A field with 30 thin layers takes measurably longer to deliver than the same target painted with 10 thicker layers, exactly the trade-off represented by this simulator's energy-layer slider and the "energy layer change" pause shown during depth stepping.
Full Volume Coverage & the Interplay Effect
Once every energy layer is complete, the superposition of thousands of individually weighted Bragg peaks reconstructs the prescribed 3-D dose distribution across the entire target volume. But PBS delivery takes real time — seconds to a few minutes per field — and if the target moves during that window (breathing, cardiac motion, peristalsis), the beam and target can fall out of sync in a way that photon IMRT tolerates far better.
- ~1–3 min: Typical field delivery time (volume & layer dependent)
- Highest for PBS: Interplay risk (vs. passive scattering)
- 4–10×: Rescanning factor (mitigation) (volumetric repaints per field)
- <5 mm: Breath-hold motion reduction (residual target excursion)
What the interplay effect actually is
The interplay effect describes dose errors that arise from the combined, uncorrelated motion of a scanning beam and a moving target. In passive scattering, the entire field is broad enough to cover the whole tumor cross-section at once — motion shifts dose slightly but the whole field moves together, so the underdose/overdose pattern tends to average out. In PBS, the beam covers only a few millimeters at any instant; if the tumor moves a spot's width between the time that spot and its neighbor are painted, dose meant for one location can land on another, or dose meant for a moving spot can be missed entirely.
Unlike static geometric misses, interplay errors depend on the exact phase relationship between the breathing cycle and the scanning pattern, so they can be different — and are not guaranteed to cancel out — on different treatment days, especially over a small number of fractions.
Why photon IMRT is comparatively forgiving
Photon IMRT delivered over many fractions (commonly 25–35) benefits strongly from fractionation averaging: random motion phase differences from one day to the next tend to smooth out dose errors over the full course. PBS proton therapy is increasingly used in hypofractionated regimens (sometimes as few as 1–5 fractions, e.g. for liver or lung SBRT-like protocols), where there simply are not enough independent fractions for interplay errors to statistically average away — making single-fraction robustness a first-order clinical concern rather than a secondary one.
The fewer the fractions, the less interplay error benefits from day-to-day averaging — which is exactly why hypofractionated proton SBRT protocols invest heavily in motion mitigation rather than relying on fractionation alone.
Motion mitigation strategies
Clinics combine several complementary techniques:
• Volumetric or layered rescanning — repainting the full target (or each layer) multiple times with a fraction of the dose each pass, so any single pass's interplay error is diluted across several independent motion phases • Respiratory gating — the beam is enabled only during a defined, reproducible phase of the breathing cycle (commonly end-exhale), shrinking the effective target excursion • Breath-hold delivery — the patient holds their breath (often assisted by visual feedback or active breathing control) reducing motion to a few millimeters for the duration of a short delivery • Real-time tumor tracking — imaging-guided systems that dynamically adjust magnet steering and energy to follow a moving target, still investigational for routine proton PBS • Robust and 4-D optimization — planning against a library of simulated motion states so the nominal plan is not sensitive to a single worst-case shift
In combination, these techniques let PBS retain its dosimetric conformality advantage over passive scattering while keeping interplay-driven dose uncertainty within clinically acceptable limits.
This simulation demonstrates the spot-scanning method of delivering proton therapy, a technique that allows for highly conformal dose distributions and reduced treatment time.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install