# Structure Repair Recipes

## External contour re-derivation
If the shipped External/BODY contour is incomplete or missing, derive a new
External contour from the CT using:
- Threshold: CT HU > -350
- Connectivity: largest connected component (3D)
- Hole-fill: binary closing with 1-voxel radius
- Output: one closed planar contour per CT slice

## PTV derivation from CTV
See institutional_constraints.md for the margin recipe. Rasterize onto the CT
grid at 3 mm resolution and emit CLOSED_PLANAR contours per slice.

## ROI type corrections
All OARs must have RTROIInterpretedType = "ORGAN" in the RTROIObservationsSequence.
Targets must be "PTV" (or "CTV" for un-expanded targets).
The External body contour must be "EXTERNAL".
