DICOM-RT Radiation Oncology & Clinical Dosimetry (.rtplan, .rtstruct, .rtdose)
@modelscript/dicom-rt (languages/dicom-rt) provides native WebAssembly parsing, QUANTEC Organ-at-Risk (OAR) dose constraint and Multi-Leaf Collimator (MLC) leaf/gantry kinematics verification, cumulative and differential Dose-Volume Histogram (DVH) integration, Linear-Quadratic BED / EQD2 biological dose calculation, DAEBuilder lowering, and OpenSCAD / SysML v2 projections for DICOM Radiotherapy (RTPLAN, RTSTRUCT, RTDOSE) treatment plans.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.rtplan | DICOM RT Plan | External-beam photon/electron/proton beam geometry, gantry/couch/collimator angles, MLC control points, and fraction groups |
.rtstruct | DICOM RT Structure Set | 3D anatomical contours for Planning Target Volumes (PTV, CTV, GTV) and Organs at Risk (OAR) |
.rtdose | DICOM RT Dose | 3D dose grid arrays and cumulative/differential Dose-Volume Histogram (DVH) curves |
Key Capabilities
1. Cumulative DVH, ICRU 83 Homogeneity & Paddick Conformity
- Evaluates
, , , , , and across Target and OAR structures:
2. Linear-Quadratic Biological Dose ( & )
- Computes Biologically Effective Dose and Equivalent Dose in
fractions for tumor targets ( ) and late-responding normal tissues ( ):
3. QUANTEC Safety Verification & OpenSCAD / SysML v2 Projections
- Checks spinal cord, brainstem, optic chiasm, parotid, lung, heart, rectum, and bladder doses against clinical QUANTEC limits, verifies MLC leaf bank non-interdigitation/overtravel, and projects beam apertures to OpenSCAD (
dicomRtToScad) and SysML v2 (dicomRtToSysML2).
Pre-Flight Diagnostics
10 rules9 error1 warning
| Code | Rule | Severity | Message |
|---|---|---|---|
M9201 | dicom-rt-missing-target-volume | error | Treatment plan '<planLabel>' contains no clinical target volume ROI ('PTV', 'CTV', or 'GTV'). |
M9202 | dicom-rt-mlc-leaf-overlap | error | MLC leaf pair '<pairIndex>' on beam '<beamName>' control point '<cpIndex>' has bankA='<bankA> mm', bankB='<bankB> mm' (gap '<value> mm' < minimum '<MIN_MLC_LEAF_GAP_MM> mm'). |
M9203 | dicom-rt-mlc-speed-exceeded | error | MLC leaf pair '<pairIndex>' on beam '<beamName>' between control points '<cpFrom>' and '<cpTo>' travels at '<value> mm/s', exceeding physical motor limit '<value> mm/s'. |
M9204 | dicom-rt-gantry-couch-collision | error | Gantry angle '<gantryDeg> deg' and non-coplanar couch angle '<couchDeg> deg' on beam '<beamName>' control point '<cpIndex>' enter the gantry-couch collision hazard zone. |
M9205 | dicom-rt-oar-dose-constraint-violated | error | Organ-at-Risk '<roiName>' <metricKind> dose '<value> Gy' exceeds QUANTEC clinical constraint '<value> Gy'. |
M9206 | dicom-rt-non-monotonic-cum-meterset | error | Control point cumulativeMetersetWeight sequence on beam '<beamName>' is invalid: <detail>. |
M9207 | dicom-rt-unclosed-roi-contour | error | CLOSED_PLANAR contour slice at z='<zSlice> mm' in ROI '<roiName>' has '<vertexCount>' vertices (minimum 3 required). |
M9208 | dicom-rt-unresolved-frame-of-reference | error | <modalitySource> FrameOfReferenceUID '<sourceUid>' does not match plan FrameOfReferenceUID '<planUid>'. |
M9209 | dicom-rt-invalid-beam-meterset | error | TREATMENT beam '<beamName>' has invalid delivery parameters (metersetMu='<metersetMu>', energyMeV='<energyMeV>'); both must be > 0. |
M9210 | dicom-rt-ptv-underdosage | warning | Target volume '<roiName>' D95% '<value> Gy' is below 95% of prescribed dose '<value> Gy' (minimum '<value> Gy'). |
Generated from languages/dicom-rt/src/lints/rules.ts. All languages →
CLI Usage
bash
# Inspect RTPLAN prescription, fractions, anatomical structures, and beams
msx dicom-rt inspect ProstateVMAT.rtplan
# Validate QUANTEC OAR dose limits, MLC leaf gaps, and gantry clearance
msx dicom-rt validate ProstateVMAT.rtplan
# Compute DVH metrics (D95, D2, HI, CI) and Linear-Quadratic BED / EQD2
msx dicom-rt dosimetry ProstateVMAT.rtplan
# Project treatment beams and ROI contours to OpenSCAD or SysML v2
msx dicom-rt to-scad ProstateVMAT.rtplan > ProstateVMAT.scad
msx dicom-rt to-sysml ProstateVMAT.rtplan > ProstateVMAT.sysml
