Compute Dice score, Hausdorff distance for Multi-Region segmentation

I have NIFTI files of sizes (512 x 512 x 150) of auto-segmentation and manual segmentation. Each file/slice contains the segmentation of multiple regions (seven regions). I want to compute the dice score, Hausdorff distance, Jaccard index, and average surface distance.
Could you please suggest the easiest method for that purpose? I don’t want to convert NIFTI to PNGs/JPEGs. I tried the plastimatch dice. It seems that it doesn’t work for multi-region segmentation. Please find the command and relevant output of plastimatch. Please suggest if I am missing anything or if there is a better approach.

plastimatch dice --all manual_GT.nii Auto_seg.nii
ref 15.9689 -56.3064 -32.7915
cmp 16.4171 -56.3639 -35.121
TP: 194139
TN: 40941820
FN: 10594
FP: 10055
DICE: 0.949504
SE: 0.948255
SP: 0.999754
Hausdorff distance = 12.750913
Avg average Hausdorff distance = 0.131478
Max average Hausdorff distance = 0.160547
Percent (0.95) Hausdorff distance = 0.634766
Hausdorff distance (boundary) = 27.516542
Avg average Hausdorff distance (boundary) = 1.705389
Max average Hausdorff distance (boundary) = 1.814141
Percent (0.95) Hausdorff distance (boundary) = 5.156286

The Segment Comparison module in the SlicerRT extension allows you to compute Dice and Hausdorff on segmentations containing multiple labels. You’ll need to first convert the labelmap volumes to segmentation nodes (in Segmentations module Import/Export section, or in the Data module by right-clicking the labelmap volume).

@cpinter Thanks a lot! It worked. I love Slicer! Btw, some features can be improved and can be made more interactive by incorporating some sort of automation. For example, the “Segment Comparison” tool should have the Box/tick option for all segments rather than the drop-down menu.

1 Like