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

Pareto navigation #669

Open
wants to merge 42 commits into
base: dev_varRBErobOpt
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fe06707
Updates to where objectives and constraints are stored
tobiasbecher May 31, 2023
823794f
Merge branch 'dev_Pareto' into dev_ParetoObj
tobiasbecher Jun 5, 2023
4cba6b2
Merge branch 'dev_Pareto' into dev_ParetoObj
tobiasbecher Jul 21, 2023
2e806a9
Merge branch 'dev_varRBErobOpt' into dev_ParetoObj
tobiasbecher Jul 21, 2023
bc7f21d
Fixed bug with constraints and added some comments
tobiasbecher Jul 28, 2023
0faf883
Added Pareto Sandwich support
tobiasbecher Aug 15, 2023
6b8aa22
Added navigation functionality
tobiasbecher Sep 6, 2023
21347fe
Merge branch 'e0404:master' into dev_ParetoNavigation
tobiasbecher Oct 27, 2023
22bb7e6
Changed naming convention
tobiasbecher Oct 27, 2023
fed3c63
Merge branch 'dev_varRBErobOpt' into dev_ParetoNavigation
tobiasbecher Oct 27, 2023
778b4cc
Incorporate scenario change
tobiasbecher Oct 27, 2023
8cb4398
Small fixes
tobiasbecher Oct 27, 2023
d134d85
Final updates
tobiasbecher Oct 30, 2023
23eee6a
File cleanup
tobiasbecher Oct 30, 2023
b9009b1
Delete testRun.mat
tobiasbecher Oct 30, 2023
46ec9b3
Updated documentation
tobiasbecher Nov 2, 2023
267d2b8
Reverted to default values
tobiasbecher Nov 2, 2023
823f44d
First changes based on pull request comments
tobiasbecher Jan 11, 2024
5ddce71
Moved some files and updated GUI
tobiasbecher Jan 24, 2024
e8c6218
Small bug fix
tobiasbecher Jan 24, 2024
b38a859
Added lexicographic optimization
tobiasbecher Jan 30, 2024
f19635f
Update matRad_MinMaxDose.m
tobiasbecher Jan 31, 2024
8004b74
Merge branch 'dev_varRBErobOpt' into pr/669
wahln May 13, 2024
13e4615
fix documentation
wahln May 13, 2024
ece7b7f
fix missing ct scenario index in calcCubesDoseGrid
wahln May 13, 2024
75f7513
Merge branch 'dev_varRBErobOpt' into pr/669
wahln May 13, 2024
c7dc07e
First fixes
tobiasbecher Jun 18, 2024
74ae379
Optimization Preprocessing changes
tobiasbecher Jun 20, 2024
4ceb2bf
Plotting support for Pareto optimization
tobiasbecher Jun 20, 2024
db5d715
Updates to the GUI
tobiasbecher Jun 20, 2024
b8df93d
Readded option to calculate Pareto surface from the given facets
tobiasbecher Jun 20, 2024
5baac7a
Delete matRad_plotPS.m
tobiasbecher Jun 20, 2024
41234fe
Delete matRad_ButtonWidget.m
tobiasbecher Jun 20, 2024
94d2d46
Small updates to plotting functions
tobiasbecher Jun 20, 2024
a0336fe
Removed some unnecessary functions
tobiasbecher Jun 21, 2024
130bcc7
Temporary calcCubes fix for RBExD
tobiasbecher Jun 21, 2024
f0fd213
changed default linestyle
tobiasbecher Jun 21, 2024
2210d7f
Changed linewidth for VOIContours
tobiasbecher Jun 21, 2024
e93381b
Merge branch 'dev_varRBErobOpt' into pr/669
wahln Jun 27, 2024
aa90d6a
Merge branch 'dev' into pr/669
wahln Jun 27, 2024
c0b9594
Small GUI updates
tobiasbecher Jul 4, 2024
7e1653f
Merge branch 'dev_ParetoNav' of https://github.com/tobiasbecher/matRa…
tobiasbecher Jul 4, 2024
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
56 changes: 20 additions & 36 deletions MatRad_Config.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ function setDefaultProperties(obj)
%setDefaultProperties set matRad's default computation
% properties
% input


%Geometric stf options
obj.propStf.defaultLongitudinalSpotSpacing = 2;
obj.propStf.defaultAddMargin = true; %expand target for beamlet finding

obj.propStf.defaultBixelWidth = 5;

%Dose Calculation Options
obj.propDoseCalc.defaultDoseEngines = {'SVDPB','HongPB'}; %Names for default engines used when no other is given
obj.propDoseCalc.defaultResolution = struct('x',3,'y',3,'z',3); %[mm]
obj.propDoseCalc.defaultDosimetricLateralCutOff = 0.995; %[rel.]
obj.propDoseCalc.defaultGeometricLateralCutOff = 50; %[mm]
Expand All @@ -183,8 +184,6 @@ function setDefaultProperties(obj)
obj.propDoseCalc.defaultSelectVoxelsInScenarios = 'all';
obj.propDoseCalc.defaultAirOffsetCorrection = true;

obj.propDoseCalc.defaultDoseEngines = {'SVDPB','HongPB'}; %Names for default engines used when no other is given

% default properties for fine sampling calculation
obj.propDoseCalc.defaultFineSamplingProperties.sigmaSub = 1;
obj.propDoseCalc.defaultFineSamplingProperties.N = 2;
Expand All @@ -194,12 +193,7 @@ function setDefaultProperties(obj)
obj.propDoseCalc.defaultNumHistoriesPerBeamlet = 2e4;
obj.propDoseCalc.defaultNumHistoriesDirect = 1e6;
obj.propDoseCalc.defaultOutputMCvariance = true;

obj.propOpt.defaultMaxIter = 500;
obj.propOpt.defaultRunDAO = 0;
obj.propOpt.defaultRunSequencing = 0;
obj.propOpt.defaultClearUnusedVoxels = false;


%deprecated monte carlo options
obj.propMC.ompMC_defaultHistories = 1e6;
obj.propMC.ompMC_defaultOutputVariance = false;
Expand All @@ -218,6 +212,15 @@ function setDefaultProperties(obj)
obj.propMC.defaultExternalCalculation = false;
obj.propMC.defaultCalcDij = false;


%Default Optimization Options
obj.propOpt.defaultMaxIter = 10000;
obj.propOpt.defaultRunDAO = 0;
obj.propOpt.defaultRunSequencing = 0;
obj.propOpt.defaultClearUnusedVoxels = false;



obj.disableGUI = false;

obj.defaults.samplingScenarios = 25;
Expand All @@ -234,40 +237,23 @@ function setDefaultPropertiesForTesting(obj)

obj.setDefaultProperties();

obj.logLevel = 3; %Omit output except errors

obj.logLevel = 1; %Omit output except errors

%Geomteric stf options
obj.propStf.defaultLongitudinalSpotSpacing = 20;
obj.propStf.defaultAddMargin = true; %expand target for beamlet finding

obj.propStf.defaultBixelWidth = 20;

%Dose Calculation Options
obj.propDoseCalc.defaultResolution = struct('x',5,'y',6,'z',7); %[mm]
obj.propDoseCalc.defaultGeometricLateralCutOff = 20;
obj.propDoseCalc.defaultDosimetricLateralCutOff = 0.8;
obj.propDoseCalc.defaultKernelCutOff = 20; %[mm]
obj.propDoseCalc.defaultSsdDensityThreshold = 0.05;
obj.propDoseCalc.defaultUseGivenEqDensityCube = false; %Use the given density cube ct.cube and omit conversion from cubeHU.
obj.propDoseCalc.defaultIgnoreOutsideDensities = true;
obj.propDoseCalc.defaultUseCustomPrimaryPhotonFluence = false; %Use a custom primary photon fluence
obj.propDoseCalc.defaultCalcLET = true; %calculate LET for particles
obj.propDoseCalc.defaultSelectVoxelsInScenarios = 'all';

% default properties for fine sampling calculation
obj.propDoseCalc.defaultFineSamplingProperties.sigmaSub = 1;
obj.propDoseCalc.defaultFineSamplingProperties.N = 2;
obj.propDoseCalc.defaultFineSamplingProperties.method = 'fitCircle';

obj.propOpt.defaultMaxIter = 10;
obj.propOpt.defaultClearUnusedVoxels = false;

obj.propDoseCalc.defaultDoseEngines = {'SVDPB','HongPB'}; %Names for default engines used when no other is given


%Monte Carlo options
obj.propDoseCalc.defaultNumHistoriesPerBeamlet = 100;
obj.propDoseCalc.defaultNumHistoriesDirect = 100;
obj.propDoseCalc.defaultOutputMCvariance = true;

obj.propOpt.defaultMaxIter = 10;

%Deprecated Monte Carlo options
obj.propMC.ompMC_defaultHistories = 100;
Expand All @@ -276,10 +262,8 @@ function setDefaultPropertiesForTesting(obj)
% Set default histories for MonteCarlo
obj.propMC.defaultNumHistories = 100;

obj.propMC.default_photon_engine = 'matRad_OmpConfig';
% obj.propMC.default_photon_engine = 'matRad_TopasConfig';
obj.propMC.default_proton_engine = 'matRad_MCsquareConfig';
obj.propMC.default_carbon_engine = 'matRad_TopasConfig';
% default optimization options
obj.propOpt.defaultMaxIter = 10;

obj.defaults.samplingScenarios = 2;

Expand Down
66 changes: 66 additions & 0 deletions Pareto/NavigationUI/matRad_UIData.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
classdef matRad_UIData < handle
% matRad_UIData implements a class that allows easy storing of
% variables related to the pareto Navigation
%
% References
% -
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Copyright 2020 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.
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

properties
wRef %weight vector of last calculated plan
fRef %objective function values of last calculated plan
fIndsAll % stores all objective function values
fIndsRed % stores only the "reduced points"
upboundInit
upboundRed
upboundSlider
lowboundSliderInit
lowboundSlider
linestyle
end

methods
function obj = matRad_UIData(wRef,fRef,fInds)
obj.wRef = wRef;
obj.fRef = fRef;
obj.fIndsAll = fInds;
obj.fIndsRed = fInds;
obj.upboundInit = max(fInds,[],1);
obj.upboundRed = max(fInds,[],1);
obj.upboundSlider= max(fInds,[],1);
obj.lowboundSliderInit = min(fInds,[],1);
obj.lowboundSlider = min(fInds,[],1);
obj.linestyle = 2;
end

function [sliderLowBound,sliderUpBound] = restrictObjective(obj,i,bound)
obj.upboundRed(i) = bound;
obj.fIndsRed = obj.fIndsRed(obj.fIndsRed(:,i) <= bound,:);
obj.upboundSlider= max([obj.fIndsRed;obj.fRef],[],1);
obj.upboundSlider(i) = bound;
obj.lowboundSlider = min([obj.fIndsRed;obj.fRef],[],1);
sliderLowBound = obj.lowboundSlider;
sliderUpBound = obj.upboundSlider;
end

function releaseObjectiveBounds(obj)
obj.upboundRed = obj.upboundInit;
obj.fIndsRed = obj.fIndsAll;
obj.upboundSlider = obj.upboundInit;
obj.lowboundSlider = obj.lowboundSliderInit;
end

end
end
Loading
Loading