-
Notifications
You must be signed in to change notification settings - Fork 19
/
sc_parse_custerselection.m
99 lines (60 loc) · 3.09 KB
/
sc_parse_custerselection.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
function features=parse_custerselection(features,x,y,mua,s_opt)
selected_cluster=0;
action=0;
features.last_op_was_from_any=0;
if (x>-1) && (y> 1)
for i=1:features.Nclusters
features.editedcluster=i;
if (x>-1 +((i-1)*0.2)) && (x<-1 +((i-0)*0.2))
% disp(['hit ',num2str(i)])
if y>1.1
if ((x-((i-1)*0.2))+y) >.3; % toggle visibility
features.clustervisible(i)=1-features.clustervisible(i);
else
%disp('select');
% plot ISI and some extra options for this cluster
%plot_cluster_info(features,i);
features.selected=i;
end;
else
% disp('act');
if x < ( (-1 +((i-1)*0.2)) +(-1 +((i-0)*0.2)) )/2
if y > 1.05 % +
text(-1+(0.2*(i-1)) +.04 ,1.08,'+','color',[1 0 0]);
features.editedcluster=i;
features=sc_add_to_cluster(features,i,s_opt);
else
% disp('++');
text(-1+(0.2*(i-1)) +.04 ,1.02,'++','color',[1 0 0]);
features.last_op_was_from_any=1; % need to update ALL clusterimages now
features.editedcluster=i;
features=sc_add_to_cluster_from_any(features,i,s_opt);
end;
else
if y > 1.05 % *
text(-1+(0.2*(i-1)) +.14 ,1.06,'*','color',[1 0 0]);
features.editedcluster=i;
features=sc_intersect_cluster(features,i,s_opt);
else
% disp('-');
text(-1+(0.2*(i-1)) +.14 ,1.02,'-','color',[1 0 0]);
features.editedcluster=i;
features=sc_remove_from_cluster(features,i,s_opt);
end;
end;
end;
end;
end;
if (x>-1 +((i)*0.2)) && (x<-1 +((i+1)*0.2))
disp('ADD');
features.Nclusters=features.Nclusters+1;
plot([0 0.15]-1+(0.2*(i)) +.02,[1 1].*1.1,'k','LineWidth',15,'color',.70.*[1 1 1]);
plot([0.075 0.075]-1+(0.2*(i)) +.02,[0 0.15]+1.02,'k','LineWidth',15,'color',.70.*[1 1 1]);
text(-1+(0.2*(i)) +.1,1.04,'+new','color',[1 0 0])
drawnow;
features.editedcluster=i+1;
features=sc_add_to_cluster(features,features.Nclusters,s_opt);
% features=updateclusterimages(features,mua);
end;
features=sc_updateclusterimages(features,mua,s_opt);
end;