matRad visualization of two-dimensional dose distributions on ct including segmentation call dose = matRad_calcParticleDoseBixel(radDepths, radialDist_sq, sigmaIni_sq, baseData) input radDepths: radiological depths radialDist_sq: squared radial distance in BEV from central ray sigmaIni_sq: initial Gaussian sigma^2 of beam at patient surface baseData: base data required for particle dose calculation output dose: particle dose at specified locations as linear vector References [1] http://iopscience.iop.org/0031-9155/41/8/005 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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 dose = matRad_calcParticleDoseBixel(radDepths, radialDist_sq, sigmaIni_sq, baseData) 0002 % matRad visualization of two-dimensional dose distributions 0003 % on ct including segmentation 0004 % 0005 % call 0006 % dose = matRad_calcParticleDoseBixel(radDepths, radialDist_sq, sigmaIni_sq, baseData) 0007 % 0008 % input 0009 % radDepths: radiological depths 0010 % radialDist_sq: squared radial distance in BEV from central ray 0011 % sigmaIni_sq: initial Gaussian sigma^2 of beam at patient surface 0012 % baseData: base data required for particle dose calculation 0013 % 0014 % output 0015 % dose: particle dose at specified locations as linear vector 0016 % 0017 % References 0018 % [1] http://iopscience.iop.org/0031-9155/41/8/005 0019 % 0020 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0021 % 0022 % Copyright 2015 the matRad development team. 0023 % 0024 % This file is part of the matRad project. It is subject to the license 0025 % terms in the LICENSE file found in the top-level directory of this 0026 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0027 % of the matRad project, including this file, may be copied, modified, 0028 % propagated, or distributed except according to the terms contained in the 0029 % LICENSE file. 0030 % 0031 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0032 0033 % add potential offset 0034 depths = baseData.depths + baseData.offset; 0035 0036 % convert from MeV cm^2/g per primary to Gy mm^2 per 1e6 primaries 0037 conversionFactor = 1.6021766208e-02; 0038 0039 if ~isfield(baseData,'sigma') 0040 0041 % interpolate depth dose, sigmas, and weights 0042 X = matRad_interp1(depths,[conversionFactor*baseData.Z baseData.sigma1 baseData.weight baseData.sigma2],radDepths); 0043 0044 % set dose for query > tabulated depth dose values to zero 0045 X(radDepths > max(depths),1) = 0; 0046 0047 % compute lateral sigmas 0048 sigmaSq_Narr = X(:,2).^2 + sigmaIni_sq; 0049 sigmaSq_Bro = X(:,4).^2 + sigmaIni_sq; 0050 0051 % calculate lateral profile 0052 L_Narr = exp( -radialDist_sq ./ (2*sigmaSq_Narr))./(2*pi*sigmaSq_Narr); 0053 L_Bro = exp( -radialDist_sq ./ (2*sigmaSq_Bro ))./(2*pi*sigmaSq_Bro ); 0054 L = baseData.LatCutOff.CompFac * ((1-X(:,3)).*L_Narr + X(:,3).*L_Bro); 0055 0056 dose = X(:,1).*L; 0057 else 0058 0059 % interpolate depth dose and sigma 0060 X = matRad_interp1(depths,[conversionFactor*baseData.Z baseData.sigma],radDepths); 0061 0062 %compute lateral sigma 0063 sigmaSq = X(:,2).^2 + sigmaIni_sq; 0064 0065 % calculate dose 0066 dose = baseData.LatCutOff.CompFac * exp( -radialDist_sq ./ (2*sigmaSq)) .* X(:,1) ./(2*pi*sigmaSq); 0067 0068 end 0069 0070 % check if we have valid dose values 0071 if any(isnan(dose)) || any(dose<0) 0072 error('Error in particle dose calculation.'); 0073 end