Skip to content

Commit

Permalink
Update to externalCalculation
Browse files Browse the repository at this point in the history
Changed output of TopasMCEngine to be empty not a 0 struct, this way, we dont need the check for externalCalculation in the MonteCarlo DoseEngine, and the resultGUI is still returned as empty in the calc cubes
  • Loading branch information
JenHardt committed Mar 27, 2024
1 parent 43af419 commit 2934e29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
17 changes: 8 additions & 9 deletions doseCalc/+DoseEngines/matRad_MonteCarloEngineAbstract.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ function setDefaults(this)
this.calcDoseDirect = true;
dij = this.calcDose(ct,cst,stf);

if ~this.externalCalculation
% hack dij struct
dij.numOfBeams = 1;
dij.beamNum = 1;

% calculate cubes; use uniform weights here, weighting with actual fluence
% already performed in dij construction
resultGUI = matRad_calcCubes(sum(w),dij);
end
% hack dij struct
dij.numOfBeams = 1;
dij.beamNum = 1;

% calculate cubes; use uniform weights here, weighting with actual fluence
% already performed in dij construction
resultGUI = matRad_calcCubes(sum(w),dij);

% remember original fluence weights
resultGUI.w = w;
end
Expand Down
2 changes: 1 addition & 1 deletion doseCalc/+DoseEngines/matRad_TopasMCEngine.m
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ function writeAllFiles(obj,ct,cst,stf,machine,w)
% Order fields for easier comparison between different dijs
dij = orderfields(dij);
else
dij = struct([]);
dij = [];
end

end
Expand Down
2 changes: 1 addition & 1 deletion matRad_calcCubes.m
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
resultGUI = orderfields(resultGUI);

% interpolation if dose grid does not match ct grid
if any(dij.ctGrid.dimensions~=dij.doseGrid.dimensions)
if isfield(dij,'ctGrid') && any(dij.ctGrid.dimensions~=dij.doseGrid.dimensions)
myFields = fieldnames(resultGUI);
for i = 1:numel(myFields)
if numel(resultGUI.(myFields{i})) == dij.doseGrid.numOfVoxels
Expand Down

0 comments on commit 2934e29

Please sign in to comment.