-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeakHeightPlot.m
More file actions
62 lines (43 loc) · 1.75 KB
/
peakHeightPlot.m
File metadata and controls
62 lines (43 loc) · 1.75 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
classdef peakHeightPlot < daughterPlot
properties
end
methods
function TP = peakHeightPlot(HS)
TP = TP@daughterPlot(HS);
TP.windowPosition = [633 5 390 304];
set(TP.windowHandle,'Position',TP.windowPosition);
TP.doPlot();
figure(TP.handSorter.mainFig.handle);
end
function doPlot(TP)
figure(TP.windowHandle);
cla;
clusterList = unique(TP.handSorter.data.spikeClusters);
for clustNn = 1:length(clusterList)
clustN = clusterList(clustNn);
ix = find(TP.handSorter.data.spikeClusters == clustN);
peakSamples = TP.handSorter.data.spikeSamples(ix);
peakHeights = TP.handSorter.data.dVdT(peakSamples);
[N,xout] = hist(peakHeights,20);
binsVec = [xout ; xout];
binsVec(1) = []; binsVec(end) = [];
nVec = [N;N]; nVec(end-1:end) = [];
plot(-binsVec, nVec,'Color',TP.handSorter.colorList(clustN,:)); hold on;
end
axis tight;
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