Skip to content
Beta.rtplan@modelscript/dicom-rt 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections SysML v2, NIfTI, DICOM-RT
Live ExampleProstateIMRTPlan.dcm.json

DICOM-RT IMRT Treatment Plan & OAR Dose-Volume Constraints

Radiation oncology treatment plan specifying PTV_7800 target prescription, OAR QUANTEC constraints, and 6 MV photon beams.

Playground
Source (19 lines)
1{
2  "Modality": "RTPLAN",
3  "RTPlanLabel": "PROSTATE_IMRT_78GY",
4  "FractionGroupSequence": [
5    {
6      "FractionGroupNumber": 1,
7      "NumberOfFractionsPlanned": 39,
8      "TargetPrescriptionDoseGy": 78.0
9    }
10  ],
11  "ROIContourSequence": [
12    { "ROINumber": 1, "ROIName": "PTV_7800", "RTROIInterpretedType": "PTV", "VolumeCc": 94.2 },
13    { "ROINumber": 2, "ROIName": "Rectum",   "RTROIInterpretedType": "ORGAN", "VolumeCc": 68.5 },
14    { "ROINumber": 3, "ROIName": "Bladder",  "RTROIInterpretedType": "ORGAN", "VolumeCc": 182.0 }
15  ],
16  "BeamSequence": [
17    { "BeamNumber": 1, "BeamName": "LAO_45", "RadiationType": "PHOTON", "BeamEnergyMeV": 6.0, "GantryAngleDeg": 45.0, "BeamMetersetMU": 142.5 }
18  ]
19}
DICOM-RT Beam Geometry & DVH Verification
PDD * OAR dose DVH evaluation «6 mv photon imrt» LAO_45 Beam «parameters» Gantry = 45.0 deg Meterset = 142.5 MU «prescription 78 gy» PTV_7800 Target «model» 39 fractions (2 Gy/fx) Vol = 94.2 cc «quantec qa» OAR DVH & Gamma «verification» Rectum & Bladder 3%/3mm Pass = 99.4%
Drag to pan · Click % to reset

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 ​

ExtensionFormatDescription
.rtplanDICOM RT PlanExternal-beam photon/electron/proton beam geometry, gantry/couch/collimator angles, MLC control points, and fraction groups
.rtstructDICOM RT Structure Set3D anatomical contours for Planning Target Volumes (PTV, CTV, GTV) and Organs at Risk (OAR)
.rtdoseDICOM RT Dose3D dose grid arrays and cumulative/differential Dose-Volume Histogram (DVH) curves

Key Capabilities ​

1. Cumulative DVH, ICRU 83 Homogeneity & Paddick Conformity ​

  • Evaluates D98%, D95%, D50%, D2%, Dmean, and VxGy across Target and OAR structures:HIICRU 83=D2%−D98%D50%,CIPaddick=(TVPIV)2TV×PIV

2. Linear-Quadratic Biological Dose (BED & EQD2) ​

  • Computes Biologically Effective Dose and Equivalent Dose in 2 Gy fractions for tumor targets (α/β≈10 Gy) and late-responding normal tissues (α/β≈2–3 Gy):BED=nd(1+dα/β),EQD2=BED1+2α/β

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

CodeRuleSeverityMessage
M9201dicom-rt-missing-target-volumeerrorTreatment plan '<planLabel>' contains no clinical target volume ROI ('PTV', 'CTV', or 'GTV').
M9202dicom-rt-mlc-leaf-overlaperrorMLC 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').
M9203dicom-rt-mlc-speed-exceedederrorMLC leaf pair '<pairIndex>' on beam '<beamName>' between control points '<cpFrom>' and '<cpTo>' travels at '<value> mm/s', exceeding physical motor limit '<value> mm/s'.
M9204dicom-rt-gantry-couch-collisionerrorGantry angle '<gantryDeg> deg' and non-coplanar couch angle '<couchDeg> deg' on beam '<beamName>' control point '<cpIndex>' enter the gantry-couch collision hazard zone.
M9205dicom-rt-oar-dose-constraint-violatederrorOrgan-at-Risk '<roiName>' <metricKind> dose '<value> Gy' exceeds QUANTEC clinical constraint '<value> Gy'.
M9206dicom-rt-non-monotonic-cum-meterseterrorControl point cumulativeMetersetWeight sequence on beam '<beamName>' is invalid: <detail>.
M9207dicom-rt-unclosed-roi-contourerrorCLOSED_PLANAR contour slice at z='<zSlice> mm' in ROI '<roiName>' has '<vertexCount>' vertices (minimum 3 required).
M9208dicom-rt-unresolved-frame-of-referenceerror<modalitySource> FrameOfReferenceUID '<sourceUid>' does not match plan FrameOfReferenceUID '<planUid>'.
M9209dicom-rt-invalid-beam-meterseterrorTREATMENT beam '<beamName>' has invalid delivery parameters (metersetMu='<metersetMu>', energyMeV='<energyMeV>'); both must be > 0.
M9210dicom-rt-ptv-underdosagewarningTarget 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

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Pricing • Trademark Policy