HOW TO CALCULATED THE DICE SIMILARITY
8 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I want to calculate the Dice Similarity Coefficient between the origional images and binary images.
this below is origional images.
%% first, read the origional images
clc
clear all
dataSetDir = fullfile('C:\Users\Akmal\Desktop\I-131 256 28.02.2020\I-131 SPECT NEMA VALIDATION 01112019 256X256 26.09.2021 petang');
imageDir = fullfile(dataSetDir,'Image');
imds = imageDatastore(imageDir);
% view data set images origional
figure
for i = 1:23
subplot(5,5,i)
I = readimage(imds,i);
imshow(I)
title('training labels')
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/772793/image.jpeg)
this code below is binary images after segmentation
%% second, read the binary images after segmentation
dataSetDir1 = fullfile('C:\Users\Akmal\Desktop\I-131 256 28.02.2020\I-131 SPECT NEMA VALIDATION 01112019 256X256 26.09.2021 petang');
imageDir1 = fullfile(dataSetDir1,'bnwaftersegmentation');
imds1 = imageDatastore(imageDir1);
% view data set images origional
figure
for ii = 1:23
subplot(5,5,ii)
II = readimage(imds1,ii);
imshow(II)
title('binary labels')
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/772798/image.jpeg)
then i run this code for calculate the dice similarity, but got error
similarity = dice(I, II);
Error using dice (line 117)
Expected input number 1, A, to be one of these types:
logical, double, categorical
Instead its type was uint8.
ANYONE CAN HELP ME??
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!