optimization

Optimization Problems

An optimization problem combines the individual objectives into an objective function and organizes the constraint structure, handing a standard optimization problem to the optimizer. Advanced planning problems are implemented as subclasses: direct aperture optimization for static apertures, and its VMAT counterpart for arcs.

class matRad_OptimizationProblem(backProjection)

Bases: handle

matRad_OptimizationProblem Main Class for fluence optimization problems Describes a standard fluence optimization problem by providing the implementation of the objective & constraint function/gradient wrappers and managing the mapping and backprojection of the respective dose- related quantity

References

[1] https://doi.org/10.1093/imanum/draa038 [2] https://doi.org/10.1002/mp.14148


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.


Property Summary
BP
quantityOpt = ''
useMaxApprox = 'logsumexp'

‘pnorm’; %’logsumexp’; %’none’;

p = 30

Can be chosen larger (closer to maximum) or smaller (closer to mean). Only tested 20 >= p >= 1

minimumW = NaN
maximumW = NaN
fluenceObjectives = {}

Objectives acting on the fluence vector directly instead of on the dose (see FluenceObjectives.matRad_FluenceObjective). They bypass the backprojection, so their gradient is added to the weight gradient without a chain rule.

Method Summary
lowerBounds(optiProb, w)
upperBounds(optiProb, w)
matRad_objectiveFunction(optiProb, w, dij, cst)

matRad IPOPT objective function wrapper

call

f = matRad_objectiveFuncWrapper(optiProb,w,dij,cst)

Input:
  • optiProb – matRad optimization problem

  • w – beamlet/ pencil beam weight vector

  • dij – matRad dose influence struct

  • cst – matRad cst struct

  • scenario – index of dij scenario to consider (optional: default 1)

Output:

f – objective function value

References

Copyright 2016-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_getConstraintBounds(optiProb, cst)

matRad IPOPT get constraint bounds wrapper function

call

[cl,cu] = matRad_getConstraintBounds(optiProb,cst)

Input:

cst – matRad cst struct

Output:
  • cl – lower bounds on constraints

  • cu – lower bounds on constraints

References

Copyright 2016-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_objectiveGradient(optiProb, w, dij, cst)

matRad IPOPT callback: gradient function for inverse planning supporting mean dose objectives, EUD objectives, squared overdosage, squared underdosage, squared deviation and DVH objectives

call

g = matRad_gradFuncWrapper(optiProb,w,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • w – bixel weight vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

g – gradient of objective function

References

[1] http://www.sciencedirect.com/science/article/pii/S0958394701000577 [2] http://www.sciencedirect.com/science/article/pii/S0360301601025858


matRad_constraintFunctions(optiProb, w, dij, cst)

matRad IPOPT callback: constraint function for inverse planning supporting max dose constraint, min dose constraint, min mean dose constraint, max mean dose constraint, min EUD constraint, max EUD constraint, max DVH constraint, min DVH constraint

call

c = matRad_constraintFunctions(optiProb,w,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • w – bixel weight vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

c – value of constraints

References

Copyright 2016-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_getJacobianStructure(optiProb, w, dij, cst)

matRad IPOPT callback: jacobian structure function for inverse planning supporting max dose constraint, min dose constraint, min mean dose constraint, max mean dose constraint, min EUD constraint, max EUD constraint, max DVH constraint, min DVH constraint

call

jacobStruct = matRad_getJacobStruct(optiProb,w,dij,cst)

Input:
  • optiProb – matRad optimization problem

  • w – beamlet/ pencil beam weight vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

jacobStruct – jacobian of constraint function

References


Copyright 2016-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_constraintJacobian(optiProb, w, dij, cst)

matRad IPOPT callback: jacobian function for inverse planning supporting max dose constraint, min dose constraint, min mean dose constraint, max mean dose constraint, min EUD constraint, max EUD constraint, max DVH constraint, min DVH constraint

call

jacob = matRad_jacobFunc(optiProb,w,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • w – bixel weight vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

jacob – jacobian of constraint function

References


class matRad_OptimizationProblemDAO(backProjection, apertureInfo)

Bases: matRad_OptimizationProblem

matRad_OptimizationProblemDAO Optimization Problem for Direct Aperture Optimization Adapts the beamlet weights, manages the aperture and adds leaf constraints to the standard fluence optimization problem

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.


Property Summary
apertureInfo

Structure storing the current aperture/shape information

Method Summary
lowerBounds(w)
upperBounds(w)
matRad_objectiveFunction(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: objective function for direct aperture optimization

call

f = matRad_objectiveFunction(optiProb,apertureInfoVect,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • apertureInfoVec – aperture info in form of vector

  • dij – matRad dij struct as generated by bixel-based dose calculation

  • cst – matRad cst struct

Output:

f – objective function value

References

[1] http://dx.doi.org/10.1118/1.4914863


matRad_getConstraintBounds(optiProb, cst)

matRad IPOPT get constraint bounds function for direct aperture optimization

call

[cl,cu] = matRad_daoGetConstBounds(optiProb,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • cst – matRad cst struct

Output:
  • cl – lower bounds on constraints

  • cu – lower bounds on constraints

References


matRad_daoApertureInfo2Vec(apertureInfo)

matRad function to generate a vector representation of objects A vector representation of the aperture weights and shapes and (optional) some meta information needed during optimization is generated.

call

[apertureInfoVec, mappingMx, limMx] = matRad_daoApertureInfo2Vec(apertureInfo)

Input:

apertureInfo – aperture weight and shape info struct

Output:
  • apertureInfoVec – vector representation of the apertue weights and shapes

  • mappingMx – mapping of vector components to beams, shapes and leaves

  • limMx – bounds on vector components, i.e., minimum and maximum aperture weights (0/inf) and leav positions (custom)

References


matRad_objectiveGradient(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: gradient function for direct aperture optimization

call

g = matRad_objectiveGradient(optiProb,apertureInfoVec,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • apertureInfoVect – aperture info in form of vector

  • dij – matRad dij struct as generated by bixel-based dose calculation

  • cst – matRad cst struct

Output:

g – gradient

References

[1] http://dx.doi.org/10.1118/1.4914863


matRad_constraintFunctions(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: constraint function for direct aperture optimization

call

c = matRad_constraintFunctions(optiProb,apertureInfoVec,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • apertueInfoVec – aperture info vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

c – value of constraints

Reference

[1] http://www.sciencedirect.com/science/article/pii/S0958394701000577 [2] http://www.sciencedirect.com/science/article/pii/S0360301601025858


matRad_getJacobianStructure(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: get jacobian structure for direct aperture optimization

call

jacobStruct = matRad_daoGetJacobStruct(optiProb,apertureInfoVec,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • apertureInfoVect – aperture weights and shapes parameterized as vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

jacobStruct – jacobian of constraint function

References


matRad_constraintJacobian(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: jacobian function for direct aperture optimization

call

jacob = matRad_daoJacobFunc(optiProb,apertureInfoVec,dij,cst)

Input:
  • optiProb – option struct defining the type of optimization

  • apertureInfoVec – aperture info vector

  • dij – dose influence matrix

  • cst – matRad cst struct

Output:

jacob – jacobian of constraint function

References


matRad_daoVec2ApertureInfo(apertureInfo, apertureInfoVect)

matRad function to translate vector representation into struct The vector representation of the aperture shape and weight are translated into an aperture info struct. At the same time, the updated bixel weight vector w is computed and a vector listing the correspondence between leaf tips and bixel indices for gradient calculation

call

updatedInfo = matRad_daoVec2ApertureInfo(apertureInfo,apertureInfoVect)

Input:
  • apertureInfo – aperture shape info struct

  • apertureInfoVect – aperture weights and shapes parameterized as vector

Output:

updatedInfo – updated aperture shape info struct according to apertureInfoVect

References


class matRad_OptimizationProblemVMAT(backProjection, apertureInfo)

Bases: matRad_OptimizationProblemDAO

handle class to keep state easily

Method Summary
matRad_getConstraintBounds(optiProb, cst)

matRad IPOPT get constraint bounds function for VMAT

call

[cl,cu] = matRad_daoGetConstBounds(cst,apertureInfo,type)

input

cst: matRad cst struct apertureInfo: aperture info struct options: option struct defining the type of optimization

output

cl: lower bounds on constraints cu: lower bounds on constraints

References


matRad_daoApertureInfo2Vec(apertureInfo)

matRad function to generate a vector representation of the aperture weights and shapes and (optional) some meta information needed during optimization

call

[apertureInfoVec, mappingMx, limMx] = matRad_daoApertureInfo2Vec(apertureInfo)

input

apertureInfo: aperture weight and shape info struct

output

apertureInfoVec: vector representation of the aperture weights and shapes mappingMx: mapping of vector components to beams, shapes and leaves limMx: bounds on vector components, i.e., minimum and maximum aperture weights (0/inf) and leaf positions (custom)

References


matRad_constraintFunctions(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: constraint function for VMAT

call

c = matRad_daoObjFunc(apertueInfoVec,dij,cst)

input

apertueInfoVec: aperture info vector dij: dose influence matrix cst: matRad cst struct options: option struct defining the type of optimization

output

c: value of constraints

Reference

[1] http://www.sciencedirect.com/science/article/pii/S0958394701000577 [2] http://www.sciencedirect.com/science/article/pii/S0360301601025858


matRad_getJacobianStructure(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: get jacobian structure for direct aperture optimization

call

jacobStruct = matRad_daoGetJacobStruct(apertureInfo,dij,cst)

input

apertureInfo: aperture info struct dij: dose influence matrix cst: matRad cst struct

output

jacobStruct: jacobian of constraint function

References


matRad_constraintJacobian(optiProb, apertureInfoVec, dij, cst)

matRad IPOPT callback: jacobian function for VMAT optimization

call

jacob = matRad_constraintJacobian(optiProb,apertureInfoVec,dij,cst)

input

apertureInfoVec: aperture info vector dij: dose influence matrix cst: matRad cst struct

output

jacob: jacobian of constraint function

References


matRad_daoVec2ApertureInfo(apertureInfo, apertureInfoVect)

matRad function to translate the vector representation of the aperture shape and weight into an aperture info struct. At the same time, the updated bixel weight vector w is computed and the analytic Jacobian between bixel weights and aperture vector entries is assembled

call

updatedInfo = matRad_daoVec2ApertureInfo(apertureInfo,apertureInfoVect)

input

apertureInfo: aperture shape info struct apertureInfoVect: aperture weights and shapes parameterized as vector

output

updatedInfo: updated aperture shape info struct according to apertureInfoVect

References


Local functions

matRad_fractionateCstFunctions(cst, numOfFractions)

matRad function to prepare the optimization functions stored in the cst for a fractionated optimization

Promotes every objective/constraint in cst{:,6} to an optimization function object (accepting the legacy struct formats) and rescales the dose parameters of the dose related ones from the prescribed total dose to the dose per fraction. Functions that do not act on a dose related quantity (e.g. fluence objectives) are promoted but left untouched.

call

cst = matRad_fractionateCstFunctions(cst,numOfFractions)

Input:
  • cst – matRad cst struct

  • numOfFractions – number of fractions the plan is delivered in

Output:

cst – matRad cst struct with objects in cst{:,6} whose dose parameters refer to a single fraction


Copyright 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_prepareBiologicalOptimizationDij(dij, cst, backProjection)

matRad_prepareBiologicalOptimizationDij prepares biological dij metadata

call

dij = matRad_prepareBiologicalOptimizationDij(dij,cst,backProjection)

input

dij: matRad dij struct cst: matRad cst struct on the dose grid backProjection: matRad backprojection object

output

dij: dij with biological ax/bx, ixDose and gamma metadata


Copyright 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_preconditionFactors(apertureInfo)

Calculate preconditioning factors for DAO (only what Esther Wild called the Jacobi preconditioner, not the dij scaled). Scale weights in vector accordingly.

call

apertureInfo = matRad_preconditionFactors(apertureInfo)

input

apertureInfo: aperture shape info struct

output

apertureInfo: aperture shape info struct with new factors

References

[1] http://onlinelibrary.wiley.com/doi/10.1118/1.4914863/full


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 matRad_FluenceOptimizationFunction(varargin)

Bases: matRad_OptimizationFunction

matRad_FluenceOptimizationFunction. Superclass for fluence objectives and constraints. This is the superclass for all objectives and constraints acting on the bixel weight vector w itself instead of on a dose related quantity. No dose is involved, so these functions take no part in the backprojection / chain rule - their gradient is a gradient w.r.t. the weights already.

A fluence function is tied to the beamlet layout, which it takes from the dij in setupForDij. That is called once during the initialization of the optimization problem (see matRad_getFluenceObjectives), not by the user. isCompatible reports whether that has happened and whether the dimensions still match.

Note on what can be expressed: the dij only carries the mapping to the stf (which bixel belongs to which beam), not the beamlet geometry itself. Fluence functions built from a dij alone are therefore beam-wise. Anything resolving the position of a bixel within its beam - e.g. smoothing that couples neighbouring bixels - needs the stf and has to wait until the optimization entry point receives it.


Copyright 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
numOfBixels = NaN

not set up yet)

Type:

number of bixels this function was set up for (NaN

bixelIx = []

not set up yet)

Type:

global bixel indices the function acts on (empty

Method Summary
setupForDij(dij)

#ok<INUSD> Build the dij dependent part of the function. The default does nothing - functions that do not depend on the beamlet layout are usable right after construction.

isCompatible(totalNumOfBixels)

Check whether the function can be evaluated for a weight vector of the given length.

static getDefaultBeams(dij)

Beams a fluence function should act on by default. For a VMAT plan only the FMO beams carry a fluence that is optimized; the remaining control points are bounded to zero.

static getBeamBixels(dij, beams)

Global bixel indices of each requested beam, taken from the bixel-to-beam mapping the dij carries. Works for any modality - no assumption on bixels per ray.

Output:

beamBixelIx – cell array, one index vector per requested beam

class matRad_DoseOptimizationFunction(varargin)

Bases: matRad_OptimizationFunction

matRad_DoseOptimizationFunction. Superclass for dose objectives and constraints. This is the superclass for all objectives and constraints acting on the dose, to enable easy one-line identification. It adds the dose parameter accessors and the robustness setting to the generic matRad_OptimizationFunction.


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
robustness = 'none'

Robustness setting -> may be removed from the DoseObjective class in a future release

Method Summary
struct()
getDoseParameters()

get only the dose related parameters.

setDoseParameters(doseParams)

set only the dose related parameters.

static createInstanceFromStruct(s)
static availableRobustness()
static convertOldOptimizationStruct(oldStruct)

Converts old version objectives to current format

matRad_clearUnusedVoxelsFromDij(cstOnDoseGrid, dij, scenarios)

matRad function to set the voxels in dij that are not used for optimization.

call

[dij] = matRad_clearUnusedVoxelsFromDij(cst, dij) [dij] = matRad_clearUnusedVoxelsFromDij(cst, dij, scenarios) [dij, mask] = matRad_clearUnusedVoxelsFromDij(cst, dij) [dij, mask] = matRad_clearUnusedVoxelsFromDij(cst, dij, scenarios)

Input:
  • cstInDoseGrid – cst (on dose grid)

  • dij – dij struct

  • scenarios (optional) – explicitly define the scenario indexes that need to be cleared

Output:
  • dij – cleared dij struct

  • mask (optional) – cell array containig the mask that has been applied to every ct scenario


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.


matRad_getObjectivesAndConstraints()

matRad steering information generation

call

classNames = matRad_getObjectivesAndConstraints()

Output:

classNames – contains class names (row 1) and display descriptions (row 2) of all available objectives

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_calcBixelWeightAndGradient(calcOptions, mlcOptions, variables, vectorIndices, accum)

matRad function to calculate the bixel weights from the aperture vector, and also the Jacobian matrix relating these two.

call

accum = matRad_calcBixelWeightAndGradient(calcOptions,mlcOptions,variables,vectorIndices,accum)

input

calcOptions: what to compute for this shape (isDAOBeam, saveJacobian) mlcOptions: MLC geometry of the beam (leaf limits, bixel edges, maps) variables: leaf positions, weights and times of the current shape vectorIndices: where this shape’s variables live in the aperture vector accum: accumulators carried across the per-shape calls:

.w             bixel weight vector
.bixelJApVec   Jacobian triplets, fields .vec .i .j
.sumGradSq     squared gradient sum (Jacobi precond.)
.shapeMapW     weighted shape map of the current shape
.counters      running offsets, see .bixelJApVecOffset
output
accum: the same accumulator struct, updated with this shape’s

contribution

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_getFluenceObjectives(pln, cst, dij)

matRad helper collecting and initializing the fluence objectives of a plan

Fluence objectives (see matRad_FluenceOptimizationFunction) act on the bixel weight vector directly instead of on the dose. They can be given in two places:

pln.propOpt.fluenceObjectives   cell array (or single object) of
                                objectives that are not tied to a
                                particular structure - the usual place
cst{i,6}                        alongside the dose objectives of a
                                structure; the structure itself is
                                ignored, the objective still acts on the
                                whole fluence

A fluence objective is a pure specification until it is set up for a beamlet geometry. This function performs that setup from the dij, so that the caller only has to hand over the collected objectives.

call

fluenceObjectives = matRad_getFluenceObjectives(pln,cst,dij)

Input:
  • pln – matRad pln struct

  • cst – matRad cst struct

  • dij – matRad dij struct, providing the beamlet geometry the objectives are set up for. Pass [] to only collect them without setup.

Output:

fluenceObjectives – cell array of initialized fluence objectives


Copyright 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_collapseStf(stf, mode)

matRad collapse stf function for simulation of 3D conformal treatments. Function to supress intensity-modulation for photons in order to simulate 3D conformal treatments.

call

stf = matRad_collapseStd(stf)

Input:
  • stf – steering information

  • mode – collpase mode, beam or ray

Output:

dijNew – collapsed dose influence matrix

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_refineApertureArc(ct, cst, pln, apertureInfo, angularSpacing, varargin)
matRad_refineApertureArc resamples an optimized VMAT plan onto a new

(usually finer) gantry-angle grid. The apertures optimized at the DAO control points are interpolated onto the new angles and the bixel weights are recomputed, yielding a steering struct and aperture info ready for a forward dose calculation. No dose is computed here.

call

[stf, apertureInfo] = matRad_refineApertureArc(ct, cst, pln, apertureInfo, angularSpacing) [stf, apertureInfo] = matRad_refineApertureArc(…, ‘interpNew’, tf) [stf, apertureInfo] = matRad_refineApertureArc(…, ‘reuseDij’, tf) [stf, apertureInfo] = matRad_refineApertureArc(…, ‘continuousAperture’, tf)

Input:
  • ct – matRad ct struct

  • cst – matRad cst cell array

  • pln – the plan used for the original optimization (its propStf.gantryAngles hold the arc anchor points)

  • apertureInfo – aperture info from the optimization result

  • angularSpacing – target gantry angle spacing of the new grid [deg]

name-value parameters:
interpNew: interpolate new apertures at the new angles (true,

default) or force every new angle to be its own DAO control point (false)

reuseDij: duplicate/redirect the new beams onto the original

DAO angles so that an existing dij’s columns can be recycled instead of recomputing the dose. Default false. See the VMAT example for the back-projection.

continuousAperture: interpolate leaf positions within a Dij arc. Default

taken from apertureInfo.continuousAperture.

Output:
  • stf – steering struct on the new angular grid

  • apertureInfo – aperture info resampled onto the new grid, including the recomputed bixelWeights


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_calcInversDVH(volume, doseVec)

matRad inverse DVH (Dose Volume Histogram) calculation

call

dose = matRad_calcInversDVH(volume,doseVec)

Input:
  • volume – rel volume of structure

  • doseVec – dose vector of specific structure

Output:

dose – dose that corresponds to rel volume

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_collapseDij(dij, mode)

matRad collapse dij function for simulation of 3D conformal treatments. Function to supress intensity-modulation for photons in order to simulate 3D conformal treatments.

call

dijNew = matRad_collapseDij(dij)

Input:
  • dij – dose influence matrix

  • mode – collpase mode, beam or ray

Output:

dijNew – collapsed dose influence matrix

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.


class matRad_OptimizationFunction(dataStruct)

matRad_OptimizationFunction. Superclass for all optimization functions. This is the common ancestor of every objective and constraint, no matter which quantity it acts on. It only provides what is genuinely independent of that quantity: the parameter description used by the GUI, struct serialization and instantiation from a struct.

The quantity specific bases derive from it:

matRad_DoseOptimizationFunction     functions of the dose (adds the dose
                                    parameter accessors and robustness)
matRad_FluenceOptimizationFunction  functions of the fluence vector

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
name

Display name of the function. Needs to be implemented in sub-classes.

parameterNames

Cell array of display names of the parameters. Needs to be implemented in sub-classes.

parameterTypes

Cell array of parameter types. Valid types are ‘dose’, ‘numeric’, or a cell list of string options.

parameters
Method Summary
struct()
assignCommonPropertiesFromStruct(s)
static createInstanceFromStruct(s)
matRad_SFUDoptimization(pln, cst, dij, ct, stf)

Calculation of single field uniform dose (SFUD) optimization If provided the dij matrix is used for optimisation, otherwise single beam dijs are calculated (memory saving).

call

[resultGUI] = matRad_SFUDoptimization(pln, cst, dij) or [resultGUI] = matRad_SFUDoptimization(pln, cst, [], ct, stf)

Input:
  • pln – matRad pln struct

  • cst – matRad cst struct

  • dij – matRad dij struct (optional)

  • ct – matRad ct struct (optional, only needed if no dij provided)

  • stf – matRad stf struct (optional, only if needed no dij provided)

Output:
  • resultGUI – struct containing optimized fluence vector, dose, and (for biological optimization) RBE-weighted dose etc.

  • (info – struct containing information about optimization)

References

[1] https://ro-journal.biomedcentral.com/articles/10.1186/s13014-016-0705-8


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.