-
Notifications
You must be signed in to change notification settings - Fork 3
/
spkplt2.hoc
51 lines (44 loc) · 1.29 KB
/
spkplt2.hoc
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
// spkplt2.hoc modified from spkplt.hoc from Traub et al. 2005 NEURON model
// Tom Morse
load_file("nrngui.hoc")
objref grspk
// set sizes so can run without main program
proc setVars() {
numSTN=10
numGPe=30
numGPi=10
}
// pass the below the data file name as a string as the first argument
// and the graph object as the second argument
proc spkplt2() {local i, color localobj x1, y1, x2, y2, x3, y3
clipboard_retrieve($s1)
printf("read %d spikes\n", hoc_obj_[1].size)
x1= new Vector()
y1= new Vector()
x2= new Vector()
y2= new Vector()
x3= new Vector()
y3= new Vector()
color=1
for i=0, hoc_obj_[1].size()-1 {
if ((hoc_obj_[0].x[i] >= numGPi) && (hoc_obj_[0].x[i] < numGPi+numGPe)) {
x2.append(hoc_obj_[1].x[i])
y2.append(hoc_obj_[0].x[i])
} else if (hoc_obj_[0].x[i] >= numGPi+numGPe) {
x3.append(hoc_obj_[1].x[i])
y3.append(hoc_obj_[0].x[i])
} else {
x1.append(hoc_obj_[1].x[i])
y1.append(hoc_obj_[0].x[i])
}
}
$o2.size(x1.min, x3.max, y1.min, y3.max)
y1.mark($o2, x1, "|", 5, 3, 4)
y2.mark($o2, x2, "|", 5, 4, 4)
y3.mark($o2, x3, "|", 5, 2, 4)
}
// sample use : spkplt2("../p2c/data/out.dat")
// use if want to run without main program (just use data files): setVars()
// normal use
// grspk = new Graph()
// spkplt2("spikes000.txt", grspk)