Sorting fuzzy c means output

1 visualizzazione (ultimi 30 giorni)
Madalena Silva Ramos Simões
Hi! I am having trouble sorting out the output of my clustering. I use fuzzy c means (SFCM2D available from Matlab) and each time I compute it, the output is always different. I mean, cluster 1 in a certain image is different from cluster 1 in a different image (different slices of the same medical exam that is). I was wondering how I could sort them so as to always display from the less bright to the brightest. Here is my code so far:
%% Select slice and segment
ncluster = 2;
expo = 2;
max_iter = 50;
%%
List = dir(fullfile(fn, '*.dcm*'));
for f=1:numel(List)
images = dicomread(fullfile(fn, List(f).name));
[MF,Cent] = SFCM2D(images,ncluster);
for i = 1:ncluster
% Reshape, convert to binary and sort the clusters by mean value
imgfi = reshape(MF(i,:,:),size(images, 1),size(images, 2));
imgfi = convert2binary(imgfi);
mean_values = mean(imgfi, 'all');
X = sprintf ("The mean value for cluster %d is %d", i, mean_values);
disp(X)
mean_vector(i) = mean_values;
[val1, idx1] = max(mean_vector);
[val2, idx2] = min(mean_vector);
end
end
I feel like I'm almost there but I'm not able to associate a value of mean to an image output for a cluster. If any of you have any idea how to fix this I would appreciate it :)

Risposte (0)

Categorie

Scopri di più su Data Clustering in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by