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

class based biological models #756

Merged
merged 107 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
5ea1657
Change release candidate version
wahln Jul 9, 2024
2d10d0c
rename changelog file to make it markdown
wahln Jul 16, 2024
8148f1b
Update dose engine base for class based bio model. Add new properties…
remocristoforetti Jul 18, 2024
d988193
add functions for looping through subclasses and struct fields.
remocristoforetti Jul 18, 2024
34c219d
minor change in findSubclasses
remocristoforetti Jul 18, 2024
49ab64b
Update particle ParticlePencilBeamAbstract for class based bio model
remocristoforetti Jul 18, 2024
69a8c40
Update HongPB engine for class based bio model
remocristoforetti Jul 18, 2024
25e4aa8
Update initDoseCalc of Base engine for class based bio model
remocristoforetti Jul 18, 2024
efb4f47
Update fluence optimization for class based bio model
remocristoforetti Jul 18, 2024
ab3a52e
Deprecate old Biological Model functions and classes
remocristoforetti Jul 18, 2024
abd1d60
Main Biological Model class
remocristoforetti Jul 18, 2024
35fa4a8
LET based and RBEminMax models
remocristoforetti Jul 18, 2024
6236a4c
Kernel based models (LEM)
remocristoforetti Jul 18, 2024
94e2e4d
Tabulated RBE models
remocristoforetti Jul 18, 2024
05ebf47
Added documentation and function description
remocristoforetti Jul 18, 2024
48a2e24
minor updates in tabulated model for RBEtable path search ande avoid …
remocristoforetti Jul 19, 2024
94f2a4e
chage kernel interpolation from radDepth to radDepth(:), used for 2D …
remocristoforetti Jul 19, 2024
5040cf8
Update fine sampling engine to allow for 2D kernels with mutliple sub…
remocristoforetti Jul 19, 2024
65e3a88
Merge branch 'dev' into rc/v3
wahln Jul 22, 2024
52940e6
iterate fix version
wahln Jul 22, 2024
15cc3ee
move bioModel from propDoseCalc to separate field in pln, adapt engines
remocristoforetti Aug 7, 2024
9fbf68d
adapt fluence optimmization, move bioModel from propDoseCalc
remocristoforetti Aug 7, 2024
5ca545e
machine check moved to BiologicalModel
remocristoforetti Aug 7, 2024
105b805
Adapt tabulated models and constRBE to latest changes
remocristoforetti Aug 7, 2024
8cf3c80
Adapt matRad_bioModel to new class structure
remocristoforetti Aug 7, 2024
ecd3087
Merge branch 'dev' into rc/v3
wahln Aug 9, 2024
69abc7b
Iterate patch version and update changelog
wahln Aug 9, 2024
9aaf5c7
Add brachy as radiation modality to model matRad_None
remocristoforetti Aug 9, 2024
b5a51e6
Add example for biological parameter setup
remocristoforetti Aug 9, 2024
f519892
Merge remote-tracking branch 'origin/rc/v3' into dev_bioModelMerging
remocristoforetti Aug 9, 2024
ad9edf3
Update to dev branch and minor bug fixes
remocristoforetti Aug 9, 2024
560fac1
minor bug fix
remocristoforetti Aug 13, 2024
8b33502
Update bio model testing, initial tests
remocristoforetti Aug 13, 2024
0ab6dc5
renaming of none model
remocristoforetti Aug 13, 2024
b3657b6
Test modified validation function for folders input in matRad_findSub…
remocristoforetti Aug 13, 2024
17a49a9
Test modified validation function for folders input in matRad_findSub…
remocristoforetti Aug 13, 2024
5e08121
change split to strsplit for octave compatibility
remocristoforetti Aug 13, 2024
7819994
Another test for matRad_findSubclasses
remocristoforetti Aug 13, 2024
b91032a
Another test for matRad_findSubclasses
remocristoforetti Aug 13, 2024
add6cf2
Revert changes to validation function for input folders in matRad_fin…
remocristoforetti Aug 13, 2024
f0dfcf9
Changes for error handling and octave compatibility
remocristoforetti Aug 13, 2024
b384b14
Update validate function for folders input matRad_findSubclasses
remocristoforetti Aug 13, 2024
332d9b8
Explicit Abstractc defintion for class matRad_LQKernelBasedModel
remocristoforetti Aug 14, 2024
391f67d
Changes in input validation matRad_findSubclasses
remocristoforetti Aug 14, 2024
9515620
Chages in validation input for matRad_findSubclasses
remocristoforetti Aug 14, 2024
28ead8c
test
remocristoforetti Aug 14, 2024
d07d205
test
remocristoforetti Aug 14, 2024
6ba8052
test: more info for debugging
remocristoforetti Aug 14, 2024
dbf83ea
test: more info for debugging
remocristoforetti Aug 14, 2024
d670c38
test: more info for debugging
remocristoforetti Aug 14, 2024
e81ddc5
bioParam to bioModel name changing for pln properties
remocristoforetti Aug 14, 2024
00b7572
Add quantityOpt and quantityVis as depreccated quantities
remocristoforetti Aug 14, 2024
305feba
quantityVis handling
remocristoforetti Aug 14, 2024
06ce442
folder definition and validation in matRad_findSubclasses
remocristoforetti Aug 14, 2024
56e222c
Updates of bioParam naming
remocristoforetti Aug 14, 2024
1bc6f2c
Update of bioModel naming for matRad.m
remocristoforetti Aug 14, 2024
bd80d37
Update test for bioModelling, brachy and Topas
remocristoforetti Aug 14, 2024
f5d74be
Update tests and example for bioModel compatibility
remocristoforetti Aug 14, 2024
28060fd
Update test_biologicalModels testing
remocristoforetti Aug 15, 2024
b3e9203
Merge branch 'dev' of https://github.com/e0404/matRad into dev_bioMod…
remocristoforetti Aug 15, 2024
b8eb7db
change isProp to matRad_ispropCompat
remocristoforetti Aug 27, 2024
2386a07
Merge branch 'dev' into pr/756
wahln Aug 30, 2024
d5b3677
some file reorganization and streamlining of the bioModel function to…
wahln Aug 30, 2024
15a10f5
New Generic base data for protons, including MC simulated kernels and…
remocristoforetti Sep 2, 2024
84367f1
GUI update for bioModels
remocristoforetti Sep 2, 2024
ae25b05
Renaming Wedenberg model
remocristoforetti Sep 2, 2024
cfc83df
correct Generic machine file upload
remocristoforetti Sep 2, 2024
c581cd4
Replace remaining instances of bioParam to bioModel and do some gui f…
wahln Sep 2, 2024
5017288
fix filling of bio model in Plan Widget
wahln Sep 16, 2024
c1b200e
Merge branch 'dev' into pr/756
wahln Sep 16, 2024
6b6feb0
static functions to obtain available models and create a model from s…
wahln Sep 26, 2024
98dbebd
Merge branch 'dev' into pr/756
wahln Sep 26, 2024
49d9441
adapt bioModel in new stf generators
wahln Sep 26, 2024
d586b8f
some model streamlining using constant properties
wahln Sep 29, 2024
fbfb853
consistent naming of constant property to check radiation modes
wahln Sep 29, 2024
62714eb
update base data
wahln Oct 2, 2024
a8f8595
Merge branch 'dev' of github.com:e0404/matRad into pr/765
wahln Oct 2, 2024
a089735
fixes to differences in how machine names are requested
wahln Oct 2, 2024
5785ec0
fix in machine creator string
wahln Oct 2, 2024
233566a
new focus spot spacing Lookup name
wahln Oct 2, 2024
cab5ce9
fixed weights for some energies
remocristoforetti Oct 2, 2024
483391b
some improvements for availability checks
wahln Oct 9, 2024
001a022
Merge branch 'dev' of https://github.com/e0404/matRad into pr/756
wahln Oct 9, 2024
6142ecc
fix some issues regarding optimization with unusual model choices (i.…
wahln Oct 10, 2024
0ba8f54
fix some issues in model selection
wahln Oct 10, 2024
0a8cd80
Merge branch 'dev' into dev_bioModelMerging
wahln Oct 10, 2024
1521df6
remove unused and unecessary getSubfolders function
wahln Oct 10, 2024
fe7b870
remove commented code from dose engine
wahln Oct 10, 2024
b2b9588
changed validation of model to check if engine can compute the quanti…
wahln Oct 10, 2024
eae959b
calcBioCheckConsistency has been moved
wahln Oct 10, 2024
fda7b89
Merge branch 'dev_bioModelMerging' of https://github.com/remocristofo…
wahln Oct 10, 2024
d9488e3
some adaptations to dose calculation and display and availability fun…
wahln Oct 11, 2024
ece65c7
example cleanup to respect new bioModel and multScen nomenclature
wahln Oct 11, 2024
aaca6c2
revert version change
wahln Oct 11, 2024
533975e
some type fixes and quantityOpt fixes
wahln Oct 11, 2024
e5c9ac2
some more fixing for passing the tests
wahln Oct 11, 2024
e49807e
Merge branch 'dev' into pr/756
wahln Oct 11, 2024
fb4d850
Apply constant properties in TabluatedSpectralKernel
wahln Oct 11, 2024
d714fde
Merge branch 'dev' into pr/756
wahln Oct 12, 2024
8fa1308
some code cleanup and fixes
wahln Oct 12, 2024
842027e
Merge branch 'dev' into dev_bioModelMerging
wahln Oct 15, 2024
e969edb
small update to example script and standard setting for lateral model…
wahln Oct 15, 2024
b3251bd
Merge branch 'dev' into dev_baseDataMerging
wahln Oct 15, 2024
8c421da
Merge branch 'pr/765' into pr/756
wahln Oct 15, 2024
88cbce2
update changelog
wahln Oct 15, 2024
4d15f06
manage updates of machine / engine / model combination
wahln Oct 16, 2024
4c436c4
Merge branch 'dev_bioModelMerging' of https://github.com/remocristofo…
wahln Oct 16, 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
122 changes: 122 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Changelog

## Release Candidate v3 "Cleve"

### Major Changes and New Features

#### File Structure Overhaul
- Major restructuring of files into organized subfolders, such as matRad (core code), thirdParty, examples, etc., to improve clarity and maintainability.
- Introduction of userdata folder to maintain custom data

#### Scenario Management and robust / 4D optimization
- Introduced comprehensive scenario management (scenario models), including support for 4D phase scenarios and automated scenario model instance tests.
- Multiple robust optimization methods (COWC, OWC, VWWC, expected value)

#### Object-Oriented DoseEngines & new Monte Carlo interfaces
- Transitioned from procedural dose calculation to an object-oriented approach, significantly improving the structure and maintainability of the dose engines.
- Added customizable TOPAS interface for ions (and experimental for photons)
- Workflow of the existing Monte Carlo interfaces has been completely overhauled in the new engine format
- New handling of coordinate system (separation into world / cube systems with dedicated transformation functions) to ease readability

#### Helium planning
- matRad now contains a Generic helium dataset including LET
- LET-based Helium model

#### Extended biological modeling
- Multiple variable RBE models for protons and helium
- BED optimization

#### Widget-Based GUI
- Replaced Matlab's GUIDE-based approach with a modern widget-based GUI.
- Large parts of the GUI are now Octave Compatible

#### DICOM Exporter
- added a DICOM exporter for CTs, RTStruct, RTPlan (photons, safeguarded) and RTDose

#### Possibly Breaking Changes to matRad core workflow and functions
While we try to keep downwards compatibility (and will provide fixes if breaking changes are detected), here are some potential dealbreakers
- The coordinate handling of the isocenter changed. The isocenter is now always given in "world" coordinates (i.e., corresponding to the ct plane coordintes). Before, the isocenter resided in its own "cube" coordinate system (voxel index * resolution)
- Default configuration options now stored in MatRad_Config under "defaults" struct. There is a compatibility layer, but this might break under user changes
- Changed matRad_calcCubes to accept a variety of different fields for Monte Carlo, without changing the current usage
- Some coordinate system bug-fixes might induce changes when an existing script is rerun
- The object oriented scenario models and biological models could procude issues in old scripts if not set
- While the old dose calculation functions have been kept in a compatibility / deprecation layer, some configuration options might not work as intended

### Other Enhancements, Documentation, and Testing

#### New unit-testing framework
- Introduced Usage of MOxUnit and MOcov for automated unit tests (and the example tests). They are included as submodules.
- Unit tests now runnig as GitHub Actions on Matlab R2022b, the latest release, and Octave 6

#### Improved Octave Compatibility:
- Compatibility tested for Octave 6 to 9.
- Octave compatibility not always optimal, and IPOPT needs to be compiled individually.

#### Performance Improvements & Code Cleanup
- Performance improvements and updates on interpolation
- Performance improvements in optimization
- Code cleanup for consistent use of MatRad_Config's error / warning / logging mechanism.

### Bug Fixes
- *Compilation Fixes:* Resolved issues with ompMC mex file compilation and Octave compatibility warnings.
- Corrected path issues and file handling, especially for temporary directories and submodules.
- Fixed some bugs in optimization objectives & constraints for special input cases
- Fixed issues in DICOM import expecting non-standard tags

## Version 2.10.1 - Patch release for "Blaise"
Release with small updates, clean-ups and bugfixes
- Bugfix in 3D view due to inconsistent angles in pln & stf
- Bugfix for using incorrect dicom UID's and wrong writing order in the dicom export
- Bugfix for weird colormap issue in plotting
- New handling of environment checking with matRad_cfg (old function is still working)
- Code documentation update
- Remove hardcoded penumbra width in photon dose calculation -> can now be stored in machine file (machine.data.penumbraFWHMatIso)
- Update to ompMC to use virtual Gaussian source (uses measured penumbra value) incld precompiled mex files
- Remove useless global statements before matRad_cfg
- Add blue/white/red difference map to colormaps (in the correct way)
- Updated TravisCI testing (Sped up by using pre-compiled mex interfaces and including testing with Matlab (on Ubuntu), Azure DevOps as fallback
- Github gimmicks added: Stalebot, Issue & PR Templates
- Code optimization for jacobian evaluation (x10-100 speedup)
- New option pln.propDoseCalc.useGivenEqDensityCube (default false) to directly use the literal values from ct.cube and omit HU to WEQ conversion from ct.cubeHU
- New option pln.propDoseCalc.ignoreOutsideDensities (default true) to disable/enable inclusion of WEPL outside the patient contour in ray-tracing

## Version 2.10.0 - "Blaise"
Second Release of matRad. Note that despite major incompatibilities with "Alan" we still chose major version number "2" to have a consistent versioning in the future.
We want to thank all new contributing authors (see AUTHORS.txt)
The new release contains:
- Integration tests using TravisCI (with Octave, so no GUI functionalities are tested)
- matRad_rc script to configure matRad paths
- matRad version can now be printed with matRad_version, version correctly shown in GUI and when using matRad_rc
- Seven new Matlab example scripts to demonstrate use of matRad
- Added basic interfaces to the open-source photon/proton MC engines ompMC/MCsquare
- Overhaul of the optimization interface using OOP and integration of the fmincon optimizer from Mathworks' MATLAB Optimization toolbox
- Changes to the cst variable (new script to convert old to new cst structures in tools folder)
- Separation of ct/optimization/dose calculation grids to allow different resolutions
- The graphical user interface can now be started in developer mode (more error information) and a simplified educational mode (some functionalities disabled, less buttons)
- Base data and default phantoms now organized in subfolders
- DICOM export added (only script, dicomImport folder renamed to dicom)
- DICOM import GUI
- Binary import and export functionalities (script & GUI)
- Overhauled the standalone project file
- Standalone toolbox file for matRad
- Dose calculation now uses generalized initialization scripts
- matRad_compareDose tool to compare two dose distributions with difference and gamma analysis
- More tools for visualization and data analysis in the tools folder
- Possibility to define range shifter
- Quality indicator & DVH display wrapper scripts
- Wrapper to allow 3D conformal planning using dij collapsing
- New colormap handling to allow integration of custom colormaps
- Modularization of slice display by dedicated functions in plotting folder including generation of 3D views
- New global configuration object (matRad_cfg <- MatRad_Config.m) to store default values and with logging interface
- Many bug fixes and many new bugs..

## Version 2.1 "Alan"
First official release of matRad including
- New optimizer IPOPT for constrained optimization
- Validated ray tracing
- Validated pencil beam particle dose calculation
- Validated singular value decomposed pencil beam photon dose calculation
- DICOM import including dose and particle pencil beam scanning plan objects
- matRad standalone version
- Improved GUI workflow
- Many bug fixes and many new bugs...
94 changes: 0 additions & 94 deletions ChangeLog.txt

This file was deleted.

3 changes: 2 additions & 1 deletion examples/matRad_example10_4DphotonRobust.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
pln.propDoseCalc.doseGrid.resolution.z = 5; % [mm]

% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);

% retrieve 9 worst case scenarios for dose calculation and optimziation
pln.multScen = matRad_multScen(ct,'nomScen');
Expand All @@ -213,6 +213,7 @@

%Activate 4D Optimization
%pln.propOpt.scen4D = 'all';
pln.propOpt.quantityOpt = quantityOpt;
resultGUI = matRad_fluenceOptimization(dij,cst,pln);

%% Trigger robust optimization
Expand Down
3 changes: 2 additions & 1 deletion examples/matRad_example11_helium.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
% MCN: McNamara-variable RBE model for protons WED: Wedenberg-variable RBE model for protons
% LEM: Local Effect Model for carbon ions HEL: data-driven RBE parametrization for helium
% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);

% dose calculation settings
pln.propDoseCalc.doseGrid.resolution.x = 5; % [mm]
Expand All @@ -89,6 +89,7 @@
% The goal of the fluence optimization is to find a set of bixel/spot
% weights which yield the best possible dose distribution according to the
% clinical objectives and constraints underlying the radiation treatment
pln.propOpt.quantityOpt = quantityOpt;
resultGUI = matRad_fluenceOptimization(dij,cst,pln);

%% Plot the Resulting Dose Slice
Expand Down
5 changes: 3 additions & 2 deletions examples/matRad_example12_simpleParticleMonteCarlo.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@

%Biology
modelName = 'none';
quantityOpt = 'physicalDose';
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);
quantityOpt = 'physicalDose';
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt,modelName);
pln.propOpt.quantityOpt = quantityOpt;

% optimization settings
pln.propOpt.optimizer = 'IPOPT';
Expand Down
2 changes: 1 addition & 1 deletion examples/matRad_example13_fitAnalyticalParticleBaseData.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
% MCN: McNamara-variable RBE model for protons WED: Wedenberg-variable RBE model for protons
% LEM: Local Effect Model for carbon ions
% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);


%% generate steering file
Expand Down
3 changes: 2 additions & 1 deletion examples/matRad_example14_spotRemoval.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
% MCN: McNamara-variable RBE model for protons WED: Wedenberg-variable RBE model for protons
% LEM: Local Effect Model for carbon ions
% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);

% retrieve scenarios for dose calculation and optimziation
pln.multScen = matRad_multScen(ct,'nomScen');
Expand All @@ -85,6 +85,7 @@
% The goal of the fluence optimization is to find a set of bixel/spot
% weights which yield the best possible dose distribution according to the
% clinical objectives and constraints underlying the radiation treatment
pln.propOpt.quantityOpt = quantityOpt;
resultGUI = matRad_fluenceOptimization(dij,cst,pln);

%% Spot removal
Expand Down
4 changes: 2 additions & 2 deletions examples/matRad_example15_brachy.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
modelName = 'none';

% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);

% retrieve scenarios for dose calculation and optimziation
pln.multScen = matRad_multScen(ct,'nomScen');
Expand Down Expand Up @@ -219,7 +219,7 @@
% the clinical objectives and constraints underlying the radiation
% treatment. Once the optimization has finished, trigger to
% visualize the optimized dose cubes.

pln.propOpt.quantityOpt = quantityOpt;
resultGUI = matRad_fluenceOptimization(dij,cst,pln);
matRadGUI;

Expand Down
3 changes: 2 additions & 1 deletion examples/matRad_example16_photonMC_MLC.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
modelName = 'none';

% retrieve bio model parameters
pln.bioParam = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);
pln.bioModel = matRad_bioModel(pln.radiationMode,quantityOpt, modelName);

% retrieve scenarios for dose calculation and optimziation
pln.multScen = matRad_NominalScenario(ct);
Expand All @@ -67,6 +67,7 @@
dij = matRad_calcDoseInfluence(ct,cst,stf,pln);

%% Inverse Optimization for IMRT
pln.propOpt.quantityOpt = quantityOpt;
resultGUI = matRad_fluenceOptimization(dij,cst,pln);
%% Sequencing
% This is a multileaf collimator leaf sequencing algorithm that is used in
Expand Down
Loading
Loading