Skip to content

Commit

Permalink
Merge branch 'master' into bug/605-bug-warning-and-error-messages-in-…
Browse files Browse the repository at this point in the history
…matrad_readnrrd-fail-string-concatenation-is-wrong-when-linecontent-is-an-empty-cell
  • Loading branch information
wahln authored Apr 5, 2023
2 parents 375987a + b2ce690 commit eab8fc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions matRad_resizeCstToGrid.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@
cst{i,4}{j} = find(matRad_interp3(vXgridOld,vYgridOld,vZgridOld, ...
tmpCube, ...
vXgridNew,vYgridNew',vZgridNew,'nearest'));
if isempty(cst{i,4}{j})
matRad_cfg = MatRad_Config.instance();
matRad_cfg.dispWarning('Resizing the cst to the dose grid created an empty structure %s in scenario %d (cst{%d,4}{%d})!',cst{i,2},j,i,j);
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
for i = 1:size(cst,1)

% Only take OAR or target VOI.
if ~isempty(cst{i,4}) && ( isequal(cst{i,3},'OAR') || isequal(cst{i,3},'TARGET') )
if ~any(cellfun(@isempty,cst{i,4})) && ( isequal(cst{i,3},'OAR') || isequal(cst{i,3},'TARGET') )

% loop over the number of constraints for the current VOI
for j = 1:numel(cst{i,6})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
% compute objective function for every VOI.
for i = 1:size(cst,1)
% Only take OAR or target VOI.
if ~isempty(cst{i,4}{1}) && ( isequal(cst{i,3},'OAR') || isequal(cst{i,3},'TARGET') )
if ~any(cellfun(@isempty,cst{i,4})) && ( isequal(cst{i,3},'OAR') || isequal(cst{i,3},'TARGET') )
% loop over the number of constraints for the current VOI
for j = 1:numel(cst{i,6})

Expand All @@ -48,7 +48,7 @@
% get the jacobian structure depending on dose
jacobDoseStruct = obj.getDoseConstraintJacobianStructure(numel(cst{i,4}{1}));
nRows = size(jacobDoseStruct,2);
jacobStruct = [jacobStruct; repmat(spones(mean(dij.physicalDose{1}(cst{i,4}{1},:))),nRows,1)];
jacobStruct = [jacobStruct; repmat(spones(mean(dij.physicalDose{1}(cst{i,4}{1},:),1)),nRows,1)];

end
end
Expand Down

0 comments on commit eab8fc2

Please sign in to comment.