Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dose accumulation for mixed modality results #709

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions matRad_MixedModality.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -99,6 +99,7 @@
% Fluence optimization
resultGUI = matRad_fluenceOptimizationJO(dij,cst,plnJO);


%% Visualization
slice = 59;

Expand All @@ -118,4 +119,11 @@
subplot(1,3,3);
imagesc(totalPlan(:,:,slice));
matRad_plotVoiContourSlice(gca(f), cst,ct, 1, 1,3,slice);
title('Total Plan');
title('Total Plan');

%% Visualization
if iscell(resultGUI)
[resultGUI, result] = matRad_accumulateCubesMixMod(resultGUI, pln,ct);
end
pln = pln(1)
matRadGUI
59 changes: 59 additions & 0 deletions tools/matRad_accumulateCubesMixMod.m
Original file line number Diff line number Diff line change
@@ -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
Loading