Ctrl K

matRad

matRad is a dose calculation and inverse treatment planning toolkit for radiotherapy research and education written in Matlab.

305
mentions
54
contributors
Get started
2755 commitsLast commit ≈ 1 week ago273 stars199 forks

Cite this software

Description

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 March 2026, matRad had nearly 200 forks on GitHub and its development paper was cited more than 430 times (according to Google Scholar). matRad is entirely written in MATLAB, while GNU Octave compatibility guarantees free usage.

matRad comprises

  • 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/helium/carbon IMPT
  • Pencil-beam dose calculation for very-high energy electron therapy (VHEE)
  • TG43 dose model for brachytherapy
  • Monte Carlo dose calculation for photon IMRT (with ompMC) and proton IMPT (with MCsquare)
  • Interface to TOPAS for general-purpose simulations of all modalities (photons, VHEE, ions)
  • 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.
matRad's graphical user interface (GUI)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:

matRad_rc

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

% 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);
pln.propStf.isoCenter       = ones(pln.propStf.numOfBeams,1) * matRad_getIsoCenter(cst,ct,0);

% 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
stf = matRad_generateStf(ct,cst,pln);

%% dose calculation
dij = matRad_calcParticleDose(ct,stf,pln,cst);

%% inverse planning for imrt
resultGUI = matRad_fluenceOptimization(dij,cst,pln);

%% start gui for visualization of result
matRadGUI

For educational purposes, matRad is also available as a standalone application.

Logo of matRad
Keywords
Programming languages
  • MATLAB 99%
  • Other 1%
License
</>Source code
Software Heritage
Archived | swh:1:dir:b9f7b09c937720ef3c598bd4ffdcdfa147f429a1

Participating organisations

German Cancer Research Center

Reference papers

Mentions

Contributors

NW
Niklas Wahl
Maintainer
Deutsches Krebsforschungszentrum
NA
Nelly Abbani
NA
Nabe Al-Hasnawi
BA
Benjamin Ackermann
MB
Mark Bangert
TB
Tobias Becher
AB
Amit Ben Antony Bennan
LB
Lucas Burigo
GC
Gonzalo Cabal
EC
Eduardo Cisternas
LC
Louis Charton
EC
Eric Christiansen