matRad is a dose calculation and inverse treatment planning toolkit for radiotherapy research and education written in Matlab.
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.
matRad comprises
In particular we provide functionalities for
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.
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:
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.