esimiele / vmat-tbi Goto Github PK
View Code? Open in Web Editor NEWESAPI code used for VMAT TBI autoplanning
License: MIT License
ESAPI code used for VMAT TBI autoplanning
License: MIT License
Logic for detecting couch needs to be broader to include other clinics' default couch structure names
My facility is having issues with the original logic for isocenter placement with some of our longer patients. We're treating up to 6'6" patients in vacloc bags.
A request has been made to create all VMAT plans using the following logic:
$Z_{sup}, Z_{inf} =$ topmost head and bottommost foot slice
$Iso_{head} = Z_{sup} - 19 \text{ cm}$
$Iso_{foot} = Z_{inf} - 19 \text{ cm}$ Find Iso spacing:
$Iso_{\Delta} = \frac{Iso_{head} - Iso_{foot}}{n_{iso} - 1}$
If$Iso_{\Delta} > 35 \text{ cm}$ then show user warning message1Define each remaining iso based on iso spacing
$Iso_{chest} = Iso_{head} - Iso_{\Delta}$
$Iso_{pelvis} = Iso_{head} - 2 \times Iso_{\Delta}$
$Iso_{Upper Legs} = Iso_{head} - 3 \times Iso_{\Delta}$ If there are 6 iso's
$Iso_{Lower Legs} = Iso_{head} - 4 \times Iso_{\Delta}$
This logic would eliminate the need for match lines. A further extension of this would be to allow a user to add a field to an iso after a plan calc that would then reorder the arcs or reverse their directions accordingly
Stretch goal, allow error box message to let user add iso directly โฉ
In the configuration file the variable MLC model actually corresponds to the machine's MLC ID. As such this will be unique per machine.
To support multiple Linacs how does one specify different MLC's for different machines with your GUI and config file?
Will debug further as time allows
When trying to calculate in V15.6 with Acuros the exe crashes instead of failing gracefully or handling error notifications.
I am trying my first case (not sample patient) and got a few times the same error from the executable:
The process cannot access the log file (patientID.txt) because it is being used by another process.
That last time it started the optimization at 6:15am, after 3rd iterations it was able to write to the log file at 10:03am, then it complains that the file is not accessible at sometime before 10:20am. Pretty sure no one is touching the log file.
The only thing I can think of is maybe it's expecting to access the file in some milliseconds but did not get response quick enough? My files are in a network drive with a bit long path. Thanks.
There should be a configuration option to turn off this notice, since not every clinic will have a spinning manny or similar.
I'll probably push a PR request on this one in the near future.
Increase information displayed in progress bar, i.e. the current optimization MR and optimization loop number along with the current percent. This is to change the information on the display more often to hopefully let the program look more alive. Combating auto timeout from idle features like Citrix.
Upon review the first request from my physicists when planning was to allow for VMAT leg fields for potential additional planning techniques and exploring TMI.
The INI file doesn't match any convention I recognise and is quite hard to read. There are better config handlers that do the parsing and loading for free. Here is an example TOML config file that I would be happy to do the work converting to, but I wanted to run the ideology by you first.
title = "VMAT TBI configuration file"
EAS = 2021-06-11 #date only
Site = "Saskatoon Cancer Center"
Organization = "Saskatchewan Cancer Agency"
#Paths are single quote'
Document_Path = '\\enterprise.stanfordmed.org\depts\RadiationTherapy\Public\Users\ESimiele\Research\VMAT_TBI\documentation\'
Linacs = ["LA16", "LA17"]
Energies = ["06X", "10X"]
[Plug-in]
flash.default_flash_type = "Global"
flash.default_flash_margin = 0.5
flash.default_target_margin = 0.3
calc.calculation_model = "AAA_15605"
calc.optimization_model = "PO_15605"
default_isos = 5
#Default beams per iso from sup to inf, must have same or more entries then default isos
default_beams_per_iso = [4, 3, 2, 2, 2, 0, 0]
contour.field_overlap = true
contour.field_overlap_margin = 1.0
Default_Sparing_Structures = [
["Lungs", "Mean Dose < Rx Dose", 0.3] ,
["Kidneys", "Mean Dose < Rx Dose", 0.0],
["Bowel", "Dmax ~ RX Dose", 0]
#format ["name", "type", margin]
]
[Cases]
[Cases.Scleroderma]
dose_per_fraction = 200
number_of_fractions = 4
constraints = [ #format ["Name", "type", dose, volume, priority]
["TS_PTV_VMAT", "Lower", 800.0, 100.0, 100]
#continued in same format
]
[Cases.Myeloablative]
dose_per_fraction = 200
number_of_fractions = 6
constraints = [[]]
[Cases.Non_Myeloablative]
dose_per_fraction = 200
number_of_fractions = 6
constraints = [[]]
sparing_structures = [
[ "Ovaries","Mean Dose < Rx Dose",1.5 ]
]
Please assign me
When prepping final plans for treatment, the VMAT leg fields should automatically have their collimators rotated and control points adjusted accordingly.
I'm experiencing an issue with the stand alone scripts. When I start it in Visual Studio, the following message pops up:
VMS.TPS.Common.Model.TpsNetInitializationException: The application Eclipse Client is running an incorrect version (16.1.3). The system is configured to run version 16.1.4 of this application family. It is not possible to start older versions of the application. Please contact Varian Customer Support to have this issue resolved. The application will now exit.
at VMS.TPS.Common.Model.ApplicationInitGuard.End()
at VMS.TPS.Common.Model.ApplicationInitGuard.InitializeApplicationImpl(Delegate initDelegate, Object[] args)
at VMS.TPS.Common.Model.ApplicationNonAppFrame.Initialize(IStartupParameters startupParameters, IApplicationContextInfo applicationContextInfo)
at VMS.TPS.Common.Model.API.Application.CreateApplicationCommon(String scriptName, Func`2 createExecutionGuardFunc)
Any suggestion will be appreciated.
Thank you.
Thinking about broader use cases, it would be nice if the course name generated could be set in the config file.
Ideally one could select the course in the application from any course in the patient, but I don't see that as an easy feature and I'd rather have this as a happy medium.
I wonder what is your dynamic ioptimization strategy. I see the lower objective priority is less than upper objective priority. And in the process I see the hot spot always around 120%.
I am using async in my tbi program as you do. But it always reported an errror: Atomic access violation. Do you know how I can figure this out? Once I cancelled the async and gave up outputting message in the block, it worked without reporting this problem.
For multi-site deployment it would be great if the file paths could be moved to a configuration file.
I'm not sure if it makes sense to use the existing configuration file or to create a second one that won't show up when the user goes to view the configuration window.
We would like to see a new option where the legs could also be set to VMAT when needed. This is a change as part of bringing this tool clinical and we will be returning the change back upstream. I'd be happy to discuss any impacts here!
Line reference for sanity
In the Beta branch with the modification allowing for any course, if a user has two courses created from the script the wrong plan from the wrong course may be chosen by the loop for continued optimization
suggest a dropdown selecting the appropriate course
There should be a configuration option to turn off this behaviour for clinics that have differing clinical practices
I'll probably push a PR request on this one in the near future.
Hi there,
Sorry to bug you again. I've got everything working well with the code until the final step of removing the flash and recalculating/renormalizing. As you can see in the attached screenshot, I get a series of errors for each Beam during this process. It seems that during this final dose calculation the code is trying to use the GPU, even though the config file is set to "No" for using the GPU for dose calculation and optimization.
After I close the error window, the code finishes (see attached text file), but when I then open the patient in Eclipse, no dose is calculated.
Any ideas to solve this are much appreciated! Thank you.
Finished_after error.txt
After pressing the "Place Beams" button, I get an Eclipse error message that states [There was a problem while executing the script 'VMATTBIautoPlan_v2.1.esapi.dll' Dose units do not match to the system setting.]
I included a screen shot and the Details of the error below.
Is this because our doses in Eclipse are specified in Gy instead of cGy? Any idea how to solve this issue?
Many thanks!
First off, thank you for sharing these scripts. They are truly impressive!
After running the script, I noticed that the dose is not calculated on the AP/PA plans. I'm not sure if this is the intended function? I couldn't find much on this in the documentation.
The VMAT plan looks great, but when I calculate the AP/PA dose, those junctions are not very smooth. Is this normal? Perhaps this is just the junction geometry of static beams, but thought I would ask.
I read your PPT presentation "VMAT TBI: Stanford Experience" by Nataliya in 2021 saying that "Dose rate at 100-200 MU/min for Head/Chest iso to keep average dose rate <20 cGy/min for lungs", but it looks like your script beam placement set all dose rate to 600 MU/min? That not only does not keep the dose rate to lung <20Gy/min, but also totally change how the optimizer works.
What is your current practice for the dose rate for the VMAT plan? You keep low dose rate for only the lung beams, or all the VMAT beams? thanks.
When selecting All VMAT and changing the energy to something other than the first dropdown entry, the leg fields are not generated with the same energy as the body fields.
Could you teach me how to change dose unit of script from cGy to Gy please.
This line needs to compare to course name from config file.
Sometimes in the first step it would report an error that len stucture is high resolution and reported like below:
In the last step of optimization, it will report:
If we don't click on ok, it will not proceed which decrease efficiency.
So why it would report this warning? Could you fix to automatically proceed so that we could throw it away and do other things? Another suggestion is that provding a save button in the UI that we can save and exit otherwise we ended up getting nothing. Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.