Skip to content

Repository files navigation

Intro_to_Raystation

Teaching material introducing Python scripting in the RayStation treatment planning system. A set of small standalone example scripts (each built on RayStation's connect scripting API) plus an accompanying slide deck, Raystation Scripting Slides.pdf. Teaching material from 2020, not maintained.

What the examples cover

  • Load_Patient.py / Change_Patient.py — query PatientDB by MRN (with a fallback to the secondary database when the index service misses) and load the patient, then iterate its cases.
  • Create_ROI.py / Create_External.py — create an ROI and generate an External geometry on an examination.
  • Create_External_Across_patients.py — loop over a list of MRNs, creating an External ROI and its geometry on every examination of every case.
  • Create_Rigid_Registration.py — compute a bone-weighted rigid image registration between the primary exam and every other exam in a case, then copy the primary exam's contoured ROI geometries to the other exams.
  • Copy_Rois_To_Another_Within_Patient.py — copy ROI geometries between examinations within a patient.
  • Export_Patient_List.py — batch DICOM export: read MRNs from a text file and export images plus RT structure sets per examination via ScriptableDicomExport.

Requirements and usage

The scripts must run inside RayStation's scripting environment (they start with from connect import *, RayStation's ScriptClient module) — they will not run as plain Python outside the TPS. Each script is self-contained; MRN lists and export paths are hard-coded placeholders to edit before running.

About

small intro teaching some useful things for raystation along with basic code

Resources

Stars

6 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages