e0404/matRad

Pencil Beam Calculation Run Time

edwardwang1 opened this issue · 2 comments

Hi,

Thank you to the developers and maintainers of the repository. I am trying to implement the original VMAT algorithm (Otto, 2007 https://aapm.onlinelibrary.wiley.com/doi/10.1118/1.2818738) in matRad as a starting point of a research project.

What is the question? Which file(s) does it concern?
In the original VMAT paper, Otto used pencil beam to perform the dose calculation on the order of milliseconds. In matRad, also uses pencil beam, running matRad_calcPhotonDose takes on the order of seconds per beam. This is the case for both matRad_example2_photons.m and matRad_example8_photonsVMAT in the dev_VMAT_merge branch. I am wonder are possible reasons for the theoretical/technical differences in run time, as Otto also utilized Matlab.

My question is related to the following inquiry:
This is a different issue from 622, as I am curious about the speed of the dose calculation, rather than the optimization step.

I have checked the following matRad Wiki pages and references:
I have read through the technical documentation on the Dose influence matrix calculation, as well as the paper describing matRad in Medical Physics (Wieser et al. 2017). Due to a language barrier, I am not able to read Martin Siggel's thesis

Hi,

first of all, matRad is not a high performance toolkit.
However, I think there is also some important distinction in terms of runtime for dose calculation:
Looking through the Otto paper, the order of miliseconds stated there references dose calculation and cost function calculation during one optimization iteration. Here the dose for the beam is already pre-calculated (i.e. the sample beam is already added) and thus dose calculation is just the precomputed dose influence matrix times the shape-corrected fluence weight, which can be implemented to be very fast.
The Otto paper then states that adding a sample beam takes the order of seconds. This corresponds to dose calculation with the pencil-beam algorithm.

Thus I think the general order of magnitudes check out and are consistent. It will take a bit longer in matRad though, as not everything is perfectly optimized (storage of dose influence matrix, raytracing for pencil-beam calculation, etc.).

Hi Niklas,

Thank you for the explanation. I knew that I was misunderstanding something because running the VMAT optimization example does not take too long.