matRad function to create a cst struct upon dicom import call cst = matRad_createCst(structures) input structures: matlab struct containing information about rt structure set (generated with matRad_importDicomRtss and matRad_convRtssContours2Indices) output cst: matRad cst struct 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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function cst = matRad_createCst(structures) 0002 % matRad function to create a cst struct upon dicom import 0003 % 0004 % call 0005 % cst = matRad_createCst(structures) 0006 % 0007 % input 0008 % structures: matlab struct containing information about rt structure 0009 % set (generated with matRad_importDicomRtss and 0010 % matRad_convRtssContours2Indices) 0011 % 0012 % output 0013 % cst: matRad cst struct 0014 % 0015 % References 0016 % - 0017 % 0018 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0019 % 0020 % Copyright 2015 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 nStructures = size(structures,2); 0034 cst = cell(nStructures,6); 0035 0036 %Create set of default colors 0037 defaultColors = colorcube(nStructures); 0038 0039 for i = 1:size(structures,2) 0040 cst{i,1} = i - 1; % first organ has number 0 0041 cst{i,2} = structures(i).structName; 0042 0043 if ~isempty(regexpi(cst{i,2},'tv')) || ... 0044 ~isempty(regexpi(cst{i,2},'target')) || ... 0045 ~isempty(regexpi(cst{i,2},'gtv')) || ... 0046 ~isempty(regexpi(cst{i,2},'ctv')) || ... 0047 ~isempty(regexpi(cst{i,2},'ptv')) || ... 0048 ~isempty(regexpi(cst{i,2},'boost')) || ... 0049 ~isempty(regexpi(cst{i,2},'tumor')) 0050 0051 cst{i,3} = 'TARGET'; 0052 0053 cst{i,5}.Priority = 1; 0054 0055 % default objectives for targets 0056 objective = DoseObjectives.matRad_SquaredDeviation; 0057 objective.penalty = 800; 0058 objective.parameters = {30}; %Default reference Dose 0059 cst{i,6}{1} = struct(objective); 0060 0061 else 0062 0063 cst{i,3} = 'OAR'; 0064 0065 cst{i,5}.Priority = 2; 0066 0067 cst{i,6} = []; % define no OAR dummy objcetives 0068 0069 end 0070 0071 cst{i,4}{1} = structures(i).indices; 0072 0073 % set default parameter for biological planning 0074 cst{i,5}.alphaX = 0.1; 0075 cst{i,5}.betaX = 0.05; 0076 cst{i,5}.Visible = 1; 0077 if isfield(structures(i),'structColor') && ~isempty(structures(i).structColor) 0078 cst{i,5}.visibleColor = structures(i).structColor' ./ 255; 0079 else 0080 cst{i,5}.visibleColor = defaultColors(i,:); 0081 matRad_cfg.dispInfo('No color information for structure %d "%s". Assigned default color [%f %f %f]\n',i,cst{i,2},defaultColors(i,1),defaultColors(i,2),defaultColors(i,3)); 0082 end 0083 end