matRad_VariableRBEProjection

Purpose ^

Synopsis ^

This is a script file.

Description ^

Cross-reference information ^

This function calls: This function is called by:

Subfunctions ^

Source code ^

0001 classdef matRad_VariableRBEProjection < matRad_EffectProjection
0002 % matRad_VariableRBEProjection class for RBE-weighted dose optimization
0003 %
0004 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % Copyright 2019 the matRad development team.
0007 %
0008 % This file is part of the matRad project. It is subject to the license
0009 % terms in the LICENSE file found in the top-level directory of this
0010 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0011 % of the matRad project, including this file, may be copied, modified,
0012 % propagated, or distributed except according to the terms contained in the
0013 % LICENSE file.
0014 %
0015 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0016             
0017     methods
0018         function obj = matRad_VariableRBEProjection()
0019         end
0020         
0021         function RBExD = computeSingleScenario(obj,dij,scen,w)
0022             effect = computeSingleScenario@matRad_EffectProjection(obj,dij,scen,w); %First compute effect
0023             RBExD = zeros(dij.doseGrid.numOfVoxels,1);
0024             RBExD(dij.ixDose) = sqrt((effect(dij.ixDose)./dij.bx(dij.ixDose))+(dij.gamma(dij.ixDose).^2)) - dij.gamma(dij.ixDose);
0025         end
0026         
0027         function wGrad = projectSingleScenarioGradient(obj,dij,doseGrad,scen,w)
0028             if isempty(dij.mAlphaDose{scen}) || isempty(dij.mSqrtBetaDose{scen})
0029                 wGrad = [];
0030                 matRad_cfg = MatRad_Config.instance();
0031                 matRad_cfg.dispWarning('Empty scenario in optimization detected! This should not happen...\n');
0032             else
0033                 %While the dose cache should be up to date here, we ask for
0034                 %a computation (will skip if weights are equal to cache)
0035                 obj = obj.compute(dij,w);
0036                 
0037                 %Scaling vor variable RBExD
0038                 scaledEffect = obj.d{scen} + dij.gamma;
0039                 doseGradTmp = zeros(dij.doseGrid.numOfVoxels,1);
0040                 doseGradTmp(dij.ixDose) = doseGrad{scen}(dij.ixDose) ./ (2*dij.bx(dij.ixDose).*scaledEffect(dij.ixDose));
0041                 
0042                 %Now modify the effect computation
0043                 vBias = (doseGradTmp' * dij.mAlphaDose{scen})';
0044                 quadTerm = dij.mSqrtBetaDose{scen} * w;
0045                 mPsi = (2*(doseGrad{scen}.*quadTerm)' * dij.mSqrtBetaDose{scen})';
0046                 wGrad = vBias + mPsi;
0047             end
0048         end
0049     end
0050 end
0051

| Generated by m2html © 2005