Support for discrete energy layers (synchrotron-based proton therapy) in OpenTPS

Dear OpenTPS team,

First of all, thank you for the great work you have put into developing and maintaining OpenTPS. It is a valuable open-source tool for the proton therapy research community.

I have been studying the plan optimization workflow in OpenTPS and noticed that the energy layers are generated by parameters such as the energy layer spacing, with energies taken as continuous values within the range of the target. I also read the earlier discussion on the forum started by chenye, and I understand that this approach may have been designed with the characteristics of IBA cyclotron-based systems in mind, where the energy can be adjusted in a quasi-continuous manner.

My research, however, is based on a synchrotron-based proton therapy system, in which only a discrete set of energies is available for delivery. I would therefore like to ask:

  1. Does OpenTPS already provide native support (functions, modules, or options) for restricting the plan to a predefined discrete list of energies? If so, could you point me to the relevant documentation or example scripts?
  2. If not, I am considering implementing this myself by forcing the selectable energies (e.g. in the energy layer selection/spot placement step) to snap to, or be drawn from, a user-defined discrete energy table. Are there any assumptions elsewhere in the code, for example in beam model interpolation, spot placement, the MCsquare interface, the optimization objective, or plan data structures, that could cause unexpected or hard-to-detect problems if the energies are constrained this way? Do you have any recommendations or pitfalls to watch out for?

Best regards,
Ray