1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- function plot_DVH(Geometry, dose)
-
-
- nfrac=1;
-
-
- colorList = jet(numel(Geometry.ROIS));
- names = {};
-
- figure
- hold on
- for roi_idx= 1:numel(Geometry.ROIS);
-
-
- [dvh dosebins] = get_dvh_data(dose, Geometry.ROIS{roi_idx}.ind, nfrac);
- plot(dosebins, dvh,'Color', colorList(roi_idx, :),'LineStyle', '-','DisplayName', Geometry.ROIS{roi_idx}.name);
- names{roi_idx} = Geometry.ROIS{roi_idx}.name;
- end
- hold off
-
- title(['NLP optimized DVH'])
- legend(names)
- axis([0 50 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
|