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

Extensive TOPAS workflow update: #536

Merged
merged 68 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
aad8a96
Extensive TOPAS workflow update:
HomolkaN Dec 5, 2021
64fad60
Merge branch 'dev_varRBErobOpt' of https://github.com/e0404/matRad in…
wahln Mar 15, 2022
1a4bfaf
Merge branch 'dev_VARBE_MC_merge_experimental'
HomolkaN Jun 15, 2022
f7ce1ee
Monte Carlo fix
HomolkaN Jun 21, 2022
edfef03
Merge additional MonteCarlo changes from dev_varRBErobOpt_experimental
HomolkaN Jun 23, 2022
4888568
Merge branch 'dev_VARBE_MC_merge_experimental' into dev_varRBErobOpt_…
HomolkaN Jul 29, 2022
5ac3cd7
Merge branch 'pamede/dev_MonteCarloRestructured'
HomolkaN Jul 29, 2022
0d0e61e
Merge branch 'pamede/dev_varRBErobOpt'
HomolkaN Jul 29, 2022
1d7e81e
added support for 4D
HomolkaN Aug 2, 2022
7101996
Replaced contains function by strfind for octave
HomolkaN Aug 3, 2022
8527e90
TOPAS Schneider Update
HomolkaN Aug 5, 2022
3de7537
Update ChangeLog.txt
HomolkaN Aug 5, 2022
80d1396
Merge branch 'dev_varRBErobOpt' into pr/536
wahln Sep 16, 2022
9b968e8
Update matRad_calcDoseDirectMC.m
HomolkaN Sep 19, 2022
2a80135
update direct dose calculation
wahln Sep 19, 2022
0bf81e2
fix wrong case in path
wahln Sep 19, 2022
ddb0454
fix compatibility issue in the MCemmittance class
wahln Sep 19, 2022
d9e4b21
fix fprintf error in octave due to non-escaped percentage character
wahln Sep 19, 2022
45b6517
Merge dev_varRBErobOpt_experimental -> dev_varRBErobOpt_Update
HomolkaN Sep 21, 2022
be032cc
bug fix for recent resampling update
HomolkaN Sep 22, 2022
dc9552e
MC dij update calcDoseDirect
HomolkaN Sep 22, 2022
37d3c58
Update to matRad_calcCubes.m
HomolkaN Sep 22, 2022
87bf5fe
Fix indent
wahln Sep 23, 2022
4a3e73a
Update to emittanceBaseData energyspread handling
HomolkaN Sep 22, 2022
1ee132d
Merge dev_varRBErobOpt_experimental
HomolkaN Oct 4, 2022
19e22df
reset to old bixelwidth-dependent dij sampling
wahln Oct 5, 2022
834bb1f
Merge branch 'master' into pr/536
wahln Oct 5, 2022
3610bf5
Update TopasConfig
HomolkaN Oct 12, 2022
4b59c62
Merge piastammer/dev_varRBErobOpt_photonsTopas into dev_varRBErobOpt_…
HomolkaN Oct 24, 2022
93233d1
Update MatRad_Config.m
HomolkaN Oct 24, 2022
2f53358
Finished merge of TopasConfig_Photons
HomolkaN Oct 24, 2022
0c2094d
Update TOPAS_beamSetup_Phasespace.txt.in
HomolkaN Oct 25, 2022
f328b96
fix props in MatRad_Config
wahln Oct 26, 2022
0af8238
small update to photons phasespace
HomolkaN Oct 26, 2022
c9d190e
Merge branch 'dev_varRBErobOpt' of https://github.com/e0404/matRad in…
wahln Oct 26, 2022
fe9adb8
added default beamProfile for photons
HomolkaN Oct 26, 2022
d1c34ab
Merge branch 'dev_varRBErobOpt_Update' of https://github.com/HomolkaN…
HomolkaN Oct 26, 2022
d0e246c
adjusted topas calcDose functions
HomolkaN Oct 26, 2022
ee58c3d
remove the MCsquare MU correction as it is no longer valid
wahln Oct 28, 2022
9b5c17a
some technical fixes
wahln Oct 28, 2022
d8588e1
change how emittance and energy spectrum should be represented in bas…
wahln Oct 28, 2022
b08ddc4
Merge branch 'dev_varRBErobOpt_Update' of https://github.com/HomolkaN…
wahln Oct 28, 2022
2f0b541
potential fix for testing
HomolkaN Nov 14, 2022
bb40eca
Update MatRad_TopasConfig.m
HomolkaN Nov 14, 2022
d6fd9f2
Update matRad_runTests.m
wahln Nov 17, 2022
147f058
Update matRad_runTests.m
HomolkaN Nov 18, 2022
926d700
Update .gitignore
JenHardt Nov 18, 2022
704d2c0
introduce ompMC class
HomolkaN Nov 18, 2022
c8fd302
Update matRad_calcPhotonDoseOmpMC.m
HomolkaN Nov 18, 2022
16c9610
otherwise out and log file are the same file
JenHardt Nov 18, 2022
277fef5
Phase space file starts at end of colimator
JenHardt Nov 18, 2022
b6188d1
SAD and wsl fix
JenHardt Nov 18, 2022
3355d05
Merge branch 'dev_varRBErobOpt_Update' of https://github.com/HomolkaN…
JenHardt Nov 18, 2022
93571e6
Update MatRad_TopasConfig.m
HomolkaN Nov 18, 2022
051dfdb
add different SADs for x and y to the base data class
wahln Nov 22, 2022
fcc026f
Merge branch 'dev_varRBErobOpt_Update' of https://github.com/HomolkaN…
wahln Nov 22, 2022
20626d1
Merge branch 'dev_varRBErobOpt' of https://github.com/e0404/matRad in…
wahln Nov 22, 2022
d81012d
make mex file compilation a static function
wahln Nov 22, 2022
348ba2f
remove weird slab file in scenarios folder
wahln Nov 22, 2022
63bb149
small fix wenn getting number of emittance gaussians from the weight …
wahln Nov 22, 2022
f1e446a
minor MC workflow fixes
HomolkaN Nov 23, 2022
3782e6c
Renamed classes to follow the naming scheme
HomolkaN Nov 30, 2022
093eb96
Delete protons_savedMatRadMachine.mat
HomolkaN Nov 30, 2022
74f4f5d
Update matRad_fluenceOptimization.m
HomolkaN Dec 1, 2022
0eb3d41
Update matRad_doseAcc.m
HomolkaN Dec 6, 2022
a5352d9
Merge branch 'dev_varRBErobOpt' into pr/536
wahln Dec 19, 2022
aa9fb10
Merge branch 'dev_varRBErobOpt' into pr/536
wahln Dec 19, 2022
4e87571
typo fix in MCsquare dose calculation
wahln Dec 19, 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
4 changes: 2 additions & 2 deletions 4D/matRad_calc4dDose.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@
resultGUI.accSqrtBetaDose = matRad_doseAcc(ct,resultGUI.phaseSqrtBetaDose, cst, 'DDM');

% only compute where we have biologically defined tissue
ix = dij.alphaX~=0;
ix = dij.ax(:,1)~=0;

resultGUI.accEffect = resultGUI.accAlphaDose + resultGUI.accSqrtBetaDose.^2;

resultGUI.accRBExD = zeros(ct.cubeDim);
resultGUI.accRBExD(ix) = ((sqrt(dij.alphaX(ix).^2 + 4 .* dij.betaX(ix) .* resultGUI.accEffect(ix)) - dij.alphaX(ix))./(2.*dij.betaX(ix)));
resultGUI.accRBExD(ix) = ((sqrt(dij.ax(ix).^2 + 4 .* dij.bx(ix) .* resultGUI.accEffect(ix)) - dij.ax(ix))./(2.*dij.bx(ix)));

end

34 changes: 34 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
Monte-Carlo Update
Workflow of the Monte Carlo pipeline including MCsquare and TOPAS have been completely overhauled
- Restructured the MCEmittanceBaseData class, fit and calculation pipeline
- Added example 13 for generating analytical data file by fitting to given machine emittance
- added function to plot particleBaseDataEntry
- edited function to fit base data
- added function to generate a single pencil beam
- MCemmittanceBaseData can calculate meanEnergy and spread also for carbon and helium ions
- Added support for 4D calculation
- added 4D accumulation in calcDoseDirectMC
- Fixed number of errors in 4D calculation workflow
- TOPAS Updates:
- Added comments to whole pipeline
- Implemented dij calculation
- Restructured resampling in calcParticleDoseMCtopas in separate function
- calcParticleDoseMCtopas now generates dij in matRad format for calcDoseDirect
- Merged support functions for TOPAS into topasConfig class
- modular Schneider Converter: Converter is generated on demand rather than read from file which allows a variety of different options
- modular TOPAS scorer which can be individually turned on and off
- Export feature for TOPAS to run externally (includes functions to read from external folders)
- MCsquare Updates:
- Merged support functions for MCsquare into MCsquareConfig class
- added variable in pln to contain an existing BDL file if available
- renamed MCsquare property "Num_Primaries" -> "numHistories" to be in line with other Monte Carlo (this is written to the BDL file in original format)
- Implemented calculation of std of physicalDose

Changes to matRad workflow:
- Added a class constructor for pln in MatRad_config, which loads requested classes in pln and writes default values that were not set
- Changed matRad_calcCubes to accept a variety of different fields for Monte Carlo, without changing the current usage
- Enabled helium in calcdoseDirect
- Bugfix for coordinate system in resizeCstToGrid function
- Added optional initial weights to fluence Optimization
- Added flag in stf to catch specific error where no energies could be found

Development Changes
- Bugfixes:
- Fix SFUD wrapper for new pln & cst format
Expand Down
12 changes: 9 additions & 3 deletions MCsquare/MatRad_MCsquareBaseData.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
methods (Access = public)
function obj = MatRad_MCsquareBaseData(machine,stf)
%Call MatRad_MCemmitanceBaseData constructor
obj = obj@MatRad_MCemittanceBaseData(machine,stf);
if nargin < 2
stf = [];
end

obj = obj@MatRad_MCemittanceBaseData(machine, stf);
end

function obj = writeMCsquareData(obj,filepath)
Expand All @@ -35,7 +39,7 @@
end

%remove field not needed for MCsquare base data
selectedData = rmfield(selectedData, 'FWHMatIso');
% selectedData = rmfield(selectedData, 'FWHMatIso');

%write MCsqaure data base file
try
Expand Down Expand Up @@ -77,9 +81,11 @@
end
fprintf(fileID, '\n');

indices = obj.selectedFocus(obj.energyIndex);
for k = 1:size(selectedData,2)
for m = 1:numel(fn)
fprintf(fileID, '%g', selectedData(k).(fn{m}));
tmp = selectedData(k).(fn{m});
fprintf(fileID, '%g ', tmp(indices(k)));
fprintf(fileID, '\t');
end
fprintf(fileID, '\n');
Expand Down
Loading