Once you have performed the inference and saved the network predicted masks in NIFTI format (as described in inference.md), you can proceed with the generation of lesion measures from test set predicted and ground truth lesions masks. We compute six different patient level lesion measures: patient-level lesion SUVmean, lesion SUVmax, number of lesions, total metabolic tumor volume (TMTV) in ml, total lesion glycolysis (TLG) in ml, and lesion dissemination (Dmax) in cm. These metrics have been defined in metrics/metrics.py and have been shown to be prognostic biomarkers in lymphoma.
lymphoma_seg
) and navigate to segmentation
folderFirst, activate the conda environment lymphoma_seg
using (created as described in conda_env.md):
conda activate lymphoma_seg
cd segmentation
After this, run the following script in your terminal,
python generate_lesion_measures.py --fold=0 --network-name='unet' --input-patch-size=192
Alternatively, modify the segmentation/generate_lesion_measures.sh for your use-case (which contains the same bash script as above) and run:
bash generate_lesion_measures.sh
The ground truth and predicted lesion measures on the test set will be written to LYMPHOMA_SEGMENTATION_FOLDER/results/test_lesion_measures/fold{fold}/{network_name}/{experiment_code}/testlesionmeasures.csv
, as described in results_format.md file. The relevant directory structure may then look like:
└───lymphoma.segmentation/
├── data
└── results
├── logs
├── models
├── predictions
└── test_metrics
└── test_lesion_measures
├── fold0
│ └── unet
│ └── unet_fold0_randcrop192
│ └── testlesionmeasures.csv
└── fold1
└── unet
└── unet_fold1_randcrop192
└── testlesionmeasures.csv