Compute Dice score, Hausdorff distance for Multi-Region segmentation

71 views
Skip to first unread message

Joy S

unread,
Apr 18, 2022, 8:51:10 PM4/18/22
to Plastimatch

Hi,

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


CENTER_OF_MASS
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


Thanks a lot in advance!

JS

Tim Birtwhistle

unread,
Apr 25, 2022, 7:04:18 AM4/25/22
to Plastimatch
Hi,

I think a good option would be to use plastimatch convert and the "output prefix" option to  create a directory with a separate image for each structure:

plastimatch convert --input-ss-img segmentation.nii  --input-ss-list list.txt --output-prefix output_folder

You would need the list.txt to contain the names of the structures in this type of format:

0|255 0 255|bladder
1|255 127 0|rectum
2|135 206 235|r_fem_head

(the colour codes aren't relevant to this situation)

You could do this for the manual and auto-segmentations and then compare each structure one by one

plastimatch dice --dice  ~/example1/manual/bladder.mha  ~/example1/auto/bladder.mha

You would need to make some sort of script to automate this for your list of examples.

cheers,
TIm
Reply all
Reply to author
Forward
0 new messages