e0404 / matRad

An open source multi-modality radiation treatment planning sytem developed by e0404 @ DKFZ
http://www.matRad.org
Other
226 stars 176 forks source link

Multimodality or Multi-ion radiotherapy (MIRT) implementation #731

Open ktkaamir opened 5 months ago

ktkaamir commented 5 months ago

Hello! I hope you're doing well. I'm interested in Multi-ion radiotherapy (MIRT) and would like to know if it's possible to use Matrad for creating MIRT plans. Is there a way to implement this? regards ameer

wahln commented 5 months ago

There's work for joint optimization on the branch https://github.com/e0404/matRad/tree/dev_MixedModality mainly led by @amitantony and contributions from @tobiasbecher and @remocristoforetti . While originally built optimizing multiple modalities spread across fractions, it can in principle also be used for multi-ion optimization within a fraction. But @amitantony, @tobiasbecher and @remocristoforetti have a better overview over the code than me, and it is not well documented yet.

wahln commented 5 months ago

I would like to add that one could hack multi-ion pllaning into matRad quite easily, as matRad precomputes alphadose and sqrt(beta)dose matrices for optimization and then does not care anymore about the modality stored in them:

  1. Think about a plan setup (i.e., gantry and couch angles, number of fractions, etc.) and the ions you would want to use. matRad's dev branch currently has proton, helium and carbon generic machines that are usable.
  2. For each of the modalities, independently run matRad_generateStf and matRad_calcDoseInfluence. If you use protons, helium, carbon, you would end up with three dij-structs. 3) Now comes the hacking: Combine the three dij-structs into one. That is, all the influence matrices (e.g. dij.physicalDose, dij.mAlphaDose, dij.mSqrtBetaDose need to be horizontally concatenated into one). The resulting matrices have the number of columns equaling the sum of spots of all modalities, thus you need to edit some of the other metadata in dij to reflect this (e.g., totalNumberOfBixels as well as the vectors beamNum, rayNum, etc. that map bixel indices to beams. 4) You can now run a standard optimization based on effect or RBExD. The optimization only cares for the mAlphaDose and mSqrtBeta dose contents and doesn't care about the actual modality used at this point, so you can just provide to it a pln-struct with radiationMode set to carbons. 5) You will end up with a resulting effect and a spot-weight map. Now you can reverse engineer the individual ion contributions by multiplying the individual matrices with the part of the spot weight map that belong to that modality (or multiply the giant matrix with the spot-weight vector set to zero for spots of the other modalities).

A sustainable implementation should look different:

amitantony commented 5 months ago

Hi @ktkaamir, so @wahln has given a very comprehensive guide above, but would be easier to help if we had some information into what direction you would like to head in. eg. multiple ions over entire treatments (single ion fractions) vs MIRT within a fraction etc.

github-actions[bot] commented 4 months ago

This issue was automatically marked as stale because it has been sitting there for 14 days without activity. It will be closed in 14 days if no further activity occurs.