Skip to content

Class based Sequencing#891

Open
JenHardt wants to merge 26 commits into
e0404:devfrom
JenHardt:dev_Sequencing
Open

Class based Sequencing#891
JenHardt wants to merge 26 commits into
e0404:devfrom
JenHardt:dev_Sequencing

Conversation

@JenHardt
Copy link
Copy Markdown
Contributor

Implementation of a class to handle the photon sequencing with the three algorithims siochi, xia, engle as well as an ion sequencer

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 59.10596% with 494 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.64%. Comparing base (adf48b0) to head (8a17097).

Files with missing lines Patch % Lines
matRad/gui/widgets/matRad_WorkflowWidget.m 16.51% 182 Missing ⚠️
...ring/matRad_StfGeneratorExternalRayBixelAbstract.m 38.93% 69 Missing ⚠️
matRad/sequencing/matRad_PhotonSequencerAbstract.m 70.40% 66 Missing ⚠️
matRad/sequencing/matRad_SequencerBase.m 58.33% 55 Missing ⚠️
...atRad/sequencing/matRad_SequencingPhotonsXiaLeaf.m 73.68% 20 Missing ⚠️
...ad/sequencing/matRad_SequencingPhotonsSiochiLeaf.m 86.77% 16 Missing ⚠️
...Rad/sequencing/matRad_SequencingPhotonsEngelLeaf.m 88.88% 12 Missing ⚠️
matRad/4D/matRad_acc4dDose.m 47.61% 11 Missing ⚠️
matRad/4D/matRad_calc4dDose.m 60.00% 10 Missing ⚠️
matRad/sequencing/matRad_engelLeafSequencing.m 0.00% 10 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #891      +/-   ##
==========================================
- Coverage   54.80%   54.64%   -0.16%     
==========================================
  Files         320      327       +7     
  Lines       20548    20703     +155     
==========================================
+ Hits        11261    11313      +52     
- Misses       9287     9390     +103     

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 27, 2026

Test Results

    3 files  ±0      3 suites  ±0   32m 53s ⏱️ + 1m 1s
  357 tests ±0    353 ✅  - 4  0 💤 ±0  4 ❌ +4 
1 167 runs  ±0  1 158 ✅  - 4  5 💤 ±0  4 ❌ +4 

For more details on these failures, see this check.

Results for commit 8a17097. ± Comparison against base commit adf48b0.

This pull request removes 5 and adds 5 tests. Note that renamed tests count towards both.
test_TopasMCEngine ‑ test_TopasMCdoseCalc4D
test_TopasMCEngine ‑ test_TopasMCdoseCalcBasic
test_TopasMCEngine ‑ test_TopasMCdoseCalcBasicRBE
test_TopasMCEngine ‑ test_TopasMCdoseCalcMultRuns
test_TopasMCEngine ‑ test_TopasMCdoseCalc_multiAlphaBeta
test_TopasMCEngine ‑ test_topasMCdoseCalc4D
test_TopasMCEngine ‑ test_topasMCdoseCalcBasic
test_TopasMCEngine ‑ test_topasMCdoseCalcBasicRBE
test_TopasMCEngine ‑ test_topasMCdoseCalcMultRuns
test_TopasMCEngine ‑ test_topasMultiAlphaBeta

♻️ This comment has been updated with latest results.

@wahln
Copy link
Copy Markdown
Contributor

wahln commented Feb 27, 2026

There seem to be a bunch of unhappy tests in this PR ;-)

@wahln
Copy link
Copy Markdown
Contributor

wahln commented Feb 27, 2026

Also I am confused about the changed 4D capabilities (that don't seem to have anything to do with sequencing in parts).
Also, we should keep downwards compatibility with the old sequencing calls for a while.

Copy link
Copy Markdown
Contributor

@wahln wahln left a comment

Choose a reason for hiding this comment

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

Did some preliminary rough review.

Comment thread matRad/matRad_sequencing.m Outdated
@@ -1,4 +1,4 @@
function resultGUI = matRad_sequencing(resultGUI,stf,dij,pln,visBool)
function resultGUI = matRad_sequencing(resultGUI,stf,pln,dij,visMode)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason why the dij has become optional? This is a huge change without much benefit it seems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is just because the dij is just used to recalculate the dose based on the new sequenced weight vector, but you could run the sequencing independently

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could probably still be removed?

Comment thread matRad/4D/matRad_calc4dDose.m Outdated
@@ -1,29 +1,23 @@
function [resultGUI, timeSequence] = matRad_calc4dDose(ct, pln, dij, stf, cst, resultGUI, totalPhaseMatrix,accType)
function resultGUI = matRad_calc4dDose(dij, pln,stf,resultGUI, totalPhaseMatrix)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why did the argument list chagne so drastically?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the ct was only used to save the number of ct scenarios and the motion period , this should now be in the pln scenario model and the cst was used for the ax and bx vectors this is taken directly from the dij

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

okay let's approach it from the other way: can we avoid the pln struct when using the ct?
I would like to keep pln out of lower-level functions as much as possible, and only pass it to top-level workflow functions (as the pln can, for example, be easily changed in the GUI and lead to inconsistent inputs).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think this can be done, but then i need the ct again,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no acctually i need it to selecect the sequencer and calculate the phaseMatrix if not given, although right now the phaseMatrix is only calculated for ions not photons

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn#t this a function that should actually be moved into the IonSequencer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it is this was one of the files i deleted, where i just now reverted the delition to make it backwards compatible, i haved pushed the update to this file jet

Comment thread matRad/sequencing/matRad_SequencerBase.m
Comment thread matRad/sequencing/matRad_ParticleSequencer.m
Comment thread matRad/sequencing/matRad_PhotonSequencerAbstract.m
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change in the interface destroys downwards compatibility.. Is this necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i removed it because it was never used in the function

Comment thread matRad/matRad_sequencingOld.m Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Naming the file sequencingOld and the function still sequencing will create problems. I suggest to not change the interface of the sequencing call (with the optional dij at the end) but just keep the old interface (resultGUI,stf,dij,pln,visBool) -> visBool can become visMode, this is still OK just selecting the visMode 1 if it is true.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

similar to above this is an issue of the delition and reverting of the delition that is not completet yet

Comment thread submodules/ompMC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is changed in the submodule? Is this intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no

@github-actions
Copy link
Copy Markdown

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 Apr 20, 2026
@wahln
Copy link
Copy Markdown
Contributor

wahln commented May 5, 2026

I think this needs an update from the dev branch

@github-actions github-actions Bot removed the stale Automatic label for stale issues label May 6, 2026
@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 matRad | 🛠️ Build #32632799 | 📁 Comparing 8a17097 against latest (c014dc8)

  🔍 Preview build  

38 files changed · + 1 added · ± 37 modified

+ Added

± Modified

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