-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimeHistPlot.m
More file actions
65 lines (45 loc) · 1.88 KB
/
timeHistPlot.m
File metadata and controls
65 lines (45 loc) · 1.88 KB
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
classdef timeHistPlot < daughterPlot
properties
end
methods
function TP = timeHistPlot(HS)
TP = TP@daughterPlot(HS);
TP.windowPosition = [633 338 390 304];
set(TP.windowHandle,'Position',TP.windowPosition);
TP.doPlot();
figure(TP.handSorter.mainFig.handle);
end
function doPlot(TP)
histBins = [0:.002:.100];
binsVec = [histBins ; histBins];
binsVec(1) = []; binsVec(end) = [];
figure(TP.windowHandle);
cla;
clusterList = unique(TP.handSorter.data.spikeClusters);
for clustNn = length(clusterList):-1:1
clustN = clusterList(clustNn);
ix = find(TP.handSorter.data.spikeClusters == clustN);
samples = TP.handSorter.data.spikeSamples(ix);
sortedSamples = sort(samples,'ascend');
ISI = diff(sortedSamples)./TP.handSorter.data.sampleRate;
N = hist(ISI, histBins);
nVec = [N;N]; nVec(end-1:end) = [];
plot(binsVec(:),nVec(:),'Color', TP.handSorter.colorList(clustN,:)); hold on;
end
xlim([0 histBins(end)]);
end
function convertSpike(TP, caller, event)
refreshData(TP, caller, event);
end
function addSpike(TP, caller, event)
refreshData(TP, caller, event);
end
function removeSpike(TP, caller, event)
refreshData(TP, caller, event);
end
function refreshData(TP, caller, event)
TP.doPlot();
figure(TP.handSorter.mainFig.handle);
end
end
end