-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpine.hoc
60 lines (53 loc) · 1.07 KB
/
Spine.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
if (name_declared("pkgversions") != 4 ) { execute("strdef pkgversions") }
sprint(pkgversions,"%sSpine = $Revision: 1.3 $, ",pkgversions)
begintemplate Spine
public head, neck
public loc, addSyn, destroy
objref this
create head
create neck
proc init() {
headL = 0.2
headdiam = 1
neckL = 1
neckdiam = 0.2
create head
create neck
connect head(0), neck(1)
head insert pas
neck insert pas
// Negative arg prevents location
if ($1 >= 0) { this.loc($1) }
// Get properties of spine from parent (which we're accessing)
pRa = Ra
if (ismembrane("g_pas")) {
pg_pas = g_pas
} else {
pg_pas = 10E-5
}
head {
Ra = pRa
g_pas = pg_pas
diam = headdiam
L = headL
}
neck {
Ra = pRa
g_pas = pg_pas
diam = neckdiam
L = neckL
}
}
proc loc() {
connect neck(0), $1
}
proc addSyn() {
head $o1.loc(1)
}
proc destroy() {
head disconnect()
neck disconnect()
head delete_section()
neck delete_section()
}
endtemplate Spine