matRad_calcIntEnergy

Purpose ^

matRad function to compute the integral energy in MeV for a dose cube

Synopsis ^

function intDose = matRad_calcIntEnergy(dose,ct,pln)

Description ^

 matRad function to compute the integral energy in MeV for a dose cube

 call
   intDose = matRad_calcIntEnergy(dose,ct,pln)

 input
   dose:   3D matlab array with dose e.g. resultGUI.physicalDose
   ct:     matRad ct struct
   pln:    matRad pln struct

 output
   intDose: integral dose in MeV

 References
   -

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 Copyright 2019 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.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function intDose = matRad_calcIntEnergy(dose,ct,pln)
0002 % matRad function to compute the integral energy in MeV for a dose cube
0003 %
0004 % call
0005 %   intDose = matRad_calcIntEnergy(dose,ct,pln)
0006 %
0007 % input
0008 %   dose:   3D matlab array with dose e.g. resultGUI.physicalDose
0009 %   ct:     matRad ct struct
0010 %   pln:    matRad pln struct
0011 %
0012 % output
0013 %   intDose: integral dose in MeV
0014 %
0015 % References
0016 %   -
0017 %
0018 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0019 %
0020 % Copyright 2019 the matRad development team.
0021 %
0022 % This file is part of the matRad project. It is subject to the license
0023 % terms in the LICENSE file found in the top-level directory of this
0024 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0025 % of the matRad project, including this file, may be copied, modified,
0026 % propagated, or distributed except according to the terms contained in the
0027 % LICENSE file.
0028 %
0029 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0030 
0031 matRad_cfg = MatRad_Config.instance();
0032 
0033 % make HU to RSP/electron density conversion if not available
0034 if ~isfield(ct,'cube')
0035     ct = matRad_calcWaterEqD(ct, pln);
0036 end
0037     
0038 % conversion factor for J to eV
0039 electronCharge = 1.60217662e-19; % [C]
0040 convFac = 1/electronCharge;
0041 
0042 % hints: ct.cube corresponds to g/cm^3 --> /1000 to have kg/cm^3
0043 %        ct.resolution given in mm --> /1000 to have cm
0044 %        conversion to MeV from eV --> /1000000
0045 intDose = convFac * sum(dose(:).*ct.cube{1}(:)) ...
0046          * ct.resolution.x*ct.resolution.y*ct.resolution.z/1e12;
0047 
0048 if nargout == 0
0049     matRad_cfg.dispInfo('Integral energy in dose cube = %.4g MeV\n',intDose);
0050 end
0051

| Generated by m2html © 2005