DICOM-Based SSD Calculation Scripts (With & Without Couch Rotation)
This bundle includes two Python scripts for calculating Source-to-Skin Distance (SSD) directly from DICOM RT Plan and RT Structure Set files β no CT images required.
Both scripts use ray tracing to project the beam path from the source (isocenter + SAD) and compute SSD by finding the intersection with the external ROI contour in RTSTRUCT.
π¦ Included Scripts:
1οΈβ£ CalcSSD_DICOM_v6_NoCouch.py
- Basic SSD calculation using gantry angle only
- Assumes couch angle = 0Β°
- Simple and fast β great for quick QA checks or educational use
2οΈβ£ CalcSSD_DICOM_v8_WithCouch.py
- Advanced SSD calculation with couch rotation correction
- Uses rotation matrix to adjust beam vector for true incidence angle
- Matches TPS SSD values within ~1 mm, even for rotated setups
β Highlights:
- β No CT image stack needed
- β Fully DICOM-based (only RTPLAN + RTSTRUCT required)
- β Clean, dependency-light code (no rt-utils or external libraries)
- β Ideal for QA checks, TPS validation, and training demos