Skip to content

Conversation

@Fabio-Dan
Copy link
Contributor

@Fabio-Dan Fabio-Dan commented Feb 21, 2025

Combined work on VHEE post-Hackathon:

Fabio D'Andrea
Louis Ermeneux

@wahln
Copy link
Contributor

wahln commented Feb 26, 2025

First of all, this is great work, and udpated to the new dose engine structure and stf generators it looks really slim as well. Very nice addition.

I reverted some merge issues you had on the original PR and fixed some small bugs. Also I made the GUI work, so you can now again easily run VHEE from the GUI as well. Both Focused and FermiEyges seem to work.

Some things to work on:

  • Add your names to the AUTHORS.txt and athe CITATION.cff file (authors are in alphabetical order
  • check the documentation in the new engine and stf generator (headers). Maybe provide some more information there
  • Implement an example in the example-folder based on your current matRad.m file. Then revert the matRad.m file to the original one.
  • Add a test data set (I can do this at the end)
  • Allow the TOPAS engine to directly simulate VHEE (not sure if we should do this within this PR)

Regarding the last point of directly forwarding to our TOPAS interface, we would need an energySpectrum (Gaussian) as well as an emittance parameterization (BiGaussian) for the energies stored within the machines. I think it mostly makes sense to start with the FermiEyges machine. Do we have this data for this machine already available by one of you guys?

@wahln
Copy link
Contributor

wahln commented Feb 28, 2025

I just added TOPAS functionality and ran a preliminary test:
{E196C9B8-A44D-4EA2-9EEC-0B187A74DADD}
{3A9213DC-3DF0-48ED-8FC3-50359390F030}

This looks close enough for me for 1e6 primaries!

I had to normalize the MC output to the analytical, though, by a factor of approximately 0.5. Do you have information about the absolute dosimetry (i.e., how many incoming primary electrons does the VHEE_FermiEyges dataset assume?).

@Fabio-Dan
Copy link
Contributor Author

Fabio-Dan commented Feb 28, 2025

Great progress - updated:

Add your names to the AUTHORS.txt and athe CITATION.cff file (authors are in alphabetical order

  • Update AUTHORS and Citation Files:

Review Documentation:

  • Check the documentation for the new engine and the STF generator (headers). If needed, provide additional details or clarifications.

Implement Example:

  • Simple example added
  • Expand example with TOPAS interface (to be decided)?

Test Data Set:

  • Add a test data set.

TOPAS Engine VHEE Simulation:

  • Consider allowing the TOPAS engine to directly simulate VHEE. (Would be a nice feature)

@wahln
Copy link
Contributor

wahln commented Mar 3, 2025

The TOPAS engine now actually runs with VHEE. If you have TOPAS installed and the correct path set, or use the externalCalculation flag to write the files only. I will check if I can put this into the example.

@wahln
Copy link
Contributor

wahln commented Mar 13, 2025

  • I fixed the focused calculation to use lateral distances in x / y together with the respective cutoff calculation.
  • I also integrated the VHEE engine into the ParticleHongPencilBeam Engine, as the modifications are minimal and can be used for any type of charged particle calculations (electrons / ions).
  • The example now also writes TOPAS parameter files and performs another type of visualization not covered yet in other examples.

@codecov
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

❌ Patch coverage is 77.96610% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.82%. Comparing base (6e2cd3d) to head (5dcaeda).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
matRad/steering/matRad_StfGeneratorParticleVHEE.m 81.81% 8 Missing ⚠️
...eEngines/matRad_ParticlePencilBeamEngineAbstract.m 83.33% 7 Missing ⚠️
matRad/gui/widgets/matRad_PlanWidget.m 0.00% 4 Missing ⚠️
matRad/MatRad_Config.m 0.00% 3 Missing ⚠️
...+DoseEngines/matRad_ParticleHongPencilBeamEngine.m 72.72% 3 Missing ⚠️
...atRad/doseCalc/+DoseEngines/matRad_TopasMCEngine.m 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #828      +/-   ##
==========================================
+ Coverage   53.68%   53.82%   +0.14%     
==========================================
  Files         307      308       +1     
  Lines       19849    19947      +98     
==========================================
+ Hits        10655    10737      +82     
- Misses       9194     9210      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link

This PR was automatically marked as stale it has been open 30 days with no activity. Please review/update/merge this PR.

@github-actions github-actions bot removed the stale Automatic label for stale issues label May 13, 2025
@github-actions
Copy link

This PR was automatically marked as stale it has been open 30 days with no activity. Please review/update/merge this PR.

@github-actions github-actions bot added the stale Automatic label for stale issues label Jun 22, 2025
@github-actions
Copy link

github-actions bot commented Jun 24, 2025

Test Results

    3 files  ± 0      3 suites  ±0   44m 3s ⏱️ +46s
  318 tests + 7    318 ✅ + 7  0 💤 ±0  0 ❌ ±0 
1 050 runs  +21  1 045 ✅ +21  5 💤 ±0  0 ❌ ±0 

Results for commit 5dcaeda. ± Comparison against base commit 6e2cd3d.

♻️ This comment has been updated with latest results.

@github-actions github-actions bot removed the stale Automatic label for stale issues label Jun 25, 2025
wahln added 3 commits July 24, 2025 23:43
# Conflicts:
#	matRad/doseCalc/+DoseEngines/matRad_TopasMCEngine.m
#	matRad/gui/widgets/matRad_WorkflowWidget.m
* add stf test
* fix stf generator default radiation mode setting
@wahln wahln marked this pull request as ready for review July 25, 2025 01:53
@wahln
Copy link
Contributor

wahln commented Jul 25, 2025

For the FermiEyges dataset, Monte Carlo forward dose calculation works and is now properly normalized.
I don't have adequate beam data for the focused dataset, and I think we can leave that open for now. Then only valid PB calculations are possible with this dataset.

@github-actions
Copy link

This PR was automatically marked as stale it has been open 30 days with no activity. Please review/update/merge this PR.

@github-actions github-actions bot added stale Automatic label for stale issues and removed stale Automatic label for stale issues labels Aug 25, 2025
@wahln wahln requested a review from Copilot September 4, 2025 08:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Very High Energy Electrons (VHEE) radiotherapy in matRad, extending the framework to support a new radiation modality. The implementation includes VHEE-specific steering generators, dose calculation engines, and GUI integration.

Key changes:

  • Addition of VHEE radiation mode support across the codebase
  • New VHEE steering file generator with single-energy beam capability
  • Extended dose calculation engines to handle VHEE radiation
  • GUI and workflow integration for VHEE treatment planning

Reviewed Changes

Copilot reviewed 20 out of 24 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
test/steering/test_stfGeneratorVHEE.m New comprehensive test suite for VHEE steering file generator
matRad/steering/matRad_StfGeneratorParticleVHEE.m New VHEE-specific steering file generator class
test/doseCalc/test_baseEngine.m Added VHEE test case for dose engine selection
test/doseCalc/test_TopasMCEngine.m Extended TOPAS engine tests to handle VHEE radiation mode
matRad/doseCalc/+DoseEngines/matRad_TopasMCEngine.m Added VHEE support to TOPAS Monte Carlo engine
matRad/doseCalc/+DoseEngines/matRad_ParticleHongPencilBeamEngine.m Extended Hong pencil beam engine for VHEE
matRad/gui/widgets/matRad_PlanWidget.m Added VHEE to GUI radiation mode options
examples/matRad_example20_VHEE.m New example demonstrating VHEE treatment planning workflow

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wahln wahln merged commit dddf27c into e0404:dev Sep 8, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants