2. From AI segmentation to NTCP#
In this tutorial you compute each patient’s risk of grade 2+ xerostomia with the Xerostomia (grade 2+) model. Its four structures are made from AI contours, and it adds one clinical predictor, pre-treatment xerostomia, which you supply in a CSV.
The steps are:
flowchart LR
A[Segment:<br>AI contours] --> B[Model:<br>derive structures] --> C[Model:<br>add clinical predictors] --> D[Model:<br>compute NTCP]
You need:
A cohort folder with one subfolder per patient, each holding the planning CT and dose (DICOM RTDOSE, or a NIfTI/NRRD dose file).
A CSV of each patient’s pre-treatment xerostomia, for example
clinical_predictors_xerostomia.csv.
Segment the cohort#
Follow 1. AI segmentation of a cohort with the same cohort and Model. When the Segment run is done, click Next to go to the Model tab.
Choose how each structure is made#
The Structures table lists the four structures the model needs. Each has two options:
- Derive
Make the structure from the AI contours. For example, Parotids-SCRR is both parotids minus the stem-cell rich region (SCRR). Derive is only offered for structures VALIDATE has a recipe for.
- Use existing
Take the structure from your data, by the name you type. See 3. NTCP from your own structures.
Keep Derive selected for all four:
Add the clinical predictor#
The model also uses pretreatment_toxicity: whether the patient had xerostomia before
treatment, coded 0 for No and 1 for Yes. Put it in a CSV with one row per patient:
ID,pretreatment_toxicity
pt_001,0
pt_002,1
pt_003,0
ID is the patient’s folder name.
The other column names must match the predictor names in the model. Hover over the i next to Predictor values for the rules, or see Predictor values CSV.
Next to Predictor values, click Select CSV and choose your file.
Note
When you start from Data, VALIDATE reads only the clinical predictors from this CSV. It computes the dose metrics (here, the mean dose to each structure) from the images.
Compute the NTCP#
Click Run.
VALIDATE asks to save the settings. Click Save and continue.
VALIDATE then derives the four structures for each patient, computes their mean doses and the NTCP. When it finishes, the progress bar says Done and Export CSV… is enabled:
Get the results#
Click Export CSV… and choose where to save the results. The CSV has one row per patient:
patient_id,ntcp(between 0 and 1),status(okorerror) andmessage(why it failed). See NTCP results CSV.Click View error log to see why any patient failed.
The derived structures are saved in the analysis folder, in each patient’s subfolder, so you can review them.
Next#
To use contours you already have for some structures, see 3. NTCP from your own structures.
The Review tab, which will compare these NTCPs with observed outcomes, is coming soon.