-
Notifications
You must be signed in to change notification settings - Fork 1
/
weight_movie.hoc
107 lines (101 loc) · 2.43 KB
/
weight_movie.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
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
96
97
98
99
100
101
102
103
104
105
106
107
// movie for the mitral and granule synapse weights associated with
// the mitral or granule cell gid
create w_movie_section
w_movie_section {delete_section()}
objref keepsyn, movie_ncl, w_grph_, w_grph_handle_, w_box_
{load_file("pattern.hoc")}
w_clear_ignore = 0
proc clear_weight_movie() {
if (w_clear_ignore) { return }
objref w_box_, w_grph_handle_, w_grph_, movie_ncl, keepsyn
if (section_exists("w_movie_section")) {
w_movie_section { delete_section() }
}
}
proc synonly() {local i localobj mg, syn, nc, nil
clear_weight_movie()
create w_movie_section
w_movie_section { insert pas g_pas = 1e9 e_pas = -65 }
keepsyn = new List()
movie_ncl = new List()
if (argtype(1) == 0) {
for i=0, mgrs_list.count-1 {
mg = mgrs_list.object(i)
if ($1 == -1 || mg.mitral_gid == $1 || mg.granule_gid == $1) {
w_movie_section mg.fi.loc(.5)
keepsyn.append(mg.fi)
w_movie_section mg.ampanmda.loc(.5)
keepsyn.append(mg.ampanmda)
}
}
}else{ // synsel list
for i=0, $o1.count-1 {
mg = $o1.object(i)
w_movie_section mg.fi.loc(.5)
keepsyn.append(mg.fi)
w_movie_section mg.ampanmda.loc(.5)
keepsyn.append(mg.ampanmda)
}
$o1.remove_all()
}
mg = nil
w_clear_ignore = 1
clear()
w_clear_ignore = 0
for i=0, keepsyn.count-1 {
syn = keepsyn.object(i)
nc = pc.gid_connect(syn.srcgid, syn)
nc.weight[0] = 1
nc.delay = 1
movie_ncl.append(nc)
}
}
proc weight_movie() {localobj s
synonly($1)
w_box_ = new VBox()
w_box_.intercept(1)
w_grph_ = new Graph()
w_grph_handle_ = new FInitializeHandler("cvode.event(0, \"show_weight()\")")
s = new String()
if ($1 < nmitral) {
w_use_x = 1
sprint(s.s, "Synapses associated with Mitral gid %d\n", $1)
}else{
w_use_x = 0
sprint(s.s, "Synapses associated with Granule gid %d\n", $1)
}
w_grph_.size(0, w_use_x*len + (1 - w_use_x)*(nmitral-1), 0, 1)
w_box_.intercept(0)
w_box_.map(s.s, 400, 250, 700, 250)
stdinit()
}
proc show_weight() {local i, x, w localobj g
g = w_grph_
g.erase()
for i=0, movie_ncl.count-1 {
if (w_use_x) {
x = keepsyn.object(i).x
}else{
x = keepsyn.object(i).mgid
}
w = movie_ncl.object(i).weight[2]
if (i%2) {
g.mark(x, w, "S", 8, 2, 1)
}else{
g.mark(x, w, "s", 10, 3, 2)
}
}
cvode.event(t+100, "show_weight()")
}
{load_file("allsynhinton.hoc")}
proc allsyn() {
synonly(-1)
w_box_ = new AllSynHinton(movie_ncl)
stdinit()
}
{load_file("somesyn.hoc")}
proc somesyn() {
synonly($o1)
w_box_ = new SomeSyn(movie_ncl)
stdinit()
}