Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0c2c99d
helium adaptations
wahln Jan 19, 2022
9cfba69
turn the biological model restrictions into a warning
wahln Jan 19, 2022
885aad5
fix when automatically setting the isocenter
wahln Jan 19, 2022
42d4497
some fixes regarding x/y permutation in coordinates
wahln Jan 19, 2022
c3844c3
Merge branch 'dev_varRBErobOpt' of https://github.com/e0404/matRad in…
wahln Jan 19, 2022
e0ffefe
Merge branch 'dev' of https://github.com/e0404/matRad into dev_varRBE…
wahln Jan 19, 2022
49ccff3
first draft of new scenario infrastructure
wahln Apr 20, 2022
d4c4223
test scripts
wahln Apr 29, 2022
e18c7ec
New Scenario update with downwards compatability
wahln May 20, 2022
af7719e
single scenario extractor
wahln May 20, 2022
3e2865d
deprecation warning
wahln May 20, 2022
e1b9d5e
some more compatability and deprecation management for random scenari…
wahln May 24, 2022
b849675
deprecated properties in RandomScenarios class added
wahln May 24, 2022
7b13c0e
Update tests.yml
wahln May 24, 2022
2f957c6
fix for downwards compatibility
wahln May 30, 2022
ecd4fd0
implement new interface in matRad_sampling
wahln May 30, 2022
99223dd
Merge branch 'dev_varRBErobOpt_scen' of https://github.com/wahln/matR…
wahln May 30, 2022
00d3176
small update to matRadGUI
wahln Jun 10, 2022
0a624ce
Add probability and weight to Nominal Scenario
wahln Jun 22, 2022
6ef5d00
correctly set includeNominalScenario in WorstCase model
wahln Jun 22, 2022
f9f6ecc
Merge commit '0a624cef39f7eed970e0bba58ec8a48df2c177a7' into dev_varR…
wahln Jul 29, 2022
dba7cf4
Merge commit '6ef5d0020211c1dd4a74c9f8c30c0d543225b73b' into dev_varR…
wahln Jul 29, 2022
ad2e93a
Include shift and range combinations
wahln Jul 29, 2022
45d414f
Merge branch 'dev_varRBErobOpt' into dev_varRBErobOpt_scen
wahln Jul 29, 2022
95ab43a
Octave compatability fix
wahln Jul 29, 2022
be48e72
documentation and compatibility fix
wahln Jul 29, 2022
f370e84
update to the IPOPT compilation script to use the active github links
wahln Jul 29, 2022
7a89042
remove temporary scripts
wahln Aug 2, 2022
ecf0d0b
Documentation update
wahln Aug 2, 2022
7a47f0b
enable full combation of all grid scenarios
wahln Sep 16, 2022
09a6b8f
Increase reusability of scenario code
wahln Sep 16, 2022
beaa7ac
a little bit and documentation and removal of unfinished functions
wahln Sep 16, 2022
940d403
Octave compatibility fix
wahln Sep 16, 2022
555d3ce
fix missing return value in NominalScenario
wahln Sep 16, 2022
0a69b21
Extend Octave compatibility fix
wahln Sep 16, 2022
d5ae6e2
Merge branch 'dev_varRBErobOpt' of https://github.com/e0404/matRad in…
wahln Sep 16, 2022
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
Binary file modified basedata/helium_Generic.mat
Binary file not shown.
Binary file removed helium_Generic.mat
Binary file not shown.
11 changes: 6 additions & 5 deletions matRadGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
end
set(handles.popUpMachine,'String',handles.Machines);

%TODO: replace with class crawling
multScenDummy = matRad_multScen([],'nomScen');
set(handles.popupmenuScenGen,'String',multScenDummy.AvailableScenCreationTYPE);

Expand Down Expand Up @@ -310,9 +311,9 @@ function initViewSliceSlider(handles)
setPln(handles);
end

catch
catch ME
handles.State = 0;
handles = showError(handles,'GUI OpeningFunc: Could not set or get pln');
handles = showError(handles,sprintf('GUI OpeningFunc: Could not set or get pln: %s',ME.message));
end

% check for dij structure
Expand Down Expand Up @@ -3668,8 +3669,8 @@ function sliderOpacity_CreateFcn(hObject, eventdata, handles)
cursorText{end+1,1} = ['Cube Index: ' mat2str(cubeIx)];
%Space Coordinates
coords = zeros(1,3);
coords(1) = cubePos(2)*ct.resolution.y;
coords(2) = cubePos(1)*ct.resolution.x;
coords(1) = cubePos(2)*ct.resolution.x;
coords(2) = cubePos(1)*ct.resolution.y;
coords(3) = cubePos(3)*ct.resolution.z;
cursorText{end+1,1} = ['Space Coordinates: ' mat2str(coords,5) ' mm'];

Expand Down Expand Up @@ -4301,7 +4302,7 @@ function popupmenuScenGen_Callback(hObject, eventdata, handles)
% hObject handle to popupmenuScenGen (see GCBO)
contents = cellstr(get(hObject,'String'));

if handles.State > 1
if handles.State >= 1
ct = evalin('base','ct');
pln = evalin('base','pln');
pln.scenGenType = contents{get(hObject,'Value')};
Expand Down
9 changes: 3 additions & 6 deletions matRad_calcDoseInitBeam.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,10 @@

% interpolate radiological depth cube to dose grid resolution
radDepthVdoseGrid = matRad_interpRadDepth(ct,VctGrid,VdoseGrid,dij.doseGrid.x,dij.doseGrid.y,dij.doseGrid.z,radDepthVctGrid);

if exist('radDepthsMat', 'var')
for ctScen = 1:ct.numOfCtScen
% interpolate radiological depth cube used for fine sampling to dose grid resolution
radDepthsMat{ctScen} = matRad_interp3(dij.ctGrid.x, dij.ctGrid.y, dij.ctGrid.z, radDepthsMat{1}, ...
dij.doseGrid.x,dij.doseGrid.y',dij.doseGrid.z,'nearest');
end
% interpolate radiological depth cube used for fine sampling to dose grid resolution
radDepthsMat = cellfun(@(radDepthCube) matRad_interp3(dij.ctGrid.x, dij.ctGrid.y, dij.ctGrid.z,radDepthCube,dij.doseGrid.x,dij.doseGrid.y',dij.doseGrid.z,'nearest'),radDepthsMat,'UniformOutput',false);
end

% limit rotated coordinates to positions where ray tracing is availabe
Expand Down
165 changes: 81 additions & 84 deletions matRad_calcParticleDose.m

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions matRad_fluenceOptimization.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@
wOnes = ones(dij.totalNumOfBixels,1);

% calculate initial beam intensities wInit
matRad_cfg.dispInfo('Getting initial weights... ');
matRad_cfg.dispInfo('Estimating initial weights... ');
if exist('wInit','var')
%do nothing as wInit was passed to the function
matRad_cfg.dispInfo('use as given!\n');
elseif strcmp(pln.bioParam.model,'constRBE') && strcmp(pln.radiationMode,'protons')
matRad_cfg.dispInfo('chosen provided wInit!\n');
elseif strcmp(pln.bioParam.model,'constRBE') && strcmp(pln.radiationMode,'protons')
% check if a constant RBE is defined - if not use 1.1
if ~isfield(dij,'RBE')
dij.RBE = 1.1;
Expand All @@ -124,7 +124,7 @@
for j = 1:size(cst{i,6},2)
% check if prescribed doses are in a valid domain
if any(cst{i,6}{j}.getDoseParameters() > 5) && isequal(cst{i,3},'TARGET')
matRad_cfg.dispError('Reference dose > 10 Gy[RBE] for target. Biological optimization outside the valid domain of the base data. Reduce dose prescription or use more fractions.\n');
matRad_cfg.dispWarning('Reference dose > 10 Gy[RBE] for target. Biological optimization outside the valid domain of the base data. Reduce dose prescription or use more fractions.\n');
end

end
Expand Down Expand Up @@ -155,7 +155,7 @@
4*cst{ixTarget,5}.betaX.*CurrEffectTarget)./(2*cst{ixTarget,5}.betaX*(dij.physicalDose{1}(V,:)*wOnes)));
wInit = ((doseTarget)/(TolEstBio*maxCurrRBE*max(dij.physicalDose{1}(V,:)*wOnes)))* wOnes;
end

matRad_cfg.dispInfo('chosen weights adapted to biological dose calculation!\n');
else
bixelWeight = (doseTarget)/(mean(dij.physicalDose{1}(V,:)*wOnes));
wInit = wOnes * bixelWeight;
Expand Down
9 changes: 5 additions & 4 deletions matRad_generateStf.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,12 @@

Counter = 0;

%Here we iterate through scenarios to check the required
%energies w.r.t lateral position.
%TODO: iterate over the linear scenario mask instead?
for CtScen = 1:pln.multScen.numOfCtScen
for ShiftScen = 1:pln.multScen.totNumShiftScen
for RangeShiftScen = 1:pln.multScen.totNumRangeScen

if pln.multScen.scenMask(CtScen,ShiftScen,RangeShiftScen)
Counter = Counter+1;

Expand All @@ -322,8 +324,7 @@
%This captures the case that the first
%relevant voxel is a target voxel
targetEntry(Counter,1:length(entryIx)) = (radDepths(entryIx) + radDepths(entryIx+1)) ./ 2;
targetExit(Counter,1:length(exitIx)) = (radDepths(exitIx) + radDepths(exitIx+1)) ./ 2;

targetExit(Counter,1:length(exitIx)) = (radDepths(exitIx) + radDepths(exitIx+1)) ./ 2;
end
end

Expand Down Expand Up @@ -432,7 +433,7 @@
stf(i).numOfRays = size(stf(i).ray,2);

% post processing for particle remove energy slices
if strcmp(stf(i).radiationMode,'protons') || strcmp(stf(i).radiationMode,'carbon')
if strcmp(stf(i).radiationMode,'protons') || strcmp(stf(i).radiationMode,'helium') || strcmp(stf(i).radiationMode,'carbon')

% get minimum energy per field
minEnergy = min([stf(i).ray.energy]);
Expand Down
8 changes: 6 additions & 2 deletions matRad_getIsoCenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@
V = [];

%Check if any constraints/Objectives have been defined yet
noObjOrConst = all(cellfun(@isempty,cst(:,6)));
if size(cst,2) >= 6
noObjOrConst = all(cellfun(@isempty,cst(:,6)));
else
noObjOrConst = true;
end

% Save target indices in V variable.
for i = 1:size(cst,1)
% We only let a target contribute if it has an objective/constraint or
% if we do not have specified objectives/constraints at all so far
if isequal(cst{i,3},'TARGET') && (~isempty(cst{i,6}) || noObjOrConst)
if isequal(cst{i,3},'TARGET') && (noObjOrConst || ~isempty(cst{i,6}))
V = [V; cst{i,4}{1}];
end
end
Expand Down
Loading