  Purpose: A promising approach to enable FLASH conformal proton therapy is to
passively degrade a single energy layer using a patient-specific range
modulator. We propose an innovative method to directly optimize the geometrical
characteristics of the range modulator and the treatment plan with respect to
user defined constraints, similarly to state-of-the-art IMPT inverse planning.
  Methods: The kind of range modulators proposed in this study is a voxelized
object which can be placed in the CT for dose computation, which simplifies the
simulation pipeline. Both the geometrical characteristics of the range
modulator and the weights of the PBS spots were directly optimized with respect
to constraints on the dose using a first-order method. A modified Monte Carlo
dose engine was used to provide an estimate of the gradient of the relaxed
constraints with respect to the elevation values of the range modulator.
  Results: Assessed on a head and neck case, dose conformity logically appeared
to be significantly degraded compared to IMPT. We then demonstrated that this
degradation came mainly from the use of a large range shifter and therefore
from physical limitations inherent in the passive degradation of beam energy.
The geometry of the range modulator, on the other hand, was shown to be very
close to being optimal. PBS dose rates were computed and discussed with respect
to FLASH objectives.
  Conclusions: The voxelized range modulators optimized with the proposed
method were proven to be optimal on a head and neck case characterized by two
rather large volumes, with irregular contours and variable depths. The
optimized geometry differed from conventional ridge filters as it was
arbitrarily set by the optimizer. This kind of range modulators can be directly
added in the CT for dose computation and is well suited for 3D printing.
