Automatic commissioning tool for MCsquare
1. OverviewA matlab script has been developed to automatically generate a beam model for MCsquare using commissioning data exported from your TPS. The script implements the commissioning procedure described in the documentation.
The Matlab source code is available on Gitlab: https://gitlab.com/openmcsquare/commissioning/
2. PrerequisitesThe following conditions should be verified in order to ensure full compatibility with the automatic commissioning tool.
- This version of the commissioning tool is only compatible with the Linux operating system. Windows support will be released in the future.
- A recent version of Matlab with the following Toolboxes is required: imaging, optimization, statistics.
- Commissioning measurements data should be exported from the RayStation TPS. Eclipse support will be released in the future.
3. Getting startedYou can try the automatic commissioning tool using the sample dataset provided with the code.
- Download the tool package on Gitlab.
- Sample data exported from the RayStation TPS are provided in the "Sample_data/" folder. This folder contains the commissioning measurements that will be used to generate a beam model for the MCsquare dose engine.
- Run the following Matlab script to generate the BDL using the sample data: "Matlab_Scripts/main.m".
This main script calls four different functions:
- create_BDL() to create the BDL file with initial parameter values
- tune_PS() to tune the phase space parameters (beam optics)
- tune_ES() to tune the energy spectrum parameters
- tune_AD() to tune the protons/MU for absolute dose calculation
The computation may take a few hours, depending on the computer resources.
- The resulting BDL file is generated in "MCsquare/BDL/BDL_P1.txt" and will be updated at each step of the process. The final result should be close to the sample BDL "MCsquare/BDL/Sample_BDL.txt".
Note: In order to reduce the computation time, only one energy (100 MeV) is commissioned during this example.
4. Generate your BDL fileThe example provided with the tool can easily be adapted for the commissioning of your own facility by following these instructions:
- The first step consists in exporting the commissioning data from your TPS. The automatic commissioning tool was tested with RayStation v6 and v8. Contact us if your version is not supported.
- Various measurement information and path to data files should be adjusted before running the script. To do so, modify the first part of "main.m", inside the section "Data - To be modified by user":
- The folder refered as "DataDir" should contain all measurement files extracted from the TPS.
- Adjust the size of your ionization chamber if necessary.
- The absolute dose is generally measured in a 10x10 cm2 field. Adjust the spot spacing if necessary.
- Multiple Monte Carlo simulations will be performed during the tuning of energy spectrum and absolute dose parameters. A synthetic CT image is already provided to simulate the commissioning measurements in water. This CT image should work for your simulations. In case you want to modify this file, verify that the image is deep enough (second component) to allow the simulation of high energy Bragg peaks and large enough (first and third components) to allow the simulation of the square field measured for absolute dosimetry. This CT image can be provided in dicom or mhd format. If the mhd format is used, the associated raw file must be in the same folder as the mhd file.
- The CT calibration curve provided in "MCsquare/Scanners/Water_only" is used to force Monte Carlo simulation in water.
- Due to the large number of particles simulated and the accuracy required by the commissioning tool, a special version of MCsquare compiled in double precision should be used. A double precision MCsquare executable is provided with the commissioning tool, but it is recommended to update it with a double precision MCsquare that match the version used by your final application.
- After running the tool, the resulting beam model is created in the "MCsquare/BDL/" folder.