Skip to content
Merged
Show file tree
Hide file tree
Changes from 122 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
0c7bfec
Codecov Update and GitLab Pipeline for building matRad
wahln Nov 19, 2024
18b6df9
Merge branch 'devops/add_codecov_and_gitlab' into 'dev'
wahln Nov 19, 2024
c55fa64
improve packaging on gitlab
wahln Nov 19, 2024
d0ff281
small bugfix in DVH widget
wahln Nov 19, 2024
3f50eb7
extended GUI tests using the testData for photons, protons, helium an…
wahln Nov 19, 2024
ba37667
Merge pull request #793 from e0404/bugfix/dvhwidget
amitantony Nov 20, 2024
7943366
fix filepaths in workflow github testresults to codecov
wahln Nov 21, 2024
4fc3ed1
Merge branch 'master' into dev
wahln Nov 28, 2024
2f04478
Update CHANGELOG.md
wahln Nov 28, 2024
2b21c92
Small DICOM Export / Import fixes (#799)
wahln Nov 29, 2024
9503d67
Bugfix for Brachy Therapy Stf Generator (#801)
wahln Dec 11, 2024
69f5ac3
Bug/803 window range (#805)
amitantony Dec 19, 2024
79966a3
also include external type contours in optimization
wahln Dec 19, 2024
6e516ae
change interpolation method in dose calculation
wahln Dec 19, 2024
9de7bf9
Merge branch 'dev' of github.com:e0404/matRad into dev
wahln Dec 19, 2024
b364985
fix interpolation in LDR 2D computation in Brachytherapy Dose Engine
wahln Jan 8, 2025
c2a3af7
remove out-of-place options check in OptimizerSimulannealbnd
wahln Jan 10, 2025
1d6ecc4
add global optimization toolbox to test environment to test the simul…
wahln Jan 10, 2025
47995dd
Bug fix for resultGUI field updates with saved results in the GUI (#809)
amitantony Jan 10, 2025
cc75426
bugfix for gantry angle dependant couch angle autofill edit
amitantony Jan 20, 2025
fb4eb96
bug fix for beam angle visualization and update with gantry and couch…
amitantony Jan 22, 2025
af790f4
uses persistent caching for available subclasses (stf generators, sce…
wahln Jan 24, 2025
ab55cfa
don't show warning when default stf generator is selected
wahln Jan 24, 2025
77e9c0c
bug fix for BED quantity opt extended for all modalities
amitantony Jan 24, 2025
ffe6a51
incomplete fix for conformal 3d
amitantony Jan 24, 2025
975b9b2
New function Plot Slice and Bug fixed in Iso Dose lines plot function
SimonaFa Jan 25, 2025
18c13bb
Merge branch 'dev' of https://github.com/SimonaFa/matRad into dev
SimonaFa Jan 25, 2025
8531efe
The ct.cube is not needed for TOPAS dose calc but causes errors here …
JenHardt Jan 28, 2025
8ff7ebe
temporary fixed for BED and effect optimizations
amitantony Jan 29, 2025
e828dff
Merge pull request #817 from e0404/feature/persistent_caching
amitantony Jan 29, 2025
f5a52e2
clean up
amitantony Jan 29, 2025
b18964f
Merge branch 'dev' of https://github.com/e0404/matRad into dev
amitantony Jan 29, 2025
f75e84a
FRED engine (#800)
remocristoforetti Feb 5, 2025
17b3512
Update coverage-report.yml to not fail on PRs
wahln Feb 5, 2025
a8cb604
Merge branch 'dev' into dev
wahln Feb 5, 2025
c39fc9e
Merge branch 'dev' into dev
wahln Feb 5, 2025
3ae5a6a
Merge branch 'dev' into dev_mCB
wahln Feb 5, 2025
172acc1
update to ct.cube handling in TOPAS
JenHardt Feb 7, 2025
6315fd9
Merge pull request #819 from JenHardt/dev
wahln Feb 7, 2025
cf43b11
Merge branch 'dev' into dev_mCB
wahln Feb 7, 2025
15e2954
Merge branch 'dev' into dev
wahln Feb 7, 2025
d303f63
added BED optimization to carbon example (also for test)
amitantony Feb 9, 2025
b7a640f
Merge branch 'dev' of https://github.com/e0404/matRad into dev
amitantony Feb 9, 2025
aa90511
Merge branch 'dev_mCB' of https://github.com/amitantony/matRad into dev
amitantony Feb 9, 2025
fdf2906
Merge pull request #820 from amitantony/dev_mCB
wahln Feb 10, 2025
a81ddfd
should be added here since they are later an option in the beamProfile
JenHardt Feb 12, 2025
a590172
Merge branch 'e0404:dev' into dev
SimonaFa Feb 14, 2025
3ef7fc0
Merge branch 'dev' of https://github.com/JenHardt/matRad into dev
JenHardt Feb 14, 2025
f65ec9b
Revert "should be added here since they are later an option in the be…
JenHardt Feb 14, 2025
a1163e1
plotSlice function changes
SimonaFa Feb 14, 2025
086c499
Correct input order in function description
remocristoforetti Feb 14, 2025
67a77d1
Add source parametrization for FRED
remocristoforetti Feb 14, 2025
38c8a26
Minor bug fix and cleanup
remocristoforetti Feb 14, 2025
8de5078
Update to include readout of multiple ij file version
remocristoforetti Feb 14, 2025
39f749d
Missing output bug fix
remocristoforetti Feb 14, 2025
786ffb6
Merge pull request #825 from remocristoforetti/dev_FRED_ijVersionRead…
wahln Feb 14, 2025
4d6d96e
plotSlice function modification to include display ct option and make…
SimonaFa Feb 14, 2025
d87921c
plot Slice function small fix
SimonaFa Feb 17, 2025
000d3a1
update to include physical dose calc, and beam wise calc
JenHardt Feb 21, 2025
50bcd8f
added index of phase
JenHardt Feb 21, 2025
4ef2a5c
added 4d stuff to Topas engine as well as corresponding test
JenHardt Feb 21, 2025
48582d4
add attributes for line ending management
wahln Feb 26, 2025
6813777
fix in git attributes
wahln Feb 26, 2025
ca05aed
Update .gitattributes such that m files are never committed as execut…
wahln Feb 26, 2025
1c49003
code cleanup
wahln Feb 26, 2025
aecbc90
Synthetic CT example (#827)
mlapaeva Mar 26, 2025
afce203
Merge branch 'e0404:dev' into dev
SimonaFa Apr 4, 2025
2f96685
so that topas output files and analytically calculated have the same …
JenHardt Apr 4, 2025
806f361
update to new dose enging
JenHardt Apr 4, 2025
46a2908
Merge branch 'master' into dev
wahln Apr 4, 2025
5914b52
Merge branch 'dev' into dev
wahln Apr 4, 2025
df6d79e
Merge branch 'dev' into dev
wahln Apr 4, 2025
77e19ab
plotSlice fixing and testing
SimonaFa Apr 4, 2025
2931519
First substitution of plotSlice to deprecated plotSliceWrapper into c…
SimonaFa Apr 5, 2025
625ec6a
Examples 1,2,5,7 substitution of plotSliceWrapper with new plotSlice
SimonaFa Apr 5, 2025
8254137
Substitution of plotSliceWrapper with plotSlice
SimonaFa Apr 7, 2025
6589fa5
Warning fix in plotSlice
SimonaFa Apr 7, 2025
e5c40a7
fix and rename sythetic ct example
wahln Apr 14, 2025
696e9c4
fix matRadGUI return value if GUI is disabled in matRad_Config
wahln Apr 14, 2025
0c53355
some string adaptations in synthetic CT example
wahln Apr 14, 2025
32706bf
Merge branch 'dev' into dev
wahln Apr 24, 2025
e1e507c
Caches for Classes now check if the cached classes are valid, and rec…
wahln Apr 4, 2025
7223c60
Merge branch 'dev' into dev
wahln Apr 25, 2025
3696549
bugfix for EXTERNAL contours and speedub of jacobian structure for co…
wahln May 8, 2025
c595fe7
viewing widget export function
wahln May 8, 2025
e26769c
Merge branch 'dev' into dev
wahln May 9, 2025
fe64f8d
streamlined (using test data only) and octave compatible tests
wahln May 22, 2025
7f1e98e
updates to solve error for photon 4d calc
JenHardt Jun 16, 2025
3bf8128
Merge branch 'dev' into dev
wahln Jun 16, 2025
176c2ab
Merge branch 'master' into dev
wahln Jun 16, 2025
ef079c5
Merge branch 'dev' into dev
wahln Jun 16, 2025
9a0c111
octave fix
JenHardt Jun 16, 2025
42e31d2
Merge branch 'dev' of https://github.com/JenHardt/matRad into dev
JenHardt Jun 16, 2025
ad938d3
replace replace function as it causes porblems with octave
JenHardt Jun 17, 2025
21fd49d
Merge branch 'dev' into dev
wahln Jun 17, 2025
58f24a3
add token to artifact download
wahln Jun 18, 2025
3e98d48
Merge branch 'dev' into dev
wahln Jun 18, 2025
01e3dd8
Merge branch 'dev' into dev
wahln Jun 18, 2025
ced961e
fix test for optional inputs of new plotSlice
wahln Jun 23, 2025
ab21a6b
Merge pull request #818 from SimonaFa/dev
wahln Jun 23, 2025
bb8ec01
added RBE test for regular and 4d plus a small bug fix
JenHardt Jun 27, 2025
8c08414
octave fix
JenHardt Jun 27, 2025
e9411f8
Merge pull request #834 from JenHardt/dev
wahln Jun 27, 2025
c8c5f5f
Fix GUI warnings and add missing GUI update in example 2 (#857)
wahln Jul 23, 2025
57817d7
Plot Slice function: title implemented (#854)
SimonaFa Jul 24, 2025
089ebe2
plotSlice function: minor fix for empty variables option (#859)
SimonaFa Jul 31, 2025
103bbce
make the analytical functions in the Bortfeld engine public
wahln Aug 6, 2025
0f89330
avoid cutting of rad depth on beam for fine sampling engine
wahln Aug 6, 2025
228f95b
small sanity check in weights initialization with warning
wahln Aug 12, 2025
c67b2a9
we need to allow more index computations in fine sampling engine
wahln Aug 12, 2025
0d68a2d
add test to capture PlanWidget behavior overwriting the isocenter in …
wahln Sep 3, 2025
8c2bc04
isocenter will only be updated from the GUI field if not set to "mult…
wahln Sep 3, 2025
a44bbc1
fix octave compatibility issue in changing gantry or couch angles
wahln Sep 3, 2025
cbb274c
more consistent check for empty hObject / objectTag in PlanWidget
wahln Sep 3, 2025
3b0e262
Merge pull request #868 from e0404/bugfix/867-isocenter-nan
wahln Sep 3, 2025
1308623
Tissue selection from GUI bug fixing (#852)
remocristoforetti Sep 3, 2025
6a7a48c
More consistent forward dose calculation and new dose engine tests (#…
wahln Sep 8, 2025
6e2cd3d
more stable extraction of version in FRED engine
wahln Sep 8, 2025
dddf27c
Feature/vhee (#828)
Fabio-Dan Sep 8, 2025
7b7075d
to prevent the matRadGUI window beeing to big if used in MATLAB Online
JenHardt Oct 2, 2025
84bea14
Merge pull request #871 from JenHardt/bugfix/matlabonline_gui
wahln Oct 2, 2025
046b363
Update CHANGELOG.md
wahln Oct 27, 2025
4881d26
bugfix in property setters for ImportanceScenarios
wahln Oct 29, 2025
c227f61
fix for missing constant RBE in effect projection
wahln Oct 29, 2025
e455e93
update version
wahln Oct 29, 2025
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
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Auto-detect text files and normalize (LF in repo).
* text=auto

# Force files to be binary
*.mat binary
*.pdf binary
*.mex* binary
*.zip binary
*.dll binary
*.exe binary

# Ensure .m files are never marked as executable
*.m -x
2 changes: 1 addition & 1 deletion .github/actions/test-matlab/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ runs:
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ inputs.matlab-version }}
products: Image_Processing_Toolbox Parallel_Computing_Toolbox Optimization_Toolbox
products: Image_Processing_Toolbox Parallel_Computing_Toolbox Optimization_Toolbox Global_Optimization_Toolbox

# Runs test command
- name: Run Tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
continue-on-error: true
if: github.event_name == 'pull_request'
with:
recreate: true
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage.xml
coverage.json
*.asv
build/
.DS_Store
51 changes: 51 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_DEPTH: 1
GIT_SUBMODULE_PATH: submodules/MOxUnit submodules/MOcov

.matlab_defaults:
image:
name: '${CUSTOM_MATLAB_IMAGE}:r2024b' # Replace the value with the name of the MATLAB container image you want to use
entrypoint: [""]
variables:
MLM_LICENSE_FILE: $E040_MATLAB_LICENSE_SERVER # Replace the value with the port number and DNS address for your network license manager
resource_group: matlab

test:
stage: test
extends: .matlab_defaults
script: matlab -batch "assert(matRad_runTests('test',true));"
artifacts:
reports:
junit: "./testresults.xml"
coverage_report:
coverage_format: cobertura
path: "./coverage.xml"
paths:
- "./*.xml"
- "./*.json"
coverage: '/TOTAL.*? (100(?:\.0+)?%|[1-9]?\d(?:\.\d+)?%)/'


package:
stage: deploy
extends: .matlab_defaults
script:
- |
if [ -n "$CI_COMMIT_TAG" ]; then
matlab -batch "matRad_buildStandalone('isRelease', true);"
PACKAGE_NAME="$CI_COMMIT_TAG"
else
matlab -batch "matRad_buildStandalone();"
PACKAGE_NAME="$CI_COMMIT_BRANCH"
fi
INSTALLER_NAME="matRad_installerLinux64_$PACKAGE_NAME"
- tar -czvf $INSTALLER_NAME.tar.gz build/installer
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $INSTALLER_NAME.tar.gz "$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/generic/matRad_linux64/$CI_COMMIT_BRANCH/matRad/$PACKAGE_NAME/$INSTALLER_NAME.tar.gz"'
# - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
# - docker image tag matRad:develop $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/matRad:develop
# - docker push $CI_REGISTRY/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/matRad:develop
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == "dev"
- if: $CI_COMMIT_TAG
6 changes: 5 additions & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
List of all matRad developers that contributed code (alphabetical)
List of all matRad developers that contributed code (alphabetical)

* Nelly Abbani
* Nabe Al-Hasnawi
Expand All @@ -11,8 +11,10 @@
* Louis Charton
* Eric Christiansen
* Remo Cristoforetti
* Fabio D'Andrea
* Marios Dallas
* Edgardo Doerner
* Louis Ermeneux
* Simona Facchiano
* Hubert Gabrys
* Josefine Handrack
Expand All @@ -26,6 +28,7 @@
* Navid Khaledi
* Thomas Klinge
* Jeremias Kunz
* Mariia Lapaeva
* Paul Anton Meder
* Henning Mescher
* Lucas-Raphael Müller
Expand All @@ -36,6 +39,7 @@
* Claus Sarnighausen
* Carsten Scholz
* Camilo Sevilla
* Mateusz Sitarz
* Alexander Stadler
* Uwe Titt
* Niklas Wahl
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## Minor Update 3.2.0

### New Features
- FRED MC interface (if installed)
- VHEE planning with a Generic (unfocused) beam and a focused beam. The Generic beam can be forwarded to TOPAS as well.
- New matRad_plotSlice function with keyword / value synxtax for more intuitive plotting of slices

### Bug Fixes & Performance
- DICOM Import widget allow selection of multiple RTDose files.
- DICOM Import Widget and importer handle selected patient more consistently and robustly.
- DICOM Exporter writes quantities beyond dose, importer tries to import them correctly.
- DICOM Exporter now always writes ReferencedRTPlanSequence. Importer can now survive without it.
- DVH widget does not throw a warning in updates, handle scenarios correctly / more robustly and missing xlabel axesHandle parameter.
- GUI fixes regarding setting of gantry angles and other parameters in the PlanningWidget
- EXTERNAL contours now correctly recognized
- performance improvement for obtaining jacobian structure in optimization
- Available Classes (e.g., dose engines) are now cached for faster loading

### User Experience
- Added new examples for usage of FRED & VHEE and a workflow example for comparing dose calculation on synthetic CT to planning CT
- Updated examples to use matRad_plotSlice
- GUI fixes for use in Matlab Online
- The analyitcal functions from the Bortfeld Bragg Peak Model are now public and can be used to compute standard approximations (e.g. range-energy relationship)

### Development and CI
- Added a new `.gitlab-ci.yml` file to support GitLab CI/CD, including test and package stages, artifact handling, and configuration for MATLAB container images and licensing.
- Added a `.gitattributes` file to standardize line endings, treat certain file types as binary, and ensure `.m` files are not marked as executable.
- In `.github/actions/test-matlab/action.yml`, added `Global_Optimization_Toolbox` to the list of MATLAB products for testing.
- In `.github/workflows/coverage-report.yml`, made the coverage PR comment step tolerant to errors to avoid workflow failures.
- More comprehensive dose calculation tests
- Added new contributors

## Version 3.1.0 - "Cleve"

### Major Changes and New Features
Expand Down
8 changes: 8 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ authors:
given-names: "Eric"
- family-names: "Cristoforetti"
given-names: "Remo"
- family-names: "D'Andrea"
given-names: "Fabio"
- family-names: "Dallas"
given-names: "Marios"
- family-names: "Doerner"
Expand All @@ -33,6 +35,8 @@ authors:
given-names: "Swantje"
- family-names: "Ellerbrock"
given-names: "Malte"
- family-names: "Ermeneux"
given-names: "Louis"
- family-names: "Facchiano"
given-names: "Simona"
- family-names: "Gabryś"
Expand Down Expand Up @@ -61,6 +65,8 @@ authors:
given-names: "Thomas"
- family-names: "Kunz"
given-names: "Jeremias"
- family-names: "Lapaeva"
given-names: "Mariia"
- family-names: "Mairani"
given-names: "Andrea"
- family-names: "Meder"
Expand All @@ -85,6 +91,8 @@ authors:
given-names: "Carsten"
- family-names: "Sevilla"
given-names: "Camilo"
- family-names: "Sitarz"
given-names: "Mateusz"
- family-names: "Stadler"
given-names: "Alexander"
- family-names: "Ulrich"
Expand Down
32 changes: 21 additions & 11 deletions examples/matRad_example10_4DphotonRobust.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
stf = matRad_generateStf(ct,cst,pln);

%% Dose Calculation
dij = matRad_calcPhotonDose(ct,stf,pln,cst);
dij = matRad_calcDoseInfluence(ct,cst,stf,pln);

%% Inverse Optimization for IMPT based on RBE-weighted dose
% The goal of the fluence optimization is to find a set of bixel/spot
Expand Down Expand Up @@ -241,30 +241,38 @@
maxDose = max([max(resultGUI.([pln.propOpt.quantityOpt])(:,:,slice)) max(resultGUIrobust.([pln.propOpt.quantityOpt])(:,:,slice))])+1e-4;
doseIsoLevels = linspace(0.1 * maxDose,maxDose,10);
figure,
subplot(121),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.([pln.propOpt.quantityOpt '_' 'beam1']) ,plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('conventional plan - beam1')
subplot(122),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.([pln.propOpt.quantityOpt]) ,plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('conventional plan')
subplot(121),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUI.([pln.propOpt.quantityOpt '_' 'beam1']) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('conventional plan - beam1')
subplot(122),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUI.([pln.propOpt.quantityOpt]) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('conventional plan')
%subplot(121),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.([pln.propOpt.quantityOpt '_' 'beam1']) ,plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('conventional plan - beam1')
%subplot(122),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUI.([pln.propOpt.quantityOpt]) ,plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('conventional plan')

figure
subplot(121),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt '_' 'beam1']),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan - beam1')
subplot(122),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan')
subplot(121),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUIrobust.([pln.propOpt.quantityOpt '_' 'beam1']) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('robust plan - beam1')
subplot(122),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUIrobust.([pln.propOpt.quantityOpt]) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('robust plan')
%subplot(121),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt '_' 'beam1']),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan - beam1')
%subplot(122),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan')


figure
subplot(131),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust4D.([pln.propOpt.quantityOpt]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan')
subplot(132),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust4D.('accPhysicalDose'),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan dose accumulation')
subplot(131),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUIrobust4D.([pln.propOpt.quantityOpt]) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('robust plan')
subplot(132),matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUIrobust4D.('accPhysicalDose') ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);title('robust plan dose accumulation')
%subplot(131),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust4D.([pln.propOpt.quantityOpt]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan')
%subplot(132),matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust4D.('accPhysicalDose'),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);title('robust plan dose accumulation')

% create an interactive plot to slide through individual scnearios
f = figure; title('individual scenarios');
numScen = 1;
maxDose = max(max(resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(numScen))])(:,:,slice)))+0.2;
doseIsoLevels = linspace(0.1 * maxDose,maxDose,10);
matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(numScen))]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);
matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(numScen))]) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels);
%matRad_plotSliceWrapper(gca,ct,cst,1,resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(numScen))]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels);

[env,envver] = matRad_getEnvironment();
if strcmp(env,'MATLAB') || str2double(envver(1)) >= 5
b = uicontrol('Parent',f,'Style','slider','Position',[50,5,419,23],...
'value',numScen, 'min',1, 'max',pln.multScen.totNumScen,'SliderStep', [1/(pln.multScen.totNumScen-1) , 1/(pln.multScen.totNumScen-1)]);
set(b,'Callback',@(es,ed) matRad_plotSliceWrapper(gca,ct,cst,round(get(es,'Value')),resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(get(es,'Value')))]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels));
set(b,'Callback',@(es,ed) matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', round(get(es,'Value')), 'dose', resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(get(es,'Value')))]) ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 maxDose], 'doseIsoLevels', doseIsoLevels));
%matRad_plotSliceWrapper(gca,ct,cst,round(get(es,'Value')),resultGUIrobust.([pln.propOpt.quantityOpt '_scen' num2str(round(get(es,'Value')))]),plane,slice,[],[],colorcube,[],[0 maxDose],doseIsoLevels));
end

%% Indicator calculation and show DVH and QI
Expand All @@ -282,10 +290,12 @@
[cstStatRob, resultGUISampRob, metaRob] = matRad_samplingAnalysis(ct,cst,plnSampRob,caSampRob, mSampDoseRob, resultGUInomScen);

figure,title('std dose cube based on sampling - conventional')
matRad_plotSliceWrapper(gca,ct,cst,1,resultGUISamp.stdCube,plane,slice,[],[],colorcube,[],[0 max(resultGUISamp.stdCube(:))]);
matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUISamp.stdCube ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 max(resultGUISamp.stdCube(:))]);
%matRad_plotSliceWrapper(gca,ct,cst,1,resultGUISamp.stdCube,plane,slice,[],[],colorcube,[],[0 max(resultGUISamp.stdCube(:))]);

figure,title('std dose cube based on sampling - robust')
matRad_plotSliceWrapper(gca,ct,cst,1,resultGUISampRob.stdCube,plane,slice,[],[],colorcube,[],[0 max(resultGUISampRob.stdCube(:))]);
matRad_plotSlice(ct, 'axesHandle', gca, 'cst', cst, 'cubeIdx', 1, 'dose', resultGUISampRob.stdCube ,'plane', plane, 'slice', slice, 'contourColorMap', colorcube, 'doseWindow', [0 max(resultGUISampRob.stdCube(:))]);
%matRad_plotSliceWrapper(gca,ct,cst,1,resultGUISampRob.stdCube,plane,slice,[],[],colorcube,[],[0 max(resultGUISampRob.stdCube(:))]);



10 changes: 1 addition & 9 deletions examples/matRad_example15_brachy.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@
% Here we will use HDR. By this means matRad will look for 'brachy_HDR.mat'
% in our root directory and will use the data provided in there for
% dose calculation.

pln.radiationMode = 'brachy';
pln.machine = 'HDR'; % 'LDR' or 'HDR' for brachy

pln.bioModel = 'none';
pln.multScen = 'nomScen';


%% II.1 - needle and template geometry
% Now we have to set some parameters for the template and the needles.
% Let's start with the needles: Seed distance is the distance between
Expand All @@ -110,6 +108,7 @@
% The needles will be positioned right under the target volume pointing up.


pln.propStf.visMode = 1; %Enable visualization for stf generation
pln.propStf.bixelWidth = 5; % [mm] template grid distance

%Template Type
Expand Down Expand Up @@ -151,16 +150,12 @@
% needles.
% Calculation time will be reduced by one tenth when we define a dose
% cutoff distance.


pln.propDoseCalc.TG43approximation = '2D'; %'1D' or '2D'

pln.propDoseCalc.doseGrid.resolution.x = 5; % [mm]
pln.propDoseCalc.doseGrid.resolution.y = 5; % [mm]
pln.propDoseCalc.doseGrid.resolution.z = 5; % [mm]



% We can also use other solver for optimization than IPOPT. matRad
% currently supports simulannealbnd from the MATLAB Global Optimization Toolbox. First we
% check if the simulannealbnd-Solver is available, and if it is, we set in in the
Expand All @@ -172,7 +167,6 @@
pln.propOpt.optimizer = 'IPOPT';
end

pln.propOpt.optimizer = 'IPOPT';
%% II.1 - book keeping
% Some field names have to be kept although they don't have a direct
% relevance for brachy therapy.
Expand All @@ -182,14 +176,12 @@
% Et voila! Our treatment plan structure is ready. Lets have a look:
disp(pln);


%% II.2 Steering Seed Positions From STF
% The steering file struct contains all needls/catheter geometry with the
% target volume, number of needles, seeds and the positions of all needles
% The one in the end enables visualization.
stf = matRad_generateStf(ct,cst,pln);


%% II.2 - view stf
% The 3D view is interesting, but we also want to know how the stf struct
% looks like.
Expand Down
Loading
Loading