wrssc / ray_scripts

Python scripts for RayStation treatment planning system
GNU General Public License v3.0
23 stars 4 forks source link

Refactoring code physics review #169

Closed rabayliss closed 1 year ago

rabayliss commented 1 year ago

It is convenient to store RayStation script objects in named tuples. This allows them to be called inline, e.g. rso.case, rso.plan etc. However, when I first started doing this I was using pd and an abbreviation which conflicts with a common abbreviation for pandas. I am renaming instances of "pd" to "rso" (RayStation object to avoid the conflict).

Added goals on Brainstem in the FSRT template.

Final Dose is now being incorporated into the physics review script so that a review is performed prior to running the final checks on the plan. During Final Dose the following tests are now performed: Patient Data: Verification of identical patient information between entered values in RS and those imported from CT including: patient name, sex, dob, patient id Exam Date: Check on exam date to ensure it is within 14 days of approval or current date Image length: Verification that the image is long enough for lateral equilibrium of target dose Couch Type/Length Check: Verification the correct couch type was used for the treatment unit, and that the couch extent is sufficient for the target FOV Blocking: Measures if the reconstruction field of View is overlapping the external on slices that contain target SimFiducials: Checks that the localization point exists, has coordinates, and is the correct type for laser alignment Image Orientation: Checks the image is completely axial (non-axial images cannot be exported to iDMS). Beamset Template: Reports the beamset template used for the current plan Isocenter check: verifies all beams in the beamset have an identical isocenter (multi-iso beamsets cannot be imaged properly in truebeam). 4fraction/5fraction: flags the user if the 4 Gy x 5, or 5 Gy x 4 fractionation is being used for confirmation Slice thickness: Using the plan name, the expected CT slice thickness is analyzed, e.g. FSRT uses 1 mm or less slices, etc. Bolus: any roi named bolus is flagged if it is not "applied" to at least one beam Incline Breast Board: Checks the dose on the No Fly Zone and flags doses likely to result from entrance through forbidden regions Pacemaker check: Checks for dose to pacemaker, checks that pacemaker is in the block list (though we cannot see if it is completely blocked), checks the PRV to ensure it is 10 mm or greater. Finds closest approach of the 2 Gy isodose volume to the PRV Dose Grid check: checks the voxel resolution is sufficient for the kind of plan this is based on the plan name, e.g. 0.15 mm for FSRT/SBRT etc. Beamset complexity: computes modulation complexity score. This is still in development. EDW MU check: Checks that scaling has not caused EDW MU to be < 20 MU and therefore undeliverable Control Point spacing: Ensures CPS for VMAT/3CA is 2 degrees or less Tomo Couch: Ensures the couch has not been shifted more than the lateral range of the TomoCouch Tomo Transfer: verifies that an approved tomo transfer plan exists and is approved

Continued Development on DITTO - Aria/RS plan comparison tool.

FinalDose and PhysicsReview modifications. Specifics of that operation are below:

Test_Plan_Checks.py:

PlanReviewTests.py and ExamTests.py: