matRad photon dose calculation for an individual bixel call dose = matRad_calcPhotonDoseBixel(SAD,m,betas,Interp_kernel1,... Interp_kernel2,Interp_kernel3,radDepths,geoDists,... isoLatDistsX,isoLatDistsZ) input SAD: source to axis distance m: absorption in water (part of the dose calc base data) betas: beta parameters for the parameterization of the three depth dose components Interp_kernel1/2/3: kernels for dose calculation radDepths: radiological depths geoDists: geometrical distance from virtual photon source isoLatDistsX: lateral distance in X direction in BEV from central ray at iso center plane isoLatDistsZ: lateral distance in Z direction in BEV from central ray at iso center plane output dose: photon dose at specified locations as linear vector References [1] http://www.ncbi.nlm.nih.gov/pubmed/8497215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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_calcPhotonDoseBixel(SAD,m,betas,Interp_kernel1,... 0002 Interp_kernel2,Interp_kernel3,radDepths,geoDists,... 0003 isoLatDistsX,isoLatDistsZ) 0004 % matRad photon dose calculation for an individual bixel 0005 % 0006 % call 0007 % dose = matRad_calcPhotonDoseBixel(SAD,m,betas,Interp_kernel1,... 0008 % Interp_kernel2,Interp_kernel3,radDepths,geoDists,... 0009 % isoLatDistsX,isoLatDistsZ) 0010 % 0011 % input 0012 % SAD: source to axis distance 0013 % m: absorption in water (part of the dose calc base 0014 % data) 0015 % betas: beta parameters for the parameterization of the 0016 % three depth dose components 0017 % Interp_kernel1/2/3: kernels for dose calculation 0018 % radDepths: radiological depths 0019 % geoDists: geometrical distance from virtual photon source 0020 % isoLatDistsX: lateral distance in X direction in BEV from central 0021 % ray at iso center plane 0022 % isoLatDistsZ: lateral distance in Z direction in BEV from central 0023 % ray at iso center plane 0024 % 0025 % output 0026 % dose: photon dose at specified locations as linear vector 0027 % 0028 % References 0029 % [1] http://www.ncbi.nlm.nih.gov/pubmed/8497215 0030 % 0031 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0032 % 0033 % Copyright 2015 the matRad development team. 0034 % 0035 % This file is part of the matRad project. It is subject to the license 0036 % terms in the LICENSE file found in the top-level directory of this 0037 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part 0038 % of the matRad project, including this file, may be copied, modified, 0039 % propagated, or distributed except according to the terms contained in the 0040 % LICENSE file. 0041 % 0042 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0043 0044 % Define function_Di 0045 func_Di = @(beta,x) beta/(beta-m) * (exp(-m*x) - exp(-beta*x)); 0046 0047 % Calulate lateral distances using grid interpolation. 0048 lat1 = Interp_kernel1(isoLatDistsX,isoLatDistsZ); 0049 lat2 = Interp_kernel2(isoLatDistsX,isoLatDistsZ); 0050 lat3 = Interp_kernel3(isoLatDistsX,isoLatDistsZ); 0051 0052 % now add everything together (eq 19 w/o inv sq corr -> see below) 0053 dose = lat1 .* func_Di(betas(1),radDepths) + ... 0054 lat2 .* func_Di(betas(2),radDepths) + ... 0055 lat3 .* func_Di(betas(3),radDepths); 0056 0057 % inverse square correction 0058 dose = dose .* (SAD./geoDists(:)).^2; 0059 0060 % check if we have valid dose values and adjust numerical instabilities 0061 % from fft convolution 0062 dose(dose < 0 & dose > -1e-14) = 0; 0063 if any(isnan(dose)) || any(dose<0) 0064 error('Error in photon dose calculation.'); 0065 end