How to calculate Dice Similarity for 3D images

15 visualizaciones (últimos 30 días)
mohd akmal masud
mohd akmal masud el 9 de Ag. de 2021
Comentada: Image Analyst el 9 de Ag. de 2021
Hi all,
i have 3D image gray scale. The code is below.
[spect map]=dicomread('I-131sphere10nisbah1');
info = dicominfo('I-131sphere10nisbah1');
%gp=info.SliceThickness;
spect=(squeeze(spect));%smooth3
aa=size(spect);aa=aa(3);
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);
figure, imshow3D(BW)
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.

Respuesta aceptada

Image Analyst
Image Analyst el 9 de Ag. de 2021
If it's for 2-D images then you can do your own. It's a pretty simple algorithm, like the overlap (intersection) divided by the union or something similar.
  2 comentarios
mohd akmal masud
mohd akmal masud el 9 de Ag. de 2021
yah that is for 2 D images. But if I adopt into 3D images, I have to do one by one. any ways to calculate the whole 3D images?
Image Analyst
Image Analyst el 9 de Ag. de 2021
Not sure what you mean. Can't you just do something like
unionImage = image1 | image2;
overlapImage = image1 & image2;
diceCoefficient = sum(overlapImage(:)) / sum(unionImage(:));

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by