Back to Software Spotlights Overview

### Centres

German Cancer Research Center (DKFZ)

### Keywords

Medical Physics Radiotherapy Particle Therapy Treatment Planning

Health

Medical Physics

### Funding

DFG (Grant No. WA 4707/1-1)

Matlab, C/C++

GPL-3.0-or-later

free

### Cite

10.5281/zenodo.3879615

# matRad: An open source dose calculation and treatment planning toolkit for research and education

matRad is an open source software for radiation treatment planning of intensity-modulated photon, proton, and carbon ion therapy started in 2015 in the research group “Radiotherapy Optimization” within the Department of Medical Physics in Radiation Oncology at the German Cancer Research Center - DKFZ.

matRad targets education and research in radiotherapy treatment planning, where the software landscape is dominated by proprietary medical software. As of August 2022, matRad had more than 130 forks on GitHub and its development paper was cited more than 160 times (according to Google Scholar). matRad is entirely written in MATLAB and mostly compatible to GNU Octave.

• MATLAB functions to model the entire treatment planning workflow
• Example patient data from the CORT dataset
• Physical and biological base data for all required computations

In particular we provide functionalities for

• Pencil-beam dose calculation for photon IMRT and proton/carbon IMPT
• Monte Carlo dose calculation for photon IMRT (with ompMC) and proton IMPT (with MCsquare)
• Non-linear constrained treatment plan optimization (based on physical dose, RBE-weighted dose and biological effect) using IPOPT or Matlab’s fmincon
• Multileaf collimator sequencing
• Basic treatment plan visualization and evaluation
• Graphical User Interface
• Standalone Executable (using the Matlab Runtime)

matRad is constantly evolving. If you are interested in working with us or are looking for a special feature do not hesitate and get in touch.

## Philosophy

matRad provides a graphical user interface for educational purposes and basic treatment plan prameterization and visualization.

Screenshot of matRad's graphical user interface visualizing the biologically effective dose of a carbon ion treatment plan using opposing lateral beams for a prostate patient.

matRad uses Matlab’s dual scripting & visualization environment to allow a parallel workflow, alternating between scripting / command line input and triggering workflow steps in the graphical user interface. A script to recreate the above treatment plan within matRad 2.10.1 is shown below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

% load patient data, i.e. ct, voi, cst

% meta information for treatment plan
pln.radiationMode   = 'carbon';     % either photons / protons / carbon
pln.machine         = 'Generic';

pln.numOfFractions  = 30;

% beam geometry settings
pln.propStf.bixelWidth      = 5; % [mm] / lateral spot spacing for particles
pln.propStf.gantryAngles    = [90 270]; % [?]
pln.propStf.couchAngles     = [0 0]; % [?]
pln.propStf.numOfBeams      = numel(pln.propStf.gantryAngles);

% dose calculation settings
pln.propDoseCalc.doseGrid.resolution.x = 5; % [mm]
pln.propDoseCalc.doseGrid.resolution.y = 5; % [mm]
pln.propDoseCalc.doseGrid.resolution.z = 5; % [mm]

% optimization settings
pln.propOpt.optimizer       = 'IPOPT';
pln.propOpt.bioOptimization = 'LEMIV_effect';

%% generate steering file

%% dose calculation