matRad_importDicomRTDose

Purpose ^

matRad function to import dicom RTDOSE data

Synopsis ^

function [resultGUI] = matRad_importDicomRTDose(ct, rtDoseFiles, pln)

Description ^

 matRad function to import dicom RTDOSE data
 
 call
   resultGUI = matRad_importDicomRTDose(ct, rtDoseFiles)
   resultGUI = matRad_importDicomRTDose(ct, rtDoseFiles, pln)

 input
   ct:             ct imported by the matRad_importDicomCt function
   rtDoseFiles:       cell array of RTDOSE Dicom files
   pln:            (optional) matRad pln struct

 output
   resultGUI:      matRad resultGUI struct with different beams. Note that
                   the summation (called plan) of the beams is named 
                   without subscripts, e.g. physical_Dose.

 References
   -

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

 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.

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

Cross-reference information ^

This function calls: This function is called by:

Source code ^

0001 function [resultGUI] = matRad_importDicomRTDose(ct, rtDoseFiles, pln)
0002 % matRad function to import dicom RTDOSE data
0003 %
0004 % call
0005 %   resultGUI = matRad_importDicomRTDose(ct, rtDoseFiles)
0006 %   resultGUI = matRad_importDicomRTDose(ct, rtDoseFiles, pln)
0007 %
0008 % input
0009 %   ct:             ct imported by the matRad_importDicomCt function
0010 %   rtDoseFiles:       cell array of RTDOSE Dicom files
0011 %   pln:            (optional) matRad pln struct
0012 %
0013 % output
0014 %   resultGUI:      matRad resultGUI struct with different beams. Note that
0015 %                   the summation (called plan) of the beams is named
0016 %                   without subscripts, e.g. physical_Dose.
0017 %
0018 % References
0019 %   -
0020 %
0021 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 %
0023 % Copyright 2015 the matRad development team.
0024 %
0025 % This file is part of the matRad project. It is subject to the license
0026 % terms in the LICENSE file found in the top-level directory of this
0027 % distribution and at https://github.com/e0404/matRad/LICENSES.txt. No part
0028 % of the matRad project, including this file, may be copied, modified,
0029 % propagated, or distributed except according to the terms contained in the
0030 % LICENSE file.
0031 %
0032 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0033 
0034 matRad_cfg = MatRad_Config.instance();
0035 
0036 %% import and interpolate dose files
0037 % number of dosefiles
0038 numDoseFiles = size(rtDoseFiles,1);
0039 
0040 for i = 1 : numDoseFiles
0041     currDose = rtDoseFiles(i,:);
0042     itemName = strcat('Item_',num2str(i));
0043     dose.(itemName) = matRad_interpDicomDoseCube( ct, currDose);
0044 end
0045 
0046 %% put dose information and dose meta information to resultGUI
0047 countBeamNumberPhysDose = 1;
0048 countBeamNumberRBExDose = 1;
0049 countBeamNumberOther = 1;
0050 for i = 1 : numDoseFiles
0051     itemName = strcat('Item_',num2str(i));
0052     doseTypeHelper      = dose.(itemName).dicomInfo.DoseType;
0053     doseSumHelper       = dose.(itemName).dicomInfo.DoseSummationType;
0054     
0055     %Field is not always existing
0056     if isfield(dose.(itemName).dicomInfo,'InstanceNumber')
0057         doseInstanceHelper  = dose.(itemName).dicomInfo.InstanceNumber;
0058     else
0059         doseInstanceHelper = [];
0060     end
0061     
0062     if strncmpi(doseTypeHelper,'PHYSICAL',6)
0063         doseTypeHelper = 'physicalDose';
0064     elseif strncmpi(doseTypeHelper,'EFFECTIVE',6)
0065         doseTypeHelper = 'RBExDose';
0066     end
0067     
0068     %If given as plan and not per fraction
0069     if strcmpi(doseSumHelper,'PLAN') || strcmpi(doseSumHelper,'BEAM')
0070         if exist('pln','var') 
0071             dose.(itemName).cube = dose.(itemName).cube / pln.numOfFractions;
0072         else
0073             matRad_cfg.dispWarning('DICOM dose given as PLAN, but no pln struct available to compute fraction dose! Assuming 1 fraction!');
0074         end
0075     end
0076         
0077     if strncmpi(doseSumHelper,'BEAM',4)
0078         try
0079             beamNumber = dose(itemName).dicomInfo.ReferencedRTPlanSequence.ReferencedFractionGroupSequence.ReferencedBeamSequence.ReferencedBeamNumber;
0080         catch
0081             switch doseTypeHelper
0082                 case 'physicalDose'
0083                     beamNumber = countBeamNumberPhysDose;
0084                     countBeamNumberPhysDose = countBeamNumberPhysDose +1;
0085                 case 'RBExDose'
0086                     beamNumber = countBeamNumberRBExDose;
0087                     countBeamNumberRBExDose = countBeamNumberRBExDose + 1;
0088                 otherwise
0089                     beamNumber = countBeamNumberOther;
0090                     countBeamNumberOther = countBeamNumberOther + 1;
0091             end
0092         end
0093         
0094         beamSuffix = ['_beam' num2str(beamNumber)];
0095     else
0096         beamSuffix = '';
0097     end
0098     
0099     if ~isempty(doseInstanceHelper)
0100         instanceSuffix = ['_' num2str(doseInstanceHelper)];
0101     else
0102         instanceSuffix = '';
0103     end
0104         
0105     
0106     resultName = strcat(doseTypeHelper,instanceSuffix,beamSuffix);
0107     
0108     resultGUI.(resultName) = dose.(itemName).cube;
0109     resultGUI.doseMetaInfo.(resultName) = dose.(itemName).dicomInfo;
0110     
0111 end
0112 % save timeStamp
0113 resultGUI.doseMetaInfo.timeStamp = datestr(clock);
0114 end

| Generated by m2html © 2005