matRad dvh visualizaion call matRad_showDVH(dvh,cst) matRad_showDVH(dvh,cst,pln) matRad_showDVH(dvh,cst,lineStyleIndicator) matRad_showDVH(dvh,cst,pln,lineStyleIndicator) input dvh: result struct from fluence optimization/sequencing cst: matRad cst struct pln: (now optional) matRad pln struct, standard uses Dose [Gy] lineStyleIndicator: (optional) integer (1,2,3,4) to indicate the current linestyle (hint: use different lineStyles to overlay different dvhs) output graphical display of DVH References - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright 2015 the matRad development team. This file is part of the matRad project. It is subject to the license terms in the LICENSE file found in the top-level directory of this distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part of the matRad project, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the LICENSE file. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function matRad_showDVH(dvh,cst,pln,lineStyleIndicator) 0002 % matRad dvh visualizaion 0003 % 0004 % call 0005 % matRad_showDVH(dvh,cst) 0006 % matRad_showDVH(dvh,cst,pln) 0007 % matRad_showDVH(dvh,cst,lineStyleIndicator) 0008 % matRad_showDVH(dvh,cst,pln,lineStyleIndicator) 0009 % 0010 % input 0011 % dvh: result struct from fluence optimization/sequencing 0012 % cst: matRad cst struct 0013 % pln: (now optional) matRad pln struct, 0014 % standard uses Dose [Gy] 0015 % lineStyleIndicator: (optional) integer (1,2,3,4) to indicate the current linestyle 0016 % (hint: use different lineStyles to overlay 0017 % different dvhs) 0018 % 0019 % output 0020 % graphical display of DVH 0021 % 0022 % References 0023 % - 0024 % 0025 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0026 % 0027 % Copyright 2015 the matRad development team. 0028 % 0029 % This file is part of the matRad project. It is subject to the license 0030 % terms in the LICENSE file found in the top-level directory of this 0031 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0032 % of the matRad project, including this file, may be copied, modified, 0033 % propagated, or distributed except according to the terms contained in the 0034 % LICENSE file. 0035 % 0036 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0037 0038 if ~exist('lineStyleIndicator','var') || isempty(lineStyleIndicator) 0039 lineStyleIndicator = 1; 0040 end 0041 0042 % create new figure and set default line style indicator if not explictly 0043 % specified 0044 hold on; 0045 0046 %reduce cst 0047 visibleIx = cellfun(@(c) c.Visible == 1,cst(:,5)); 0048 cstNames = cst(visibleIx,2); 0049 cstInfo = cst(visibleIx,5); 0050 dvh = dvh(visibleIx); 0051 0052 numOfVois = numel(cstNames); 0053 0054 %% print the dvh 0055 0056 %try to get colors from cst 0057 try 0058 colorMx = cellfun(@(c) c.visibleColor,cstInfo,'UniformOutput',false); 0059 colorMx = cell2mat(colorMx); 0060 catch 0061 colorMx = colorcube; 0062 colorMx = colorMx(1:floor(64/numOfVois):64,:); 0063 end 0064 0065 lineStyles = {'-',':','--','-.'}; 0066 0067 maxDVHvol = 0; 0068 maxDVHdose = 0; 0069 0070 for i = 1:numOfVois 0071 % cut off at the first zero value where there is no more signal 0072 % behind 0073 ix = max([1 find(dvh(i).volumePoints>0,1,'last')]); 0074 currDvh = [dvh(i).doseGrid(1:ix);dvh(i).volumePoints(1:ix)]; 0075 0076 plot(currDvh(1,:),currDvh(2,:),'LineWidth',4,'Color',colorMx(i,:), ... 0077 'LineStyle',lineStyles{lineStyleIndicator},'DisplayName',cstNames{i}) 0078 0079 maxDVHvol = max(maxDVHvol,max(currDvh(2,:))); 0080 maxDVHdose = max(maxDVHdose,max(currDvh(1,:))); 0081 end 0082 0083 fontSizeValue = 14; 0084 myLegend = legend('show','location','NorthEast'); 0085 set(myLegend,'FontSize',10,'Interpreter','none'); 0086 legend boxoff 0087 0088 ylim([0 1.1*maxDVHvol]); 0089 xlim([0 1.2*maxDVHdose]); 0090 0091 grid on,grid minor 0092 box(gca,'on'); 0093 set(gca,'LineWidth',1.5,'FontSize',fontSizeValue); 0094 ylabel('Volume [%]','FontSize',fontSizeValue) 0095 0096 if exist('pln','var') && ~isempty(pln) 0097 if strcmp(pln.propOpt.bioOptimization,'none') 0098 xlabel('Dose [Gy]','FontSize',fontSizeValue); 0099 else 0100 xlabel('RBE x Dose [Gy(RBE)]','FontSize',fontSizeValue); 0101 end 0102 else 0103 xlabel('Dose [Gy]','FontSize',fontSizeValue); 0104 end