forked from e0404/matRad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matRad.m
87 lines (69 loc) · 3.18 KB
/
matRad.m
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
% matRad script
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 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/LICENSES.txt. 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_rc
% load patient data, i.e. ct, voi, cst
%load HEAD_AND_NECK
load TG119.mat
%load PROSTATE.mat
%load LIVER.mat
%load BOXPHANTOM.mat
% meta information for treatment plan
pln.radiationMode = 'photons'; % either photons / protons / carbon
pln.machine = 'Generic';
pln.numOfFractions = 30;
% beam geometry settings
pln.propStf.bixelWidth = 5; % [mm] / also corresponds to lateral spot spacing for particles
pln.propStf.gantryAngles = [0:72:359]; % [?]
pln.propStf.couchAngles = [0 0 0 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 = 'none'; % none: physical optimization; const_RBExD; constant RBE of 1.1;
% LEMIV_effect: effect-based optimization; LEMIV_RBExD: optimization of RBE-weighted dose
pln.propOpt.runDAO = false; % 1/true: run DAO, 0/false: don't / will be ignored for particles
pln.propOpt.runSequencing = false; % 1/true: run sequencing, 0/false: don't / will be ignored for particles and also triggered by runDAO below
%% initial visualization and change objective function settings if desired
matRadGUI
%% generate steering file
stf = matRad_generateStf(ct,cst,pln);
%% dose calculation
if strcmp(pln.radiationMode,'photons')
dij = matRad_calcPhotonDose(ct,stf,pln,cst);
%dij = matRad_calcPhotonDoseVmc(ct,stf,pln,cst);
elseif strcmp(pln.radiationMode,'protons') || strcmp(pln.radiationMode,'carbon')
dij = matRad_calcParticleDose(ct,stf,pln,cst);
end
%% inverse planning for imrt
resultGUI = matRad_fluenceOptimization(dij,cst,pln);
%% sequencing
if strcmp(pln.radiationMode,'photons') && (pln.propOpt.runSequencing || pln.propOpt.runDAO)
%resultGUI = matRad_xiaLeafSequencing(resultGUI,stf,dij,5);
%resultGUI = matRad_engelLeafSequencing(resultGUI,stf,dij,5);
resultGUI = matRad_siochiLeafSequencing(resultGUI,stf,dij,5);
end
%% DAO
if strcmp(pln.radiationMode,'photons') && pln.propOpt.runDAO
resultGUI = matRad_directApertureOptimization(dij,cst,resultGUI.apertureInfo,resultGUI,pln);
matRad_visApertureInfo(resultGUI.apertureInfo);
end
%% start gui for visualization of result
matRadGUI
%% indicator calculation and show DVH and QI
[dvh,qi] = matRad_indicatorWrapper(cst,pln,resultGUI);