0001 function matRad_visApertureInfo(apertureInfo,mode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 if nargin < 2
0032 mode = 'leafNum';
0033 end
0034
0035
0036 numOfBeams = size(apertureInfo.beam,2);
0037 bixelWidth = apertureInfo.bixelWidth;
0038
0039
0040 color = [0.2:0.01:0.8; 0.2:0.01:0.8; 0.2:0.01:0.8]';
0041 color = flipud(color);
0042 color(:,3) = 0;
0043 color(:,2) = 0;
0044
0045
0046 for i=1:numOfBeams
0047
0048
0049 figure('units','inches')
0050
0051
0052 minX = apertureInfo.beam(i).MLCWindow(1);
0053 maxX = apertureInfo.beam(i).MLCWindow(2);
0054
0055
0056 wMax = max([apertureInfo.beam(i).shape(:).weight]);
0057 if strcmp(mode,'leafNum')
0058
0059
0060
0061
0062
0063 activeLeafInd = flipud(find(apertureInfo.beam(i).isActiveLeafPair));
0064 end
0065
0066 subplotColumns = ceil(apertureInfo.beam(i).numOfShapes/2);
0067 subplotLines = ceil(apertureInfo.beam(i).numOfShapes/subplotColumns);
0068
0069 set(gcf,'pos',[0 0 1.8*subplotColumns 3*subplotLines])
0070
0071
0072 for j = 1:apertureInfo.beam(i).numOfShapes
0073
0074
0075 subplot(subplotLines,subplotColumns,j)
0076
0077 title(['Beam: ' num2str(i) ' Shape: ' num2str(j) ' w=' ...
0078 num2str(apertureInfo.beam(i).shape(j).weight,2)],...
0079 'Fontsize',8)
0080 colorInd = max(ceil((apertureInfo.beam(i).shape(j).weight/wMax)*61+eps),1);
0081 set(gca,'Color',color(colorInd,:));
0082
0083 hold on
0084
0085 if strcmp(mode,'physical')
0086
0087 for k = 1:apertureInfo.beam(i).numOfActiveLeafPairs
0088 fill([minX apertureInfo.beam(i).shape(j).leftLeafPos(k) ...
0089 apertureInfo.beam(i).shape(j).leftLeafPos(k) minX],...
0090 [apertureInfo.beam(i).leafPairPos(k)- bixelWidth/2 ...
0091 apertureInfo.beam(i).leafPairPos(k)- bixelWidth/2 ...
0092 apertureInfo.beam(i).leafPairPos(k)+ bixelWidth/2 ...
0093 apertureInfo.beam(i).leafPairPos(k)+ bixelWidth/2],'b')
0094 fill([apertureInfo.beam(i).shape(j).rightLeafPos(k) ...
0095 maxX maxX ...
0096 apertureInfo.beam(i).shape(j).rightLeafPos(k)],...
0097 [apertureInfo.beam(i).leafPairPos(k)- bixelWidth/2 ...
0098 apertureInfo.beam(i).leafPairPos(k)- bixelWidth/2 ...
0099 apertureInfo.beam(i).leafPairPos(k)+ bixelWidth/2 ...
0100 apertureInfo.beam(i).leafPairPos(k)+ bixelWidth/2],'b')
0101 end
0102 elseif strcmp(mode,'leafNum')
0103
0104 for k = 1:apertureInfo.beam(i).numOfActiveLeafPairs
0105 fill([minX apertureInfo.beam(i).shape(j).leftLeafPos(k) ...
0106 apertureInfo.beam(i).shape(j).leftLeafPos(k) minX],...
0107 [activeLeafInd(k) - 1/2 ...
0108 activeLeafInd(k) - 1/2 ...
0109 activeLeafInd(k) + 1/2 ...
0110 activeLeafInd(k) + 1/2],'b')
0111 fill([apertureInfo.beam(i).shape(j).rightLeafPos(k) ...
0112 maxX maxX ...
0113 apertureInfo.beam(i).shape(j).rightLeafPos(k)],...
0114 [activeLeafInd(k) - 1/2 ...
0115 activeLeafInd(k) - 1/2 ...
0116 activeLeafInd(k) + 1/2 ...
0117 activeLeafInd(k) + 1/2],'b')
0118 end
0119 end
0120
0121 axis tight
0122 xlabel('horiz. pos. [mm]')
0123
0124 if strcmp(mode,'physical')
0125 ylabel('vert. pos. [mm]')
0126 elseif strcmp(mode,'leafNum')
0127 ylabel('leaf pair #')
0128 end
0129
0130 end
0131
0132 end
0133
0134 end