diff --git a/matRad_MixedModality.m b/matRad_MixedModality.m index 036eab9b2..e0f614791 100644 --- a/matRad_MixedModality.m +++ b/matRad_MixedModality.m @@ -11,7 +11,7 @@ % beam geometry settings pln(1).propStf.bixelWidth = 5; % [mm] / also corresponds to lateral spot spacing for particles -pln(1).propStf.gantryAngles = [ -45 0 45 ]; % [?] ; +pln(1).propStf.gantryAngles = [ -45 45 ]; % [?] ; pln(1).propStf.couchAngles = zeros(numel(pln(1).propStf.gantryAngles),1); % [?] ; pln(1).propStf.numOfBeams = numel(pln(1).propStf.gantryAngles); pln(1).propStf.isoCenter = ones(pln(1).propStf.numOfBeams,1) * matRad_getIsoCenter(cst,ct,0); @@ -99,6 +99,7 @@ % Fluence optimization resultGUI = matRad_fluenceOptimizationJO(dij,cst,plnJO); + %% Visualization slice = 59; @@ -118,4 +119,11 @@ subplot(1,3,3); imagesc(totalPlan(:,:,slice)); matRad_plotVoiContourSlice(gca(f), cst,ct, 1, 1,3,slice); - title('Total Plan'); \ No newline at end of file + title('Total Plan'); + +%% Visualization +if iscell(resultGUI) +[resultGUI, result] = matRad_accumulateCubesMixMod(resultGUI, pln,ct); +end +pln = pln(1) +matRadGUI \ No newline at end of file diff --git a/tools/matRad_accumulateCubesMixMod.m b/tools/matRad_accumulateCubesMixMod.m new file mode 100644 index 000000000..e0eb4ce0d --- /dev/null +++ b/tools/matRad_accumulateCubesMixMod.m @@ -0,0 +1,59 @@ +function [resultGUI, result] = matRad_accumulateCubesMixMod(resultGUI, pln,ct) +% function to merge Mixed modality resultGUI cells into one resultGUI for +% visualisation +% +% call +% [resultGUI, result] = matRad_accumulateCubesMixMod(resultGUI, pln,ct) +% +% input +% resultGUI: matRads resultGUI Cell array from Mixed +% modality optimization +% pln: matRad pln stuct +% ct: matRad ct structure +% +% +% output +% resultGUI: matRads resultGUI struct +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Copyright 2018 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. +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +matRad_cfg = MatRad_Config.instance(); +if ~iscell(resultGUI) + matRad_cfg.dispWarning('resultGUI is already a structure'); + return; +end +if numel(pln) ~= numel(resultGUI) + matRad_cfg.dispWarning('dimension mismatch between pln and resultGUI '); +end + +quantityOpt = pln(1).bioParam.quantityOpt; +result = resultGUI; +resultGUI = []; +resultGUI.totalQO = zeros(ct.cubeDim); +for mod = 1 : size(result,2) + modName = ['mod', num2str(mod)]; + for st = 1 : size(result,1) + stName = ['st',num2str(st)]; + fNames = fieldnames(result{st,mod}); + for i = 1: numel(fNames) + tn = [modName,stName,fNames{i}]; + resultGUI.(tn) = result{st,mod}.(fNames{i}); + end + end + tn = [modName quantityOpt]; + resultGUI.(tn) = result{st,mod}.(quantityOpt) * pln(mod).numOfFractions; + resultGUI.totalQO = resultGUI.totalQO + resultGUI.(tn); +end + + +end \ No newline at end of file