/Sentinel-Public

Automated log-file analysis for Varian linacs (TrueBeam, Halcyon, Edge)

Primary LanguageHTMLApache License 2.0Apache-2.0

Sentinel

Sentinel is an automated log-file analysis application for Varian linacs (TrueBeam, Halcyon, Edge).

NOTE: It works for Elekta machines also but only if you have a way to get iCom-Vx files automatically pushed to a folder on the network that Sentinel can see. If you have a simple method to do this, it works for Elekta machines also!

Introduction

Sentinel is capable of monitoring up to 25 linacs simultaneously (maybe more - but that's all I could test) it creates MU map images, akin to fluence, for both the expected mechanical parameters and the actual mechanical delivery parameters. It monitors every MLC leaf, jaw, collimator, gantry, and couch position which is streamed at 20 ms intervals during delivery to a Trajectory Log file. Sentinel automatically and passively processes these files as soon as they are generated by monitoring the TDS directory supplied by the user and it does this by using parallel processing and a job queuing system. It automatically performs gamma analysis on planned and measured fluence MU map images to determine whether what was planned was delivered and can be configured to email you when something fails.

All this data is processed and recorded for every patient, every fraction, and every beam on every linac in a table and CSV file so that some "big data" type analysis can be done, and Sentinel provides the tools to go down this rabbit hole if you wish.

Sentinel also processes incoming RP DICOM plan files that are sent to a different directory that is supplied by the user. I have trained a Sentinel AI on these fluence images against PASS FAIL gamma criteria, with the hope to immediately tell whether a given treatment plan may fail QA before it even being measured or delivered. I'm still testing that though so maybe don't take the AI's word for it just yet and it might not even be a viable method... we'll see!

MainScreen

How it works

Sentinel monitors two directories, one where your plans are exported in DICOM format (...RP.dcm) and the other is your TrueBeams TDS folders. If all your machines share the same location for their TDS folders, e.g. .../VA_TRANSFER/TDS then point Sentinel to that directory and it will monitor all sub-directories for incoming machine trajectory files. As the logs come in Sentinel automatically processes them and compares the planned to actual positions of all mechanical axes. Sentinel generates and saves .png image files of the expected fluence map, the actual fluence map, and the gamma map in the output folder (note these images are small but the number of files can add up quickly!!!). Results for each field and the sum of the delivered fields are saved in a file called TableData.csv in the program's install directory. As plan DICOM files come in following export from the TPS to the nominated directory, a prediction is made whether they will PASS or FAIL the delivery. This is based on comparing the planned fluence images for each field to a neural network result following input of that fluence image. NOTE: This is still being tested. Each plan check result (PASS/FAIL) is stored in a PlanCheckResult.csv file in the install directory. These .csv files can be opened in Excel or any text editor for further data analysis.

Recommended PC Specs

I recommend running Sentinel on an always-on decent modern Windows PC in your clinic with at least a multi-core processor i5/i7 etc and at least 8 Gb of RAM. The software must be installed on PCs that have access to the TDS directory and all paths provided in the configuration steps below. If you're worried about security. Sentinel does not connect to the internet and only runs locally.

Setting up Sentinel

  1. Download All files from GitHub.
  2. Install the software by running the installer in the for_redistribution folder
  3. Open the for_testing folder and create a shortcut to the Sentinel.exe file in that folder. NOTE the software won't work if you run the installed executable in Program Files. Use the installer to download the Matlab runtime then run the software from the for_testing folder on your desktop or other location.
  4. Open Sentinel *some error messages might pop up the first time as the default directories won't exist, just click Ok
  5. Click the settings cog in the top left and enter the required data and folder location root directories. NOTE: I recommend gamma criteria of 2%/0.5mm for TrueBeam logfile comparison.
  6. Click Save Defaults to save your configuration which will load every time you run the software.
  7. Click Close to close the settings window
  8. Click the Start Monitoring toggle and switch to the ON position to begin monitoring.
  9. Toggle the Email Alerts switch to ON if you would like to receive email notifications for failed fields. NOTE that there is currently a problem where if the Windows PC is on the lock screen, no emails will be sent and the software will crash. If you cannot avoid lock screen timeouts, then I suggest turning email alerts off. Email alerts also require Microsoft Outlook to run.
  10. That's it!

Config

NOTE: PLEASE DO NOT USE PROTECTED DIRECTORIES LIKE C:\USERS\XXXX\OUTPUT ETC FOR THE OUPTUT DIRECTORIES AS THE SOFTWARE CANNOT WRITE TO THESE DIRECTORIES

Exploring your data

NOTE: I'm actively working on these so I will update and fix any bugs (which there are) as they are reported and improve these with some nice pdf reporting in time.

Sentinel provides several different apps to explore your data. MachineView lets you compare specific machine results and provides an overview of your machine results. To use MachineView click the MachineView button. Then select your machine from the drop-down list. You can then toggle Machine Data Overlay to select multiple other machines also. Click Reset Filters to reset the state.

MachineView

PlanView lets you look into plan-class-specific results. You can select a plan type from the drop-down list, or enter in a string in the Enter Filter box and hit ENTER. For example, typing in "Brain" will show you all plan types with "Brain" in the plan name. Click Update Data to update the plots. You can then reset the table by clicking the Reset Filters button.

PlanView

PatientView lets you view individual patient results by entering the patient ID. Clicking individual results in the table will show the expected fluence, the actual fluence, line profiles in x,y, and the Gamma Histogram/ pass-rate.

PatientView

OverView is just that - it provides an overview of the results for particular machines, patients, and plans. Select what you want an overview of with the drop-down lists and click Update Data to update the plots. Click Reset Filters to reset the drop-downs and selected data.

Overview

LiveStream provides a live feed of the results in graphical format as they come in.

LiveStreamScreen

Enjoy and Share

If you enjoy this software and you find it useful please share it and let me know on Reddit or here on Git! I hope you enjoy exploring your machine performance and having realtime peace of mind while Sentinel watches over every patient's treatment.

if you'd like to help with creating a method to get the Elekta iCom files automatically off the linac and onto the clinic network that would solve the Varian only problem and all machines would be covered. If you run into any issues or would like to let me know how the software is working for you. Please send me an email at info@efilmqa.com