ivadomed / MetricsReloaded

A fork of the Project-MONAI/MetricsReloaded repo
Apache License 2.0
3 stars 0 forks source link

make `compute_metrics_reloaded.py` BIDS-compatible #8

Open naga-karthik opened 1 month ago

naga-karthik commented 1 month ago

Currently, I believe the scripts expects predictions and GTs to be in different folders and based on these lines also expects to be the root directory.

But to be able to run within the sct_run_batch script which typically outputs in bids-format, it would be good to have bids-compatibility for this script as well. (essentially globbing through the prediction and label suffixes instead of looking only for nii.gz files

tagging @valosekj

valosekj commented 1 month ago

Currently, I believe the scripts expects predictions and GTs to be in different folders and based on these lines also expects to be the root directory.

Correct! Currently, the script expects two folders: (1) a folder with GTs and (2) a folder with predictions. This allows direct compatibility with nnUNet (and MSD?).

But to be able to run within the sct_run_batch script which typically outputs in bids-format, it would be good to have bids-compatibility for this script as well.

The script can also accept nii files directly (instead of paths to folders). In other words, you can directly specify the abs path to GT and the abs path to the prediction, for example:

python compute_metrics_reloaded.py 
-reference derivatives/labels/sub-01/anat/sub-01_T2w_seg-manual.nii.gz 
-prediction data_processed/sub-01/anat/sub-01_T2w_seg.nii.gz

(essentially globbing through the prediction and label suffixes instead of looking only for nii.gz files

Yes, this is a good idea for future improvement! We could reuse our code.