How to calculate Dice Similarity for 3D images
13 views (last 30 days)
mohd akmal masud on 9 Aug 2021
i have 3D image gray scale. The code is below.
info = dicominfo('I-131sphere10nisbah1');
The I binarize it using this code.
seedR = 58; seedC = 76; seedP = 45;
W = graydiffweight(spect, seedC, seedR, seedP , 'GrayDifferenceCutoff', 2134);
thresh = 0.00459;
[BW, D] = imsegfmm(W, seedC, seedR, seedP, thresh);
T = regionprops('table', BW,'Area','Centroid')
Then I used this function to calculate the dice similarity,
similarity = dice(BW, spect);
But the error like below
Error using dice (line 117)
Expected input number 2, B, to be one of these types:
logical, double, categorical
Instead its type was uint16.