1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- function plot_DVH(dose, optGoal, optGoal_idx, targetMinMax_idx)
-
- nfrac=1;
-
- figure
- hold on
- for roi_idx=optGoal_idx
-
-
- [dvh dosebins] = get_dvh_data(dose,optGoal{roi_idx}.ROI_idx,nfrac);
- plot(dosebins, dvh,'Color', optGoal{roi_idx}.dvh_col,'LineStyle', '-','DisplayName', optGoal{roi_idx}.ROI_name);
- end
- hold off
-
- num_vox = numel(optGoal{targetMinMax_idx(1)}.target);
- perc_vox_min = 100* numel(find((dose(optGoal{targetMinMax_idx(1)}.ROI_idx) - optGoal{targetMinMax_idx(1)}.target*0.95) <0)) ...
- / num_vox;
- perc_vox_max = 100* numel(find((dose(optGoal{targetMinMax_idx(2)}.ROI_idx) - optGoal{targetMinMax_idx(2)}.target*1.07) >0)) ...
- / num_vox;
- title([num2str(perc_vox_min) ' % below 0.95D_0, ' num2str(perc_vox_max) ' % above D 1.07D_0'])
-
- axis([0 100 0 100])
- end
- function plot_DVH_robust(dose, optGoal, optGoal_idx)
-
- nfrac=1;
-
- figure
- hold on
- for goal_i=optGoal_idx
-
- for nrs_i = 1:optGoal{1}.NbrRandScenarios
- for sss_i = 1:optGoal{1}.NbrSystSetUpScenarios
- for rrs_i = 1:optGoal{1}.NbrRangeScenarios
-
- ROI_idx = optGoal{goal_i}.nrs{nrs_i}.sss{sss_i}.rrs{rrs_i}.ROI_idx;
-
- [dvh dosebins] = get_dvh_data(dose,ROI_idx,nfrac);
- plot(dosebins, dvh,'Color', optGoal{goal_i}.dvh_col,'LineStyle', '-','DisplayName', optGoal{goal_i}.ROI_name);
- end
- end
- end
- end
- hold off
-
- end
- function [dvh dosebins] = get_dvh_data(dose,roi_idx,nfrac);
-
- dosevec = dose(roi_idx);
-
-
- [pdf dosebins] = hist(dosevec, 999);
-
- pdf = pdf(dosebins >= 0);
- dosebins = dosebins(dosebins >= 0);
- dvh = fliplr(cumsum(fliplr(pdf))) / numel(dosevec) * 100;
-
- dosebins = [dosebins dosebins(end)+0.1];
- dvh = [dvh 0];
-
- end
|