forked from eric11210/matRad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
matRad_setOverlapPriorities.m
69 lines (59 loc) · 2.2 KB
/
matRad_setOverlapPriorities.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
function cst = matRad_setOverlapPriorities(cst)
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function to handle overlap priorities during fluence optimizaiton and
% dose calculation. If you have overlapping volumes of interest you need to
% inform matrad to which volume(s) the intersection voxels belong
%
% call
% cst = matRad_considerOverlap(cst)
%
% input
% cst: cst file
%
% output
% cst: updated cst file considering overlap priorities
%
% References
% -
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2015, Mark Bangert, on behalf of the matRad development team
%
%
% This file is part of matRad.
%
% matrad is free software: you can redistribute it and/or modify it under
% the terms of the GNU General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% matRad is distributed in the hope that it will be useful, but WITHOUT ANY
% WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
% FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
% details.
%
% You should have received a copy of the GNU General Public License in the
% file license.txt along with matRad. If not, see
% <http://www.gnu.org/licenses/>.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% consider VOI priorities
for i = 1:size(cst,1)
idx = cst{i,4};
for k = 1:size(cst,1)
if cst{k,5}.Priority < cst{i,5}.Priority && ~(i==k)
% remove indices from VOI with higher priority from current VOI
idx = setdiff(idx,cst{k,4});
end
end
cst{i,4} = idx;
if isempty(cst{i,4}) && ~isempty(cst{i,6})
warning([cst{i,2} ': Objective(s) for inverse planning defined ' ...
'but structure overlapped by structure with higher overlap priority.' ...
'Objective(s) will not be considered during optimization']);
end
end
end