forked from imphys/smlm_classification2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster_breakdown.m
49 lines (39 loc) · 978 Bytes
/
cluster_breakdown.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
% The following code will load a result from the
% clustering and show the breakdowns of each
% individual cluster, given the data is labeled.
%%
close all
clear all
clc
% add the required directory to path
addpath(genpath('datafusion2d'))
addpath(genpath('matlab_functions'))
% Main code
%%
possible = ['A', 'S', 'U'];
picks = open('output/ASU_2red_584_labeled_cropped/final.mat').picks;
p = cell2mat(picks);
breakdowns = containers.Map();
for i=unique([p.cluster])
breakdowns(num2str(i)) = containers.Map();
b = breakdowns(num2str(i));
for key=possible
b(key) = 0;
end
end
for i=1:numel(picks)
pick = picks{i};
b = breakdowns(num2str(pick.cluster));
for key=possible
if startsWith(pick.group, key)
b(key) = b(key) + 1;
end
end
end
for i=unique([p.cluster])
fprintf('Cluster %d\n', i);
b = breakdowns(num2str(i));
for key=possible
fprintf('%s: %d\n', key, b(key));
end
end