|
@@ -36,6 +36,7 @@ else
|
|
|
Pat_path = varargin{1};
|
|
|
path2geometry = [Pat_path, '\matlab_files\Geometry.mat'];
|
|
|
path2goal = varargin{2};
|
|
|
+ [Goal_path,Goal_file,ext] = fileparts(path2goal);
|
|
|
end
|
|
|
|
|
|
str = inputdlg({'N of iterations for initial calc', 'N of iterations for full calc', ...
|
|
@@ -207,11 +208,11 @@ D_full = reshape(beamlets * w_fin, size(Geometry.data));
|
|
|
%% save outputs
|
|
|
NLP_result.dose = D_full;
|
|
|
NLP_result.weights = w_fin;
|
|
|
-save([Pat_path, '\matlab_files\NLP_result.mat'], 'NLP_result');
|
|
|
+save([Pat_path, '\matlab_files\NLP_result_' Goal_file '.mat'], 'NLP_result');
|
|
|
|
|
|
|
|
|
plot_DVH(Geometry, D_full)
|
|
|
-colorwash(Geometry.data, D_full, [500, 1500], [0, 66]);
|
|
|
+colorwash(Geometry.data, D_full, [500, 1500], [0, 36]);
|
|
|
|
|
|
|
|
|
end
|
|
@@ -264,6 +265,16 @@ function penalty = eval_f(x, optGoal, nrs_i, sss_i, rgs_i)
|
|
|
temp1=max(0, (optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.beamlets_pruned * x)-...
|
|
|
(optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.target));
|
|
|
d_penalty = 1.0e0 * sum(temp1.*temp1);
|
|
|
+ case 'min_exp'
|
|
|
+ % penalize if achieved dose is lower than target dose
|
|
|
+ temp1=-min(0, (optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.beamlets_pruned * x)-...
|
|
|
+ (optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.target));
|
|
|
+ d_penalty = 1.0e0 * sum(exp(temp1));
|
|
|
+ case 'max_exp'
|
|
|
+ % penalize if achieved dose is higher than target dose
|
|
|
+ temp1=max(0, (optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.beamlets_pruned * x)-...
|
|
|
+ (optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rgs{rgs_i}.target));
|
|
|
+ d_penalty = 1.0e0 * sum(exp(temp1));
|
|
|
case 'LeastSquare'
|
|
|
% penalize with sum of squares any deviation from target
|
|
|
% dose
|
|
@@ -302,7 +313,7 @@ function optGoal = make_robust_optGoal(optGoal, RO_params, beamlets);
|
|
|
% Y - Y>0 moves image down
|
|
|
% Z - in/out.
|
|
|
|
|
|
- shift_mag = 3; % vox of shift
|
|
|
+ shift_mag = 1; % vox of shift
|
|
|
nrs_scene_list={[0,0,0]};
|
|
|
|
|
|
|