|
11 | 11 | % this field is empty resultGUI struct will be created |
12 | 12 | % stf: matRad steering information struct |
13 | 13 | % dij: matRad's dij matrix |
14 | | -% pln.propOpt.numLevels: number of stratification levels |
| 14 | +% pln: pln struct |
15 | 15 | % visBool: toggle on/off visualization (optional) |
16 | 16 | % |
17 | 17 | % output |
|
34 | 34 | % |
35 | 35 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
36 | 36 |
|
| 37 | +matRad_cfg = MatRad_Config.instance(); |
| 38 | + |
37 | 39 | % if visBool not set toogle off visualization |
38 | 40 | if nargin < 5 |
39 | 41 | visBool = 0; |
|
50 | 52 | seqFig = figure('position',[xpos,ypos,sz(2),sz(1)]); |
51 | 53 | end |
52 | 54 |
|
| 55 | +if ~isfield(pln,'propSeq') || ~isfield(pln.propSeq,'numLevels') |
| 56 | + pln.propSeq.numLevels = matRad_cfg.defaults.propSeq.numLevels; |
| 57 | +end |
| 58 | + |
53 | 59 | offset = 0; |
54 | 60 |
|
55 | 61 | for i = 1:numOfBeams |
|
92 | 98 |
|
93 | 99 | % Stratification |
94 | 100 | calFac = max(fluenceMx(:)); |
95 | | - D_k = round(fluenceMx/calFac*pln.propOpt.numLevels); |
| 101 | + D_k = round(fluenceMx/calFac*pln.propSeq.numLevels); |
96 | 102 |
|
97 | 103 | % Save the stratification in the initial intensity matrix D_0. |
98 | 104 | D_0 = D_k; |
|
108 | 114 |
|
109 | 115 | seqSubPlots(1) = subplot(2,2,1,'parent',seqFig); |
110 | 116 | imagesc(D_k,'parent',seqSubPlots(1)); |
111 | | - set(seqSubPlots(1),'CLim',[0 pln.propOpt.numLevels],'YDir','normal'); |
| 117 | + set(seqSubPlots(1),'CLim',[0 pln.propSeq.numLevels],'YDir','normal'); |
112 | 118 | title(seqSubPlots(1),['Beam # ' num2str(i) ': max(D_0) = ' num2str(max(D_0(:))) ' - ' num2str(numel(unique(D_0))) ' intensity levels']); |
113 | 119 | xlabel(seqSubPlots(1),'x - direction parallel to leaf motion ') |
114 | 120 | ylabel(seqSubPlots(1),'z - direction perpendicular to leaf motion ') |
|
136 | 142 | if visBool |
137 | 143 | seqSubPlots(2) = subplot(2,2,2,'parent',seqFig); |
138 | 144 | imagesc(D_k,'parent',seqSubPlots(2)); |
139 | | - set(seqSubPlots(2),'CLim',[0 pln.propOpt.numLevels],'YDir','normal'); |
| 145 | + set(seqSubPlots(2),'CLim',[0 pln.propSeq.numLevels],'YDir','normal'); |
140 | 146 | title(seqSubPlots(2),['k = ' num2str(k)]); |
141 | 147 | colorbar |
142 | 148 | drawnow |
|
355 | 361 |
|
356 | 362 | sequencing.beam(i).numOfShapes = k; |
357 | 363 | sequencing.beam(i).shapes = shapes(:,:,1:k); |
358 | | - sequencing.beam(i).shapesWeight = shapesWeight(1:k)/pln.propOpt.numLevels*calFac; |
| 364 | + sequencing.beam(i).shapesWeight = shapesWeight(1:k)/pln.propSeq.numLevels*calFac; |
359 | 365 | sequencing.beam(i).bixelIx = 1+offset:numOfRaysPerBeam+offset; |
360 | 366 | sequencing.beam(i).fluence = D_0; |
361 | 367 |
|
362 | | - sequencing.w(1+offset:numOfRaysPerBeam+offset,1) = D_0(indInFluenceMx)/pln.propOpt.numLevels*calFac; |
| 368 | + sequencing.w(1+offset:numOfRaysPerBeam+offset,1) = D_0(indInFluenceMx)/pln.propSeq.numLevels*calFac; |
363 | 369 |
|
364 | 370 | offset = offset + numOfRaysPerBeam; |
365 | 371 |
|
|
0 commit comments