-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodemarks.hoc
67 lines (57 loc) · 1.4 KB
/
nodemarks.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
// $Id: nodemarks.hoc,v 1.1 2015/09/30 05:18:57 ted Exp ted $
/*
nodemarks.hoc
template for a set of sections used to mark locations of internal nodes
based on subtree.hoc
$o1 SectionList that contans the sections whose internal nodes are to be marked.
$2 "+" for + shaped marks, anything else gets x shaped marks
$3 Length of each arm of the + or x mark.
Note for possible future use:
delete_section() deletes currently accessed section
*/
begintemplate NodeMarks
public mark, num
create mark[1]
num = 1
plus = 1
proc init() { local ii, delta
num = 0
forsec $o1 num+=nseg
create mark[num]
// set geometry
plus = (strcmp($s2, "+") == 0) // + marks
if (plus == 1) { // + marks
for ii=0,num-1 mark[ii] {
pt3dclear()
pt3dadd(0,0,0,1)
pt3dadd($3,0,0,1)
pt3dadd(-$3,0,0,1)
pt3dadd(0,0,0,1)
pt3dadd(0,$3,0,1)
pt3dadd(0,-$3,0,1)
}
} else { // x marks
delta = $3/sqrt(2)
for ii=0,num-1 mark[ii] {
pt3dclear()
pt3dadd(0,0,0,1)
pt3dadd(delta,delta,0,1)
pt3dadd(-delta,-delta,0,1)
pt3dadd(0,0,0,1)
pt3dadd(-delta,delta,0,1)
pt3dadd(delta,-delta,0,1)
}
}
// connect to internal nodes of $o1
ii = 0
forsec $o1 for (x,0) {
connect mark[ii](0), x
ii+=1
}
// set marks biophysical params so they don't affect simulation
for ii=0,num-1 mark[ii] {
Ra = 1e9
cm = 1e-9
}
}
endtemplate NodeMarks