forked from open-ephys/simpleclust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsc_parse_highlight_wave.m
34 lines (15 loc) · 939 Bytes
/
sc_parse_highlight_wave.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
function features= parse_highlight_wave(x,y,features);
visible= find(ismember(features.clusters, find(features.clustervisible)));
dX=features.data_scaled(features.featureselects(1),visible);
dY=features.data_scaled(features.featureselects(2),visible);
%x=sc_remap(x,-.9, .9, features.zoomrange(features.featureselects(1),1),features.zoomrange(features.featureselects(1),2) );
%y=sc_remap(y,-.9, .9, features.zoomrange(features.featureselects(2),1),features.zoomrange(features.featureselects(2),2) );
[d,selected]=min( sqrt( (dX-x).^2 + (dY-y).^2 ) );
if d< 10
%plot(dX(visible(selected)),dY(visible(selected)),'ro','MarkerSize',10);
features.highlight = visible(selected);
end;
if features.plotgroup %select an extra 10 waveforms from the environment of click
[d,id]=sort( sqrt( (dX-x).^2 + (dY-y).^2 )+ ((rand*2)-1).*0 );
features.highlight_multiple=visible(id(1:10));
end;