How to configure your plan?
Before you can start with dose calculation and inverse planning in matRad you need to set a couple of general treatment plan parameters.
Within the main matRad script, this corresponds to the first cell. Within the GUI, these settings can be adjusted interactively.
18%% load patient data, i.e. ct, voi, cst
19load TG119.mat
20%load HEAD_AND_NECK
21%load PROSTATE.mat
22%load LIVER.mat
23%load BOXPHANTOM.mat
24
25% meta information for treatment plan
26pln.numOfFractions = 30;
27pln.radiationMode = 'photons'; % either photons / protons / helium / carbon / brachy / VHEE
28pln.machine = 'Generic'; % generic for RT / LDR or HDR for BT / Generic or Focused for VHEE
29
30pln.bioModel = 'none'; % none: for all % constRBE: constant RBE for photons and protons
31 % MCN: McNamara-variable RBE model for protons % WED: Wedenberg-variable RBE model for protons
32 % LEM: Local Effect Model for carbon ions % HEL: data-driven RBE parametrization for helium
33
34pln.multScen = 'nomScen'; % scenario creation type 'nomScen' 'wcScen' 'impScen' 'rndScen'
35
36% beam geometry settings
37pln.propStf.bixelWidth = 5; % [mm] / also corresponds to lateral spot spacing for particles
38pln.propStf.gantryAngles = [0:72:359]; % [°] ;
39pln.propStf.couchAngles = [0 0 0 0 0]; % [°] ;
40pln.propStf.isoCenter = matRad_getIsoCenter(cst,ct,0);
41
42% dose calculation settings
43pln.propDoseCalc.doseGrid.resolution.x = 5; % [mm]
44pln.propDoseCalc.doseGrid.resolution.y = 5; % [mm]
45pln.propDoseCalc.doseGrid.resolution.z = 5; % [mm]
46
47% optimization settings
48pln.propOpt.quantityOpt = 'physicalDose'; % Quantity to optimizer (could also be RBExDose, BED, effect)
49pln.propOpt.optimizer = 'IPOPT'; % We can also utilize 'fmincon' from Matlab's optimization toolbox
50pln.propOpt.runDAO = false; % 1/true: run DAO, 0/false: don't / will be ignored for particles
51pln.propSeq.runSequencing = true; % true: run sequencing, false: don't / will be ignored for particles and also triggered by runDAO below
After import of patient data in matRad’s native format, the desired settings are specified in the pln struct.
Note that besides some basic parameters (like number of fractions or the machine), there are workflow-specific property structures in pln.prop*. These structures contain the parameters for the different workflows, such as the dose influence matrix calculation, optimization, and sequencing. matRad will instatiate the appropriate algorithm based on these configurations and try to override their properties.
The matRad.m script uses the top-level API. The top-level functions are designed to take the main data structures as input and configure the corresponding workflow step via the pln using the attribute dictionaries pln.prop*:
Plan property |
API function |
Description |
ID |
Folder |
|---|---|---|---|---|
|
Create beam Geometry |
generator |
||
|
Calculate dose matrix / distribution |
engine |
||
|
Optimization of beam fluences |
problem |
||
|
Sequencing of beams |
sequencer |
Please see the corresponding page about the pln struct for further information.
Note that matRad comes with sample patient data from the CORT dataset: common optimization for radiation therapy so you can directly play around with all functionalities. More information can be found on the dedicated CORT dataset section.