-
Notifications
You must be signed in to change notification settings - Fork 193
Dev mix mod effect prescription bug fix #623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev_MixedModality
Are you sure you want to change the base?
Changes from 19 commits
aad8a96
64fad60
1a4bfaf
f7ce1ee
edfef03
4888568
5ac3cd7
0d0e61e
1d7e81e
7101996
8527e90
3de7537
80d1396
9b968e8
2a80135
0bf81e2
ddb0454
d9e4b21
45b6517
be032cc
dc9552e
37d3c58
87bf5fe
4a3e73a
1ee132d
19e22df
834bb1f
3610bf5
4b59c62
93233d1
2f53358
0c2094d
f328b96
0af8238
c9d190e
fe9adb8
d1c34ab
d0e246c
ee58c3d
9b5c17a
d8588e1
b08ddc4
2f0b541
bb40eca
d6fd9f2
147f058
926d700
704d2c0
c8fd302
16c9610
277fef5
b6188d1
3355d05
93571e6
051dfdb
fcc026f
20626d1
d81012d
348ba2f
63bb149
f1e446a
3782e6c
093eb96
74f4f5d
0eb3d41
675ebcb
cb16de9
4453b5a
a5352d9
cbc78d0
aa9fb10
4e87571
894211d
3e427cf
d3625aa
64ce14c
5663803
b85ec2c
bbca13d
091f78b
c0c8353
375987a
bcbc8b7
b2ce690
add110e
4f436df
c274d6d
f0b7199
8e17c34
2c9b118
ef95ac3
7060a3a
c3a673f
4b9a2fa
d4acb02
99336e0
5a8c7f9
fe61134
0a03aee
ab666aa
9562b0c
eb585f4
eab8fc2
d6238cd
85f7cda
711dc58
8fb0fb8
bb41c69
03cc52f
7456efc
539dc94
f7bded9
46d5f2c
58362ac
19799c8
82742b0
ebf4d57
36701bb
b58def5
7ec4cf6
3bc314d
8f03510
7481585
e29d7d8
689eabe
2397e3f
0fe09aa
2f42625
beaee4e
d6ea09a
d2da6e4
a531a2d
153ba54
871e0b6
48ca910
a7e72fa
6a746ee
1bab14d
c5dd9eb
3e7952a
f9569ea
71506ea
c0dcbdb
6835c93
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| function [resultGUI,optimizer] = matRad_fluenceOptimizationJO(dij,cst,pln,wInit) | ||
| function [resultGUI,optimizer] = matRad_fluenceOptimizationJO(dij,cst,pln,wInit,loadwInit) | ||
| % matRad inverse planning wrapper function | ||
| % | ||
| % call | ||
|
|
@@ -106,7 +106,11 @@ | |
| else | ||
| numOfModalities = 1; | ||
| end | ||
| if exist('wInit','var') | ||
|
|
||
| if ~exist('wInit', 'var') | ||
| wInit = []; | ||
| end | ||
| if ~isempty(wInit) %can never happen now | ||
| %do nothing as wInit was passed to the function | ||
| matRad_cfg.dispInfo('chosen provided wInit!\n'); | ||
|
|
||
|
|
@@ -364,7 +368,13 @@ | |
| warning(['Optimizer ''' pln.propOpt.optimizer ''' not known! Fallback to IPOPT!']); | ||
| optimizer = matRad_OptimizerIPOPT; | ||
| end | ||
|
|
||
|
|
||
| if exist('loadwInit', 'var') | ||
| if loadwInit ==1 | ||
|
||
| load('wInit.mat'); | ||
| end | ||
| end | ||
| optimizer.options.max_iter = 10000; | ||
| optimizer = optimizer.optimize(wInit,optiProb,dij,cst); | ||
|
|
||
| wOpt = optimizer.wResult; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -313,3 +313,21 @@ | |
| %Only implemented for first scenario now | ||
| weightGradient = weightGradient + gProb{1}; | ||
| end | ||
| gradientChecker = 1; | ||
|
||
| if gradientChecker == 1 | ||
| f = matRad_objectiveFunction(optiProb,w,dij,cst); | ||
| epsilon = 1e-8; | ||
| ix = unique(randi([1 numel(w)],1,5)); | ||
|
|
||
| for i=ix | ||
| wInit = w; | ||
| wInit(i) = wInit(i) + epsilon; | ||
| fDel= matRad_objectiveFunction(optiProb,wInit,dij,cst); | ||
| numGrad = (fDel - f)/epsilon; | ||
| diff = (numGrad/weightGradient(i) - 1)*100; | ||
| fprintf(['grad val #' num2str(i) ' - rel diff numerical and analytical gradient = ' num2str(diff) '\n']); | ||
| %fprintf([' any nan or zero for photons' num2str(sum(isnan(glog{1}))) ',' num2str(sum(~logical(glog{1}))) ' for protons: ' num2str(sum(isnan(glog{2}))) ',' num2str(sum(~logical(glog{2}))) '\n']); | ||
| end | ||
|
|
||
| end | ||
| end | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was fixed with #607. try to merge master into your branch for this