|
33 | 33 | % LICENSE file. |
34 | 34 | % |
35 | 35 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
36 | | - |
| 36 | +matRad_cfg = MatRad_Config.instance(); |
37 | 37 | if ~exist('accType','var') |
38 | 38 | accType = 'DDM'; |
39 | 39 | end |
|
74 | 74 | tmpResultGUI = matRad_calcCubes(totalPhaseMatrix(:,i),dij,i); |
75 | 75 |
|
76 | 76 | % compute physical dose for physical opt |
77 | | - if isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
78 | | - resultGUI.phaseDose{i} = tmpResultGUI.physicalDose; |
79 | | - % compute RBExDose with const RBE |
80 | | - elseif isa(pln.bioModel,'matRad_ConstantRBE') |
81 | | - resultGUI.phaseRBExDose{i} = tmpResultGUI.RBExDose; |
82 | | - % compute all fields |
83 | | - elseif isa(pln.bioModel,'matRad_LQBasedModel') |
84 | | - resultGUI.phaseAlphaDose{i} = tmpResultGUI.alpha .* tmpResultGUI.physicalDose; |
85 | | - resultGUI.phaseSqrtBetaDose{i} = sqrt(tmpResultGUI.beta) .* tmpResultGUI.physicalDose; |
86 | | - ix = ax{i} ~=0; |
87 | | - resultGUI.phaseEffect{i} = resultGUI.phaseAlphaDose{i} + resultGUI.phaseSqrtBetaDose{i}.^2; |
88 | | - resultGUI.phaseRBExDose{i} = zeros(ct.cubeDim); |
89 | | - resultGUI.phaseRBExDose{i}(ix) = ((sqrt(ax{i}(ix).^2 + 4 .* bx{i}(ix) .* resultGUI.phaseEffect{i}(ix)) - ax{i}(ix))./(2.*bx{i}(ix))); |
90 | | - else |
91 | | - matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
| 77 | + resultGUI.phaseDose{i} = tmpResultGUI.physicalDose; |
| 78 | + if ~isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
| 79 | + % compute RBExDose |
| 80 | + if isa(pln.bioModel,'matRad_ConstantRBE') |
| 81 | + resultGUI.phaseRBExDose{i} = tmpResultGUI.RBExDose; |
| 82 | + elseif isa(pln.bioModel,'matRad_LQBasedModel') |
| 83 | + resultGUI.phaseAlphaDose{i} = tmpResultGUI.alpha .* tmpResultGUI.physicalDose; |
| 84 | + resultGUI.phaseSqrtBetaDose{i} = sqrt(tmpResultGUI.beta) .* tmpResultGUI.physicalDose; |
| 85 | + ix = ax{i} ~=0; |
| 86 | + resultGUI.phaseEffect{i} = resultGUI.phaseAlphaDose{i} + resultGUI.phaseSqrtBetaDose{i}.^2; |
| 87 | + resultGUI.phaseRBExDose{i} = zeros(ct.cubeDim); |
| 88 | + resultGUI.phaseRBExDose{i}(ix) = ((sqrt(ax{i}(ix).^2 + 4 .* bx{i}(ix) .* resultGUI.phaseEffect{i}(ix)) - ax{i}(ix))./(2.*bx{i}(ix))); |
| 89 | + else |
| 90 | + matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
| 91 | + end |
| 92 | + end |
| 93 | + |
| 94 | + for beamIx = 1:dij.numOfBeams |
| 95 | + resultGUI.(['phaseDose_beam', num2str(beamIx)]){i} = tmpResultGUI.(['physicalDose_beam', num2str(beamIx)]); |
| 96 | + if ~isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
| 97 | + % compute RBExD |
| 98 | + if isa(pln.bioModel,'matRad_ConstantRBE') |
| 99 | + resultGUI.(['phaseRBExDose_beam', num2str(beamIx)]){i} = tmpResultGUI.(['RBExDose_beam', num2str(beamIx)]); |
| 100 | + elseif isa(pln.bioModel,'matRad_LQBasedModel') |
| 101 | + resultGUI.(['phaseAlphaDose_beam', num2str(beamIx)]){i} = tmpResultGUI.(['alpha_beam', num2str(beamIx)]).*tmpResultGUI.(['physicalDose_beam', num2str(beamIx)]); |
| 102 | + resultGUI.(['phaseSqrtBetaDose_beam', num2str(beamIx)]){i} = sqrt(tmpResultGUI.(['beta_beam', num2str(beamIx)])).*tmpResultGUI.(['physicalDose_beam', num2str(beamIx)]); |
| 103 | + ix = ax{i} ~=0; |
| 104 | + resultGUI.(['phaseEffect_beam', num2str(beamIx)]){i} = resultGUI.(['phaseAlphaDose_beam', num2str(beamIx)]){i} + resultGUI.(['phaseSqrtBetaDose_beam', num2str(beamIx)]){i}.^2; |
| 105 | + resultGUI.(['phaseRBExDose_beam', num2str(beamIx)]){i} = zeros(ct.cubeDim); |
| 106 | + resultGUI.(['phaseRBExDose_beam', num2str(beamIx)]){i} = ((sqrt(ax{i}(ix).^2 + 4 .* bx{i}(ix) .* resultGUI.(['phaseEffect_beam', num2str(beamIx)]){i}(ix)) - ax{i}(ix))./(2.*bx{i}(ix))); |
| 107 | + else |
| 108 | + matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
| 109 | + end |
| 110 | + end |
92 | 111 | end |
93 | 112 | end |
94 | 113 |
|
95 | 114 | % accumulation |
96 | | -if isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
97 | | - |
98 | | - resultGUI.accPhysicalDose = matRad_doseAcc(ct,resultGUI.phaseDose, cst, accType); |
99 | | - |
100 | | -elseif isa(pln.bioModel,'matRad_ConstantRBE') |
101 | | - |
102 | | - resultGUI.accRBExDose = matRad_doseAcc(ct,resultGUI.phaseRBExDose, cst, accType); |
103 | | - |
104 | | -elseif isa(pln.bioModel,'matRad_LQBasedModel') |
| 115 | +resultGUI.accPhysicalDose = matRad_doseAcc(ct,resultGUI.phaseDose, cst, accType); |
105 | 116 |
|
106 | | - resultGUI.accAlphaDose = matRad_doseAcc(ct,resultGUI.phaseAlphaDose, cst,accType); |
107 | | - resultGUI.accSqrtBetaDose = matRad_doseAcc(ct,resultGUI.phaseSqrtBetaDose, cst, accType); |
| 117 | +if ~isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
| 118 | + if isa(pln.bioModel,'matRad_ConstantRBE') |
| 119 | + |
| 120 | + resultGUI.accRBExDose = matRad_doseAcc(ct,resultGUI.phaseRBExDose, cst, accType); |
| 121 | + |
| 122 | + elseif isa(pln.bioModel,'matRad_LQBasedModel') |
| 123 | + |
| 124 | + resultGUI.accAlphaDose = matRad_doseAcc(ct,resultGUI.phaseAlphaDose, cst,accType); |
| 125 | + resultGUI.accSqrtBetaDose = matRad_doseAcc(ct,resultGUI.phaseSqrtBetaDose, cst, accType); |
| 126 | + |
| 127 | + % only compute where we have biologically defined tissue |
| 128 | + ix = (ax{1} ~= 0); |
| 129 | + |
| 130 | + resultGUI.accEffect = resultGUI.accAlphaDose + resultGUI.accSqrtBetaDose.^2; |
| 131 | + |
| 132 | + resultGUI.accRBExDose = zeros(ct.cubeDim); |
| 133 | + resultGUI.accRBExDose(ix) = ((sqrt(ax{1}(ix).^2 + 4 .* bx{1}(ix) .* resultGUI.accEffect(ix)) - ax{1}(ix))./(2.*bx{1}(ix))); |
| 134 | + else |
| 135 | + matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
| 136 | + end |
| 137 | +end |
108 | 138 |
|
109 | | - % only compute where we have biologically defined tissue |
110 | | - ix = (ax{1} ~= 0); |
| 139 | +for beamIx = 1:dij.numOfBeams |
| 140 | + resultGUI.(['accPhysicalDose_beam', num2str(beamIx)])= matRad_doseAcc(ct,resultGUI.(['phaseDose_beam', num2str(beamIx)]), cst, accType); |
| 141 | + if ~isa(pln.bioModel,'matRad_EmptyBiologicalModel') |
| 142 | + if isa(pln.bioModel,'matRad_ConstantRBE') |
| 143 | + resultGUI.(['accRBExDose_beam', num2str(beamIx)]) = matRad_doseAcc(ct,resultGUI.(['phaseRBExDose_beam', num2str(beamIx)]), cst, accType); |
| 144 | + elseif isa(pln.bioModel,'matRad_LQBasedModel') |
| 145 | + resultGUI.(['accAlphaDose_beam', num2str(beamIx)]) = matRad_doseAcc(ct,resultGUI.(['phaseAlphaDose_beam', num2str(beamIx)]), cst, accType); |
| 146 | + resultGUI.(['accSqrtBetaDose_beam', num2str(beamIx)]) = matRad_doseAcc(ct,resultGUI.(['phaseAlphaDose_beam', num2str(beamIx)]), cst, accType); |
| 147 | + resultGUI.(['accEffect_beam', num2str(beamIx)]) = resultGUI.(['accAlphaDose_beam', num2str(beamIx)]) + resultGUI.(['accSqrtBetaDose_beam', num2str(beamIx)]).^2; |
| 148 | + resultGUI.(['accRBExDose_beam', num2str(beamIx)]){i} = zeros(ct.cubeDim); |
| 149 | + resultGUI.(['accRBExDose_beam', num2str(beamIx)]){i} = ((sqrt(ax{i}(ix).^2 + 4 .* bx{i}(ix) .* resultGUI.(['accEffect_beam', num2str(beamIx)]){i}(ix)) - ax{i}(ix))./(2.*bx{i}(ix))); |
| 150 | + else |
| 151 | + matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
| 152 | + end |
| 153 | + end |
| 154 | +end |
111 | 155 |
|
112 | | - resultGUI.accEffect = resultGUI.accAlphaDose + resultGUI.accSqrtBetaDose.^2; |
113 | 156 |
|
114 | | - resultGUI.accRBExDose = zeros(ct.cubeDim); |
115 | | - resultGUI.accRBExDose(ix) = ((sqrt(ax{1}(ix).^2 + 4 .* bx{1}(ix) .* resultGUI.accEffect(ix)) - ax{1}(ix))./(2.*bx{1}(ix))); |
116 | | -else |
117 | | - matRad_cfg.dispError('Unsupported biological model %s!',pln.bioModel.model); |
118 | | -end |
119 | 157 | end |
120 | 158 |
|
0 commit comments