No spots created in the plan file at a different gantry angle

Hello,

I am using OpenTPS to create a treatment plan for my animal. I initially did this for a gantry angle = 0 degrees but realized that the beam is directed in such a way that it passes through the esophagus, which is not something that we want.

image

So then I tried to approach from the other side by using a gantry angle = 180 degrees but it says there are no spots generated in the plan. I am not sure why this is happening.

31/05/2024 01:36:58 PM - opentps.core.data.plan._planDesign - INFO - Building plan ...
31/05/2024 01:36:58 PM - opentps.core.processing.planOptimization.planInitializer - INFO - Target is dilated using a margin of 0.2 mm. This process might take some time.
31/05/2024 01:36:58 PM - opentps.core.processing.imageProcessing.roiMasksProcessing - INFO - Using SITK to dilate mask.
31/05/2024 01:37:33 PM - opentps.core.data.plan._planDesign - INFO - New plan created in 35.37562799453735 sec
31/05/2024 01:37:33 PM - opentps.core.data.plan._planDesign - INFO - Number of spots: 0.0
31/05/2024 01:37:33 PM - opentps.core.processing.doseCalculation.mcsquareDoseCalculator - INFO - Prepare MCsquare Beamlet calculation
31/05/2024 01:37:36 PM - opentps.core.io.mhdIO - INFO - Write MHD file: C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation\CT.mhd
31/05/2024 01:37:37 PM - opentps.core.io.mcsquareIO - INFO - Write plan: C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation\PlanPencil.txt
31/05/2024 01:37:39 PM - opentps.core.processing.doseCalculation.mcsquareDoseCalculator - INFO - Start MCsquare simulation

(OpenTPS_venv) C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation>set MCsquare_Materials_Dir=C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation\Materials 

(OpenTPS_venv) C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation>C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation\MCsquare_win.exe

 Warning: Unknown tag "Optimization_Mode" in "config.txt"


Initialization time: 1.533368 s

Total computation time: 1.537435 s 
31/05/2024 01:37:41 PM - opentps.core.io.mcsquareIO - INFO - Read sparse beamlets: C:\Users\P290425\openTPS_workspace\Simulations\MCsquare_simulation\Outputs\Sparse_Dose.txt
Traceback (most recent call last):
  File "y:\staff\LowCost\cart\INTO-PROT\!Projects\DPDE\openTPS\opentps-master\my_scripts\plans\DoseCalc_CT_MOBY_Brain.py", line 123, in <module>
    beamlets = mc2.computeBeamlets(ct, plan)
  File "Y:\staff\LowCost\cart\INTO-PROT\!Projects\DPDE\openTPS\opentps-master\opentps_core\opentps\core\processing\doseCalculation\mcsquareDoseCalculator.py", line 412, in computeBeamlets    beamletDose = self._importBeamlets()
  File "Y:\staff\LowCost\cart\INTO-PROT\!Projects\DPDE\openTPS\opentps-master\opentps_core\opentps\core\processing\doseCalculation\mcsquareDoseCalculator.py", line 672, in _importBeamlets    beamletDose = mcsquareIO.readBeamlets(self._sparseDoseFilePath, self._beamletRescaling(), self.scoringOrigin, self._roi)
  File "Y:\staff\LowCost\cart\INTO-PROT\!Projects\DPDE\openTPS\opentps-master\opentps_core\opentps\core\io\mcsquareIO.py", line 64, in readBeamlets
    header = _read_sparse_header(file_path)
  File "Y:\staff\LowCost\cart\INTO-PROT\!Projects\DPDE\openTPS\opentps-master\opentps_core\opentps\core\io\mcsquareIO.py", line 104, in _read_sparse_header
    with open(Header_file, 'r') as fid:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\P290425\\openTPS_workspace\\Simulations\\MCsquare_simulation\\Outputs\\Sparse_Dose.txt'

This problem has been discussed by email, but just so everyone knows, I will add details here.

The problem is coming from the conversion of range to energy. Initially, we set a limit of 1cm, below which the energy was not computed and the considered spots were removed from the treatment plan. This is what happened here for the 180° angle, the ranges from gantry to the spots were all smaller than the limit and spots were thus discarded. This limit was initially set to prevent inaccurate energy computation for small ranges (we do not have any certainty that this energy fit is valid for these small ranges). Since the V1.1.0 release of OpenTPS (v1.1.0 · Open-MCsquare / OpenTPS · GitLab), this limit has been removed. Instead, a warning is triggered when small ranges are used.

Benjamin