# Computing Dice Similarity Coefficient for a Volume?

38 views (last 30 days)
brittreiche on 17 Sep 2015
Commented: Tangi on 17 May 2022 at 8:53
Hello,
I'm writing a paper outlining a pipeline for a whole-volume brain segmentation technique. I'm validating it against ground truth data using the DSC (among other metrics). The journal requires that the DSC be computed on a volume basis, and not slice-by-slice.
I was just wondering if anyone could elaborate on this? The only feedback that I have received is "add all 2D intersects together" and "divide by the summation of the union of all 2D images".
I'm just not clear on what this means. Thanks in advance!

Hamoon on 17 Sep 2015
If your segmented output image and your reference image are 3 dimensional logical matrices do this:
common = (refSegment & outSegment);
a = sum(common(:));
b = sum(refSegment (:));
c = sum(outSegment(:));
Dice = 2*a/(b+c);
if you have different slices of 2 dimensional matrices, you can make 3 dimensional matrices with them and then do what I said before. If you don't want to do that, you can compute a , b , c for each slice using what I wrote above, and then let A be the sum of all "a" , B be the sum of all "b", and "C" be sum of all "c" for all slices. then dice metric will be:
Dice = 2*A/(B+C);
##### 2 CommentsShowHide 1 older comment
Tangi on 17 May 2022 at 8:53
dice_coef = dice(im1,im2);
*You need to have binary image for that