doseCalc

Dose calculation engines and supporting utilities for photon, proton, and ion therapy.

matRad_MCinit(pln, MCsettings)
matRad_calcSigmaRashi(bdEntry, rangeShifter, SSD)

calculation of additional beam broadening due to the use of range shifters (only for protons)

call

sigmaRashi = matRad_calcSigmaRashi(bdEntry,rangeShifter,SSD)

Input:
  • bdEntry – base data entry for energy

  • rangeShifter – structure defining range shifter geometry

  • SSD – source to surface distance

Output:

sigmaRashi – sigma of range shifter (to be added ^2) in mm

References

[1] https://www.ncbi.nlm.nih.gov/pubmed/12375823 [2] https://www.ncbi.nlm.nih.gov/pubmed/12701891


Copyright 2015-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcSigmaIni(baseData, rays, SSD)

This function evaluates simultaneously the initial sigma of the beam for one or more energies

call

sigmaIni = matRad_calcSigmaIni(machine.data,stf(i).ray,stf(i).ray(j).SSD);

Input:
  • baseData – ‘machine.data’ file

  • rays – ‘stf.ray’ file

  • SSD – source-surface difference

Output:

sigmaIni – initial sigma of the ray at certain energy (or energies). The data is given in 1xP dimensions, where ‘P’ represents the number of different energies

References


matRad_calcLQParameter(vRadDepths, mTissueClass, baseData)

matRad inverse planning wrapper function

call

[vAlpha, vBeta] = matRad_calcLQParameter(vRadDepths,mTissueClass,baseData)

Input:
  • vRadDepths – radiological depths of voxels

  • mTissueClass – tissue classes of voxels

  • baseData – biological base data

Output:
  • vAlpha – alpha values for voxels interpolated from base data

  • vBeta – beta values for voxels interpolated from base data

References

Copyright 2015-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcParticleDoseMC(ct, stf, pln, cst, nCasePerBixel, calcDoseDirect)

matRad MCsqaure monte carlo photon dose calculation wrapper

call

dij = matRad_calcParticleDoseMc(ct,stf,pln,cst,calcDoseDirect)

Input:
  • ct – matRad ct struct

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • nCasePerBixel – number of histories per beamlet

  • calcDoseDirect – binary switch to enable forward dose calcualtion

Output:

dij – matRad dij struct

References


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_computeSSD(stf, ct, varargin)

matRad SSD calculation

call

stf = matRad_computeSSD(stf,ct) stf = matRad_computeSSD(stf,ct,Name,Value)

Input:
  • ct – ct cube

  • stf – matRad steering information struct

  • Optional Name/Value Properties

  • mode – optional parameter specifying how to handle multiple cubes to compute one SSD. Only ‘first’ isimplemented

  • densityThreshold – value determining the skin threshold.

Output:

stf – matRad steering information struct

References

Copyright 2017-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calculateProbabilisticQuantities(dij, cst, pln, mode4D)
matRad helper function to compute probabilistic quantities, i.e. expected

dose influence and variance omega matrices for probabilistic optimization

call

[dij,cst] = matRad_calculateProbabilisticQuantities(dij,cst,pln)

Input:
  • dij – matRad dij struct

  • cst – matRad cst struct (in dose grid resolution)

  • pln – matRad pln struct

  • mode4D – (Optional) Handling of 4D phases: - ‘all’ : include 4D scen in statistic - ‘phase’ : create statistics per phase (default)

Output:

dij – dij with added probabilistic quantities

References

Copyright 2020-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcPhotonDose(ct, stf, pln, cst, calcDoseDirect)

matRad photon dose calculation wrapper

call

dij = matRad_calcPhotonDose(ct,stf,pln,cst,calcDoseDirect)

Input:
  • ct – ct cube

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • calcDoseDirect – boolian switch to bypass dose influence matrix computation and directly calculate dose; only makes sense in combination with matRad_calcDoseDirect.m

Output:

dij – matRad dij struct

References

[1] http://www.ncbi.nlm.nih.gov/pubmed/8497215


Copyright 2015-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcPhotonDoseMC(ct, stf, pln, cst, nCasePerBixel, visBool)

matRad ompMC monte carlo photon dose calculation wrapper

call

dij = matRad_calcPhotonDoseMc(ct,stf,pln,cst,visBool)

Input:
  • ct – matRad ct struct

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • visBool – binary switch to enable visualization

Output:

dij – matRad dij struct

References

Copyright 2018-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_projectOnComponents(initIx, dim, sourcePoint_bev, targetPoint_bev, isoCenter, res, Dx, Dz, rotMat)

This function projects a point on a certain ray and returns both the index of the projected point in the reference system of the ct cube and its coordinates

call

[projCoord,idx,targetPoint, sourcePoint] =

matRad_projectOnComponents(initIx,dim,sourcePoint_bev,targetPoint_bev,isoCenter, res, Dx, Dz, rotMat)

Input:
  • initIx – initial indices of the points

  • cubeDim – dimension of the ct cube (i.e. ct.cubeDim)

  • sourcePoint_bev – source point of the ray in bev

  • targetPoint_bev – target point of the ray in bev

  • isoCenter – isocenter coordinates (in cube system)

  • res – resolution in x,y, and z direction

  • Dx – displacement on x axis

  • Dz – displacement on z axis

Output:
  • idx – projected indeces

  • projCoord – projected coordinates

References


matRad_interpRadDepth(ct, V, Vcoarse, vXgrid, vYgrid, vZgrid, radDepthV)

down/up sampling the radiological depth dose cubes

call

radDepthVcoarse = matRad_interpRadDepth(ct,V,Vcoarse,vXgrid,vYgrid,vZgrid,radDepthV)

Input:
  • ct – matRad ct structure

  • V – linear voxel indices of the cst

  • Vcoarse – linear voxel indices of the down sampled grid resolution

  • vXgrid – query points of now location in x dimension

  • vYgrid – query points of now location in y dimension

  • vZgrid – query points of now location in z dimension

  • radDepthV – radiological depth of radDepthIx

Output:

radDepthVcoarse – interpolated radiological depth of radDepthIx

References

Copyright 2018-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcParticleDose(ct, stf, pln, cst, calcDoseDirect)

matRad particle dose calculation wrapper

call

dij = matRad_calcParticleDose(ct,stf,pln,cst,calcDoseDirect)

Input:
  • ct – ct cube

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • calcDoseDirect – boolian switch to bypass dose influence matrix computation and directly calculate dose; only makes sense in combination with matRad_calcDoseDirect.m

Output:

dij – matRad dij struct

References

[1] http://iopscience.iop.org/0031-9155/41/8/005


Copyright 2015-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcDoseDirectMC(ct, stf, pln, cst, w, nHistories)

matRad function to bypass dij calculation for MC dose calculation matRad dose calculation wrapper for MC dose calculation algorithms bypassing dij calculation for MC dose calculation algorithms.

call

resultGUI = matRad_calcDoseDirecMC(ct,stf,pln,cst) resultGUI = matRad_calcDoseDirecMC(ct,stf,pln,cst,w) resultGUI = matRad_calcDoseDirectMC(ct,stf,pln,cst,nHistories) resultGUI = matRad_calcDoseDirectMC(ct,stf,pln,cst,w,nHistories)

Input:
  • ct – ct cube

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • w – (optional, if no weights available in stf): bixel weight vector

  • nHistories – (optional) number of histories

Output:

resultGUI – matRad result struct

References

Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_calcDoseDirect(ct, stf, pln, cst, w, nHistories)
matRad function to bypass dij calculation

Should not be used directly anymore as it is deprecated. Use matRad_calcDoseForward instead.

call

resultGUI = matRad_calcDoseDirec(ct,stf,pln,cst) resultGUI = matRad_calcDoseDirec(ct,stf,pln,cst,w)

Input:
  • ct – ct cube

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

  • w – (optional, if no weights available in stf): bixel weight vector

Output:

resultGUI – matRad result struct

References

Copyright 2024-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Dose Engines

class DoseEngines.matRad_MonteCarloEngineAbstract(pln)

Bases: DoseEngines.matRad_DoseEngineBase

matRad_MonteCarloEngineAbstract: abstract superclass for all dose calculation

engines which are based on monte carlo calculation for more informations see superclass DoseEngines.matRad_DoseEngineBase


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Property Summary
numHistoriesPerBeamlet

number of histories per beamlet

numHistoriesDirect

number of histories for a forward dose calculation

outputMCvariance

boolean value to decide if variance information for the MC calculation should be scored

relativeDosimetricCutOff

relative dosimetric cut-off (i.e., 1 - minimum relative dose-value to be stored)

relDoseCutOff
Method Summary
setDefaults(this)
class DoseEngines.matRad_ParticleHongPencilBeamEngine(pln)

Bases: DoseEngines.matRad_ParticlePencilBeamEngineAbstract

matRad_ParticleHongPencilBeamEngine: Implements the Hong pencil-beam engine

Constructor

call

engine = DoseEngines.matRad_ParticleAnalyticalPencilBeamDoseEngine(ct,stf,pln,cst)

Input:

pln – matRad plan meta information struct

Property Summary
possibleRadiationModes = {'protons','helium','carbon','VHEE'}
name = 'Hong Particle Pencil-Beam'
shortName = 'HongPB'
Method Summary
static isAvailable(pln, machine)

see superclass for information

class DoseEngines.matRad_PhotonOmpMCEngine(pln)

Bases: DoseEngines.matRad_MonteCarloEngineAbstract

Engine for photon dose calculation based on monte carlo for more informations see superclass DoseEngines.matRad_MonteCarloEngineAbstract


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Constructor

call

engine = DoseEngines.matRad_DoseEnginePhotonsOmpMCct,stf,pln,cst)

Input:

pln – matRad plan meta information struct

Property Summary
possibleRadiationModes = 'photons'
name = 'ompMC'
shortName = 'ompMC'
visBool = false

binary switch to en/disable visualitzation

useCornersSCD = true

false -> use ISO corners

absCalibrationFactor = 3.49056*1e12

This factor calibrates to 1 Gy in a %(5x5)cm^2 open field (1 bixel) at 5cm depth for SSD = 900 which corresponds to the calibration for the analytical base data.

omcFolder
ompMCoptions
ompMCgeo
ompMCsource
cubeHU

resamples HU cube

cubeRho

density cube

cubeMatIx

material assignment

scale = 10
Method Summary
setOmpMCoptions()
getSourceWidthFromPenumbra()

gaussian filter to model penumbra from (measured) machine output / see diploma thesis siggel 4.1.2

materialConversion(ctGrid, doseGrid, ct)

conversion from HU to densities & materials

getOmpMCgeometry(doseGrid)
setupMaterials(~)
getOmpMCsource(stf)
static isAvailable(pln, machine)

see superclass for information

static compileOmpMCInterface(dest, omcFolder)

Compiles the ompMC interface (integrated as submodule)

call

matRad_OmpConfig.compileOmpMCInterface() matRad_OmpConfig.compileOmpMCInterface(dest) matRad_OmpConfig.compileOmpMCInterface(dest,sourceFolder)

if an object is instantiated, matRad_OmpConfig can be replaced by the object handle

Input:
  • dest – (optional) destination for mex file. Default: location of this file

  • sourceFolder – (optional) path to ompMC . Default assumes its checked out in the submodules folder of matRad

References


Copyright 2020 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


class DoseEngines.matRad_ParticlePencilBeamEngineAbstract(pln)

Bases: DoseEngines.matRad_PencilBeamEngineAbstract

matRad_DoseEngineParticlePB: Implements an engine for particle based dose calculation For detailed information see superclass matRad_DoseEngine

Property Summary
calcLET = true

Boolean which defines if LET should be calculated

calcBioDose = false

Boolean which defines if biological dose calculation shoudl be performed (alpha*dose and sqrt(beta)*dose)

airOffsetCorrection = true

Corrects WEPL for SSD difference to kernel database

lateralModel = 'fast'

Lateral Model used. ‘auto’ uses the most accurate model available (i.e. multiple Gaussians), ‘fastest’ uses the most simple model. ‘single’,’double’,’multi’ try to force a singleGaussian or doubleGaussian model, if available

cutOffMethod = 'integral'

or ‘relative’ - describes how to calculate the lateral dosimetric cutoff

visBoolLateralCutOff = false

Boolean switch for visualization during+ LeteralCutOff calculation

constantRBE = NaN

constant RBE value

vTissueIndex

Stores tissue indices available in the matRad base data

vAlphaX

Stores Photon Alpha

vBetaX

Stores Photon Beta

bioKernelQuantities

Kernel quantites to request from the machine data for biological dose calculation

restrictBeamRadDepthsByMaxEnergy = true
Method Summary
static providedQuantities(machine)
class DoseEngines.matRad_PencilBeamEngineAbstract(pln)

Bases: DoseEngines.matRad_DoseEngineBase

matRad_PencilBeamEngineAbstract: abstract superclass for all dose calculation engines which are based on

analytical pencil beam calculation for more informations see superclass DoseEngines.matRad_DoseEngine MatRad_Config MatRad Configuration class


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Property Summary
keepRadDepthCubes = false
geometricLateralCutOff

lateral geometric cut-off id mm, used for raytracing and geometry

dosimetricLateralCutOff

relative dosimetric cut-off (in fraction of values calculated)

ssdDensityThreshold

Threshold for SSD computation

useGivenEqDensityCube

Use the given density cube ct.cube and omit conversion from cubeHU.

ignoreOutsideDensities

Ignore densities outside of cst contours

numOfDijFillSteps = 10

Number of times during dose calculation the temporary containers are moved to a sparse matrix

traceOnDoseGrid = false

perform raytracing on dose grid instead of CT grid

effectiveLateralCutOff

internal cutoff to be used, computed from machine/pencil-beam kernel properties and geometric/dosimetric cutoff settings

rayTracer
tmpMatrixContainers

temporary containers for

numOfBixelsContainer

number of used bixel container

radDepthCubes = {}

only stored if property set accordingly

cubeWED

relative electron density / stopping power cube

hlut

hounsfield lookup table to craete relative electron density cube

geometricCutOff

deprecated property, replaced with geometricLateralCutOff

Method Summary
setDefaults(this)
static calcGeoDists(rot_coords_bev, sourcePoint_bev, targetPoint_bev, SAD, radDepthIx, lateralCutOff)

matRad calculation of lateral distances from central ray used for dose calculation

call

[ix,rad_distancesSq,isoLatDistsX,isoLatDistsZ] = …
this.calcGeoDists(rot_coords_bev, …

sourcePoint_bev, … targetPoint_bev, … SAD, … radDepthIx, … lateralCutOff)

Input:
  • rot_coords_bev – coordinates in bev of the voxels with index V, where also ray tracing results are availabe

  • sourcePoint_bev – source point in voxel coordinates in beam’s eye view

  • targetPoint_bev – target point in voxel coordinated in beam’s eye view

  • SAD – source-to-axis distance

  • radDepthIx – sub set of voxels for which radiological depth calculations are available

  • lateralCutOff – lateral cutoff specifying the neighbourhood for which dose calculations will actually be performed

Output:
  • ix – indices of voxels where we want to compute dose influence data

  • rad_distancesSq – squared radial distance to the central ray (where the actual computation of the radiological depth takes place)

  • isoLatDistsX – lateral x-distance to the central ray projected to iso center plane

  • isoLatDistsZ – lateral z-distance to the central ray projected to iso center plane

  • latDistsX – lateral x-distance to the central ray

  • latDistsZ – lateral z-distance to the central ray

References

Copyright 2015 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


class DoseEngines.matRad_ParticleFineSamplingPencilBeamEngine(pln)

Bases: DoseEngines.matRad_ParticlePencilBeamEngineAbstract

matRad_ParticlePencilBeamEngineAbstractFineSampling: Implements an engine for particle based dose calculation For detailed information see superclass matRad_DoseEngine

Constructor

call

engine = DoseEngines.matRad_ParticleAnalyticalPencilBeamDoseEngine(ct,stf,pln,cst)

Input:

pln – matRad plan meta information struct

Property Summary
possibleRadiationModes = {'protons','helium','carbon'}
name = 'Subsampling Particle Pencil-Beam'
shortName = 'SubsamplingPB'
fineSampling

Struct with finesampling properties

Method Summary
setDefaults(this)
static isAvailable(pln, machine)

see superclass for information

class DoseEngines.matRad_TG43BrachyEngine(pln)

Bases: DoseEngines.matRad_DoseEngineBase

Engine for dose calculation based on the revised AAPM protocol for brachytherapy Dose Calculations

for more informations see superclass DoseEngines.matRad_DoseEngineBase


Copyright 2024-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Property Summary
possibleRadiationModes = {'brachy'}
name = 'TG43'
shortName = 'TG43'
DistanceCutoff
TG43approximation
Method Summary
setDefaults(this)
setCalcDose(this, ct, cst, stf)
getDoseRate1D_poly(this, machine, r_mm)
Calculation of radial dose Rate, interpolating using polynomes

1D dose rate formalism from Rivard et al. (2004): AAPM TG-43 update, page 639, Eq. 11:

call

DoseRate = matRad_TG43BrachyEngine.getDoseRate1D_poly(machine,r_mm)

Input:
  • machine – TG43 information about the used seeds

  • r – radial distance array, given in mm!

Output:

DoseRate – size(r) array of dose Rate in cGy/h

comment on dimensions / units

TG43 consensus data cm, cGy, s matRad mm, Gy, s output dimensions depend on the dimensions of air kerma strength Sk, normallyi in cGy*cm^2/h)

getDoseRate2D_poly(this, machine, r_mm, theta)
Calculation of radial dose Rate, interpolating using polynomes

2D dose rate formalism from Rivard et al. (2004): AAPM TG-43 update, page 637, eq. 1

call

DoseRate = matRad_TG43BrachyEngine.getDoseRate2D_poly(machine,r_mm)

Input:
  • machine – TG43 information about the used seeds

  • r – radial distance array, given in mm!

  • theta – polar angle in degree

Output:

DoseRate – size(r) array of dose Rate in cGy/h

comment on dimensions / units

TG43 consensus data cm, cGy, s matRad mm, Gy, s output dimensions depend on the dimensions of air kerma strength Sk, normallyi in cGy*cm^2/h)

getThetaMatrix(this, templateNormal, DistanceMatrix)

getThetaMatrix gets (seed x dosepoint) matrix of relative polar angles

call

[ThetaMatrix,ThetaVector] = matRad_TG43BrachyEngine.getThetaMatrix(templateNormal,…

DistanceMatrix)

normally called within matRad_TG43BrachyEngine.getBrachyDose !!getDistanceMatrix needs to be called first!!

Input:
  • DistanceMatrix – [dosePoint x seedPoint] struct with fields ‘x’,’y’, ‘z’ and total distance ‘dist’

  • templateNormal – normal vector of template (its assumed that this is the dir all seeds point to)

Output:
  • angle matrix – rows: index of dosepoint columns: index of deedpoint entry: polar angles betreen seedpoints and dosepoint in degrees

  • angle vector – column vector of angle matrix entries

comment:

The shape of the Theta matrix will be consistent with the shape of input fields.

static anisotropyFactor1D(r, PhiAnTab, L)
anisotropy function interpolates tabulated data

using fifth order polynomial and approximates small and large distances according to Rivard et al.2007: Supplement to the 2004 update of the AAPM Task Group No. 43 Report Eq. (2). Normally called within matRad_TG43BrachyEngine.getDoseRate(…)

call

PhiAn = matRad_TG43BrachyEngine.anisotropyFactor1D(r,PhiAnTab, L)

Input:
  • r – array of radial distances in cm!

  • PhiAnTab – tabulated consensus data of gL according to the following cell structure: PhiAnTab{1} = AnisotropyFactorRadialDistance PhiAnTab{2} = AnisotropyFactorValue

Output:

PhiAn – array of the same shape as r and thet containing the interpolated and extrapolated values

static anisotropyFunction2D(r, thet, FTab)
anisotropy function interpolates tabulated

data using fifth order polynomial and approximates small and large distances according to Rivard et al.: AAPM TG-43 update Eq. (C1). Normally called within matRad_TG43BrachyEngine.getDoseRate(…)

This function requires the multiPolyRegress code : https://de.mathworks.com/matlabcentral/fileexchange/34918-multivariate-polynomial-regression

call

F = matRad_TG43BrachyEngine.anisotropyFunction2D(r,thet,FTab)

Input:
  • r – array of radial distances in cm

  • thet – array of azimuthal angles in °

  • FTab – tabulated consensus data of F according to the following cell structure: FTab{1} = AnisotropyRadialDistances FTab{2} = AnisotropyPolarAngles FTab{3} = AnisotropyFunctionValue

Output:

F – array of the same shape as r and thet containing the interpolated and extrapolated values

static geometryFunction(r, thet, L)
calculates 2D geometry function

according to Rivard et al.: AAPM TG-43, p 638 update Eq. (4) Normally called within matRad_TG43BrachyEngine.getDoseRate(…)

call

GL = matRad_TG43BrachyEngine.geometryFunction(r,thet,L)

Input:
  • r – array of radial distances in cm!

  • thet – array of azimual angles in °

  • Length – length of radiation source in cm

Output:

GL (r,theta) – geometry function output

static calcBeta(r, theta, L)

calculate beta (see Rivard et al.: AAPM TG-43, p 637, Fig 1) calculates beta from r[cm], theta [deg] and L[cm] array inputs are allowed for theta

static radialDoseFunction(r, gLTab)
interpolates tabulated data using

fifth order polynomial and approximates small and large distances according to Rivard et al.: AAPM TG-43 update, p.669, Eq. (C1). Normally called within matRad_TG43BrachyEngine.TG43BrachyEngine.getDoseRate(…)

call

matRad_TG43BrachyEngine.TG43BrachyEngine.radialDoseFuncrion(r,gLTab)

Input:
  • r – array of radial distances in cm!

  • gLTab – tabulated consensus data of gL according to the following cell structure: gLTab{1} = RadialDoseDistance gLTab{2} = RadialDoseValue

Output:

gL – array of the same shape as r containing the interpolated and extrapolated values

static anisotropyFunction2DInterp(r, thet, FTab)
anisotropy function interpolates tabulated

data using interp2 ( interp technique TBD) Normally called within matRad_TG43BrachyEngine.TG43BrachyEngine.getDoseRate(…)

call

F = matRad_TG43BrachyEngine.TG43BrachyEngine.anisotropyFunction2D(r,thet,FTab)

Input:
  • r – array of radial distances in cm

  • thet – array of azimuthal angles in ??

  • FTab – tabulated consensus data of F according to the following cell structure: FTab{1} = AnisotropyRadialDistances FTab{2} = AnisotropyPolarAngles FTab{3} = AnisotropyFunctionValue

Output:

F – array of the same shape as r and thet containing the interpolated and extrapolated values

class DoseEngines.matRad_ParticleAnalyticalBortfeldEngine(pln)

Bases: DoseEngines.matRad_ParticlePencilBeamEngineAbstract

matRad_DoseEngineParticlePB: Implements an engine for particle based dose calculation For detailed information see superclass matRad_DoseEngine

Constructor

call

engine = DoseEngines.matRad_ParticleAnalyticalPencilBeamDoseEngine(ct,stf,pln,cst)

Input:

pln – matRad plan meta information struct

Property Summary
possibleRadiationModes = {'protons'}
name = 'Analytical Bortfeld Pencil-Beam'
shortName = 'AnalyticalPB'
massDensity = 0.997

target material parameters (Water)

p = 1.77

Exponent in the Bragg-Kleemann rule

alpha = 2.2*10^(-3)

Material-dependent constant in the Bragg-Kleemann rule

beta = 0.012

Slope parameter of the linear fluence reduction

gammaNuc = 0.6

Fraction of locally absorbed energy in nuclear interactions

Z = 10

N of electrons per molecule (water)

MM = 18.01

Molar mass in g/mol (water)

radLength = 36.3

Radiation Length of the assumed medium

phi0 = 1

Beam parameters

epsilonTail = 0.1

(Small) fraction of primary fluence phi_0 contributing to the linear “tail” of the energy spectrum

sigmaEnergy = 0.01

sigma of the gaussian energy spectrum

modeWidth = true

Boolean which defines a monoenergetic (0) and gaussian (1) energy spectrum

epsilon0 = 8.854e-12

Vacuum dielectric constant in (C^2/(N*m^2))

electronCharge = 1.602e-19

Electron charge in (C)

avogadroNum = 6.022e23

Avogadro number

Method Summary
calcAnalyticalBragg(this, primaryEnergy, depthZ, energySpread)

call

this.calcAnalyticalBragg(PrimaryEnergy, depthz, WidthMod)

Purpose: Compute depth-dose curve i.e. the Bragg Peak

in ‘Bortfeld 1998’ formalism.

Input:
  • primaryEnergy – Parameter (primaryEnergy > 0, it is the primary energy of the beam)

  • depthZ – Argument (depthZ > 0, depth in the target material).

  • energySpread – Energy Spread

Output:

doseVector – Depth dose curve; same size of depthZ

This function was inspired by the paper from Thomas Bortfeld (1997) “An analytical approximation of the Bragg curve for therapeutic proton beams”.

calcSigmaLatMCS(this, depthZ, primaryEnergy)

call

this.SigmaLatMSC_H(depthz, En)

Purpose: Compute the lateral displacement of a particle beam due to

Multiple Coulomb Scattering, as function of the depth in the target material and in Highland approximation.

Input:
  • primaryEnergy – Parameter (PrimaryEnergy > 0, it is the primary energy of the beam)

  • depthZ – Argument (z > 0, it is the actual depth in the target material)

Output:

sigmaMCS – SigmaLatMCS_H(z, E)

This function was inspired by the paper from Gottschalk et al.1992.

static isAvailable(pln, machine)

see superclass for information

static providesQuantities(machine)
class DoseEngines.matRad_PhotonPencilBeamSVDEngine(pln)

Bases: DoseEngines.matRad_PencilBeamEngineAbstract

matRad_PhotonPencilBeamSVDEngine: Pencil-beam dose calculation with singular value decomposed kernels

References

[1] http://www.ncbi.nlm.nih.gov/pubmed/8497215

Constructor

call

engine = DoseEngines.matRad_PhotonPencilBeamSVDEngine(pln)

Input:
  • ct – matRad ct struct

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

Property Summary
possibleRadiationModes = {'photons'}

constant which represent available radiation modes

name = 'SVD Pencil Beam'
shortName = 'SVDPB'
useCustomPrimaryPhotonFluence

boolean to control usage of the primary fluence during dose (influence matrix) computation

kernelCutOff

cut off in [mm] of kernel values

randomSeed = 0

for bixel sampling

intConvResolution = 0.5

resolution for kernel convolution [mm]

enableDijSampling = true
dijSampling

struct with lateral dij sampling parameters

ignoreInvalidValues = false

ignore negative, infinite or NaN values in bixel calculation

isFieldBasedDoseCalc

Will be set

penumbraFWHM

will be obtained from machine

fieldWidth

Will be obtained during calculation

kernelConvSize

size of the convolution kernel

kernelX

meshgrid in X

kernelZ

meshgrid in Z

kernelMxs

cell array of kernel matrices

gaussFilter

two-dimensional gaussian filter to model penumbra

gaussConvSize

size of the gaussian convolution kernel

convMx_X

convolution meshgrid in X

convMx_Z

convolution meshgrid in Z

F_X

fluence meshgrid in X

F_Z

fluence meshgrid in Z

Fpre

precomputed fluence if uniform fluence used for calculation

interpKernelCache

Kernel interpolators (cached if precomputation per beam possible)

collimation

collimation structure from dicom import

Method Summary
setDefaults(this)
static isAvailable(pln, machine)

see superclass for information

static calcSingleBixel(SAD, m, betas, interpKernels, radDepths, geoDists, isoLatDistsX, isoLatDistsZ, ignoreInvalidValues)
matRad photon dose calculation for an individual bixel

This is defined as a static function so it can also be called individually for certain applications without having a fully defined dose engine

call

dose = this.calcPhotonDoseBixel(SAD,m,betas,Interp_kernel1,…

Interp_kernel2,Interp_kernel3,radDepths,geoDists,… isoLatDistsX,isoLatDistsZ)

Input:
  • SAD – source to axis distance

  • m – absorption in water (part of the dose calc base data)

  • betas – beta parameters for the parameterization of the three depth dose components

  • interpKernels – kernel interpolators for dose calculation

  • radDepths – radiological depths

  • geoDists – geometrical distance from virtual photon source

  • isoLatDistsX – lateral distance in X direction in BEV from central ray at iso center plane

  • isoLatDistsZ – lateral distance in Z direction in BEV from central ray at iso center plane

Output:

dose – photon dose at specified locations as linear vector

References

[1] http://www.ncbi.nlm.nih.gov/pubmed/8497215

class DoseEngines.matRad_TopasMCEngine(pln)

Bases: DoseEngines.matRad_MonteCarloEngineAbstract

matRad_TopasMCEngine

Implementation of the TOPAS interface for Monte Carlo dose calculation

References


Copyright 2023-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Property Summary
possibleRadiationModes = {'photons','protons','helium','carbon','VHEE'}
name = 'TOPAS'
shortName = 'TOPAS'
defaultPhotonBeamProfile = 'uniform'
defaultParticleBeamProfile = 'biGaussian'
hlut
useGivenEqDensityCube

Use the given density cube ct.cube and omit conversion from cubeHU.

calcLET = false
calcBioDose = false
prescribedDose = []
topasExecCommand

Defaults will be set during construction according to TOPAS installation instructions and used system

parallelRuns = false

Starts runs in parallel

externalCalculation = 'off'

Generates folder for external TOPAS calculation (e.g. on a server)

workingDir

working directory for the simulation

engine = 'TOPAS'

parameter for continuity

label = 'matRad_plan'
numThreads = 0

Simulation parameters

numOfRuns = 1

Default number of runs / batches

modeHistories = 'num'

‘frac’;

fracHistories = 1e-4

Fraction of histories to compute

numParticlesPerWeight = 1e6
verbosity = struct('timefeatures',0, ... 'maxDetailedErrorReports',0)
minRelWeight = .00001

Threshold for discarding beamlets. 0 means all weights are being considered, can otherwise be assigned to min(w)

useOrigBaseData = false

base data of the original matRad plan will be used?

beamProfile = 'biGaussian'

‘biGaussian’ (emittance); ‘simple’

useEnergySpectrum = false
pencilBeamScanning = true

This should be always true except when using photons (enables deflection)

calc4DInterplay = false

4D Calculation

calcTimeSequence = []
materialConverter = struct('mode','HUToWaterSchneider', ... 'loadConverterFromFile',false)

Image

arrayOrdering = 'F'

‘C’;

rsp_basematerial = 'Water'
scorer = struct('volume',false, ... 'reportQuantity',{{'Sum','Standard_Deviation'}})

Scoring

scorerRBEmodelOrderForEvaluation = {'MCN','WED','LEM','libamtrack'}
bioParameters = struct('PrescribedDose',2, ... 'SimultaneousExposure','"True"')
electronProductionCut = 0.5

Physics

radiationMode
modules_protons = {'g4em-standard_opt4','g4h-phy_QGSP_BIC_HP','g4decay','g4h-elastic_HP','g4stopping','g4ion-QMD','g4radioactivedecay'}
modules_GenericIon = {'g4em-standard_opt4','g4h-phy_QGSP_BIC_HP','g4decay','g4h-elastic_HP','g4stopping','g4ion-QMD','g4radioactivedecay'}
modules_photons = {'g4em-standard_opt4','g4h-phy_QGSP_BIC_HP','g4decay'}
modules_VHEE = {'g4em-standard_opt4','g4h-phy_QGSP_BIC_HP','g4decay','g4ion-binarycascade','g4h-elastic_HP','g4stopping'}

From 10.1002/mp.16697

worldMaterial = 'G4_AIR'

Geometry / World

converterFolder = 'materialConverter'

filenames

scorerFolder = 'scorer'
outfilenames = struct('patientParam','matRad_cube.txt', ... 'patientCube','matRad_cube.dat')
infilenames = struct('geometry','world/TOPAS_matRad_geometry.txt.in', ... 'phaseSpaceSourcePhotons','VarianClinaciX_6MV_20x20_aboveMLC_w2')
topasFolder
MCparam

Struct with parameters of last simulation to be saved to file

ctR

resmpaled CT

Method Summary
setDefaults(this)
writeAllFiles(ct, cst, stf, machine, w)

constructor to write all TOPAS fils for local or external simulation

call

topasConfig.writeAllFiles(ct,pln,stf,machine,w)

Input:
  • ct – Path to folder where TOPAS files are in (as string)

  • pln – matRad plan struct

  • stf – matRad steering struct

  • machine – machine to be used for calculation

  • w – (optional) weights in case of calcDoseDirect

readFiles(folder)

function to read out TOPAS data

call

topasCube = topasConfig.readFiles(folder,dij) topasCube = obj.readFiles(folder,dij)

Input:
  • folder – Path to folder where TOPAS files are in (as string)

  • dij – dij struct (this part needs update)

Output:

topasCube – struct with all read out subfields

getResultGUI(dij)
readExternal(folder)

function to read out complete TOPAS simulation from single folder

call

topasCube = topasConfig.readExternal(folder) topasCube = obj.readExternal(folder)

Input:

folder – Path to folder where TOPAS files are in (as string)

Output:

topasCube – struct with all read out subfields

EXAMPLE calls:

topasCube = topasConfig.readExternal(‘pathToFolder’)

markFieldsAsEmpty(topasCubes)
readTopasCubes(folder)

function to read out TOPAS data

call

topasCube = topasConfig.readTopasCubes(folder,dij) topasCube = obj.readTopasCubes(folder,dij)

Input:
  • folder – Path to folder where TOPAS files are in (as string)

  • dij – dij struct (this part needs update)

Output:

topasCube – struct with all read out subfields

readBinCsvData(~, genFullFile)
prepareDij(topasCubes)

Load ctScen variable

fillDij(topasCubes, dij)

TODO: Insert documentation

writeRunHeader(fID, fieldIx, runIx, ctScen)

TODO: Insert documentation

writeFieldHeader(fID, ctScen, beamIx)

TODO: Insert documentation

writeScorers(fID, beamIx)

TODO: Insert documentation

writeStfFields(ct, stf, w, baseData)

TODO: Insert documentation

writePatient(ct, pln)

matRad export CT RSP data for TOPAS simulation

call

obj.writePatient(ct, path, material)

Input:
  • ct – ct cube

  • pln – plan structure containing doseCalc classes

the image cube contains the indexing of materials since at the moment TOPAS does not support ushort the materials should have indexes between 0 and 32767 therefore, the maximum length of the vector is 32768

writeRangeShifter(~, fID, rangeShifter, sourceToNozzleDistance)

TODO: Insert documentation Hardcoded PMMA range shifter for now

writeMCparam()

TODO: Insert documentation write MCparam file with basic parameters

static isAvailable(pln, machine)

see superclass for information

static providedQuantities(machine)
class DoseEngines.matRad_ParticleMCsquareEngine(pln)

Bases: DoseEngines.matRad_MonteCarloEngineAbstract

Engine for particle dose calculation using monte carlo calculation specifically the mc square method for more information see superclass DoseEngines.matRad_MonteCarloEngineAbstract


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Constructor

call

engine = DoseEngines.matRad_DoseEngineMCsquare(ct,stf,pln,cst)

Input:
  • ct – matRad ct struct

  • stf – matRad steering information struct

  • pln – matRad plan meta information struct

  • cst – matRad cst struct

Property Summary
possibleRadiationModes = {'protons'}
name = 'MCsquare'
shortName = 'MCsquare'
config

Holds an instance of all configurable parameters (matRad_MCsquareConfig)

MCsquareFolder

Folder to the MCsquare installation

workingDir

Working directory for simulation

forceBDL = []

Specify an existing BDL file to load

calcLET = true

Other Dose Calculation Properties

externalCalculation = 'off'
currFolder = pwd

folder path when set

mcSquareBinary

Executable for mcSquare simulation

nbThreads

number of threads for MCsquare, 0 is all available

constantRBE = NaN

constant RBE value

Method Summary
setDefaults(this)
mcSquare_magicFudge(~, energy)

mcSquare will scale the spot intensities in https://gitlab.com/openmcsquare/MCsquare/blob/master/src/data_beam_model.c#L906 by this factor so we need to divide up front to make things work. The original code can be found at https://gitlab.com/openmcsquare/MCsquare/blob/master/src/compute_beam_model.c#L16

static checkBinaries()

checkBinaries check if the binaries are available on the current machine and sets to the mcsquarebinary object property

static isAvailable(pln, machine)

see superclass for information

static providedQuantities(machine)

A dose engine will, by definition, return dose

FRED

Interface components for the FRED Monte Carlo dose calculation engine.

MCsquare

Interface components for the MCsquare fast Monte Carlo proton dose calculation engine.

class matRad_MCsquareBaseData(machine, stf)

Bases: matRad_MCemittanceBaseData

matRad_MCsquareBaseData class for calculating MCsquare base data and writing it to a .txt file, for MCsquare to use


Copyright 2020-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


Call matRad_MCemmitanceBaseData constructor

Method Summary
writeMCsquareData(filepath)

function that writes a data file containing Monte Carlo base data for a simulation with MCsquare

class matRad_MCsquareConfig

matRad_MCsquareConfig class definition

References


Copyright 2019-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


matRad_MCsquareConfig Configuration Class for MCsquare

Property Summary
Num_Primaries = 1e6
Num_Threads = 0;

Simulation parameters:

RNG_Seed = 0;

0 = seed based on the time

Type:

Seed for the random number generator (deterministic result only with single thread). Default

E_Cut_Pro = 0.5;

This parameter can be overwritten through MatRad_Config default parameters

D_Max = 0.2;

0.2

Type:

Maximum distance between two step (cm). Default

Epsilon_Max = 0.25;

0.25

Type:

Fractional energy loss (dE/T) per step. Default

Te_Min = 0.05;

0.05

Type:

Threshold energy (MeV) for the production of secondary electrons (currently locally absorbed). Default

Stat_uncertainty = 0.0

0.0 = no maximum uncertainty (number of proton = numHistories)

Type:

Maximum statistical uncertainty (in percent). Default

CT_File = 'Patient.mhd';

Input files

HU_Density_Conversion_File = 'Scanners/matRad_default/HU_Density_Conversion.txt';

HU_Density_Conversion.txt

Type:

Name of the file containing HU to density conversion data. Default

HU_Material_Conversion_File = 'Scanners/matRad_default/HU_Material_Conversion.txt';

HU_Material_Conversion.txt

Type:

Name of the file containing HU to material conversion data. Default

BDL_Machine_Parameter_File = 'BDL/BDL_matrad.txt';

BDL.txt

Type:

Name of the machine parameter file for the beam data library. Default

BDL_Plan_File = 'PlanPencil.txt';

Plan.txt

Type:

Name of the plan file for the beam data library. Default

Simulate_Nuclear_Interactions = true

Physical parameters

Simulate_Secondary_Protons = true

True

Type:

Enable/Disable the simulation of secondary protons (emitted during nuclear interactions). Default

Simulate_Secondary_Deuterons = true

True

Type:

Enable/Disable the simulation of secondary deuterons (emitted during nuclear interactions). Default

Simulate_Secondary_Alphas = true

True

Type:

Enable/Disable the simulation of secondary alphas (emitted during nuclear interactions). Default

fourD_Mode = false;

4D simulation

fourD_Dose_Accumulation = false;

False

Type:

Enable/Disable the dose accumulation for all 4D-CT phases. Default

Field_type = 'Velocity';

Displacement or Velocity. Default: Velocity

Type:

Field type

Create_Ref_from_4DCT = false;

False

Type:

Create the reference phase image from 4D CT images (True), or import the reference image (False). Default

Create_4DCT_from_Ref = false;

False

Type:

Create 4D CT images by deforming the reference phase image (True), or import 4D CT images (False). Default

Dynamic_delivery = false;

False

Type:

Enable/Disable simulation of dynamic delivery (interplay simulation). Default

Breathing_period = 7.0;

7.0

Type:

Period (in seconds) of the breathing motion. Default

Robustness_Mode = false;

Robustness simulation

Simulate_nominal_plan = true;

All (simulate all combinations), Random (randomly sample scenarios). Default: All

Type:

Scenario_selection = ‘All’ % Method for scenario selection

Beamlet_Mode = false;

Beamlet simulation

Beamlet_Parallelization = false;

False

Type:

Parallelization on beamlet level is sometimes faster for beamlet simulation. This requires more memory. Default

Output_Directory = 'MCsquareOutput';

Output parameters

Energy_ASCII_Output = false;

False

Type:

Enable/Disable the output of Energy in ASCII format. Default

Energy_MHD_Output = false;

False

Type:

Enable/Disable the output of Energy in MHD format. Default

Energy_Sparse_Output = false;

False

Type:

Enable/Disable the output of Energy in Sparse matrix format. Default

Dose_ASCII_Output = false;

False

Type:

Enable/Disable the output of Dose in ASCII format. Default

Dose_MHD_Output = true;

True

Type:

Enable/Disable the output of Dose in MHD format. Default

Dose_Sparse_Output = true;

False

Type:

Enable/Disable the output of Dose in Sparse matrix format. Default

LET_ASCII_Output = false;

False

Type:

Enable/Disable the output of LET in ASCII format. Default

LET_MHD_Output = false;

False

Type:

Enable/Disable the output of LET in MHD format. Default

LET_Sparse_Output = false;

False

Type:

Enable/Disable the output of LET in Sparse matrix format. Default

Densities_Output = false;

False

Type:

Enable/Disable the export of the density map (converted from the CT image). Default

Materials_Output = false;

False

Type:

Enable/Disable the export of the map of materials (converted from the CT image). Default

Compute_DVH = false;

False

Type:

Enable/Disable the computation and export of DVH based on RT-Struct binary masks. Default

Dose_Sparse_Threshold = 0;

0

Type:

The dose values above the threshold will be stored in the sparse matrix file. Default

Energy_Sparse_Threshold = 0;

0

Type:

The energy values above the threshold will be stored in the sparse matrix file. Default

LET_Sparse_Threshold = 0;

0

Type:

The LET values above the threshold will be stored in the sparse matrix file. Default

Score_PromptGammas = false;

False

Type:

Enable/Disable the scoring of Prompt Gammas (emitted during nuclear interactions). Default

PG_LowEnergyCut = 0.0;

0.0

Type:

Disable the scoring of Prompt Gammas with energy below this value (MeV). Default

PG_HighEnergyCut = 50.0;

50.0

Type:

Disable the scoring of Prompt Gammas with energy above this value (MeV). Default

PG_Spectrum_NumBin = 150;

Typical gamma camera would be sensitive between 3.0 and 6.0 MeV

PG_Spectrum_Binning = 0.1;

0.1

Type:

Bin width (MeV) for the scoring of Prompt Gamma spectrum. Default

LET_Calculation_Method = 'StopPow'

StopPow

Type:

Select the method employed for the calculation of LET (DepositedEnergy, StopPow). Default

Dose_to_Water_conversion = 'Disabled'

Disable

Type:

Export_Beam_dose = ‘Disabled’ % Export dose distribution for each beam (Enable) or entire plan (Disable). Default

Dose_Segmentation = false;

False

Type:

Enable/Disable a segmentation of the dose map based on a density thresholding (remove dose artifacts in the air). Default

Density_Threshold_for_Segmentation = 0.01;

0.01

Type:

Density threshold employed for the segmentation (in g/cm3). Default

Method Summary
write(fid)
matRad_compileMCsquareSparseReader(dest, sourceFolder)

Compiles the sparse mcsquare reader as mex interface for the current platform

call

matRad_compileMCsquareSparseReader() matRad_compileMCsquareSparseReader(dest) matRad_compileMCsquareSparseReader(dest,sourceFolder)

Input:
  • dest – (optional) destination for mex file. Default: location of this file

  • sourceFolder – (optional) path to folder. Default: location of this file

References


Copyright 2020-2026 the matRad development team.

This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSE.md. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file.


TOPAS

Interface componentsfor the TOPAS Monte Carlo dose calculation engine.