begintemplate MyelAxonMammal
public init, create_sections, topol, subsets, geom, biophys
public NODE, MYSA, FLUT, STIN
public all
proc init() {
create_sections($o1)
topol($o1)
biophys($o1)
}
create NODE[1], MYSA[1], FLUT[1], STIN[1]
proc create_sections() {
n_rn = $o1.get("section_counter").get("node")
n_mysa = $o1.get("section_counter").get("MYSA")
n_flut = $o1.get("section_counter").get("FLUT")
n_stin = $o1.get("section_counter").get("STIN")
create NODE[n_rn], MYSA[n_mysa], FLUT[n_flut], STIN[n_stin]
}
objref all, sctps, sec, next_sec
proc topol() { local i, i_rn, i_mysa, i_flut, i_stin
objref all, sec, next_sec
all = new SectionList()
n_rn = $o1.get("section_counter").get("node")
n_mysa = $o1.get("section_counter").get("MYSA")
n_flut = $o1.get("section_counter").get("FLUT")
n_stin = $o1.get("section_counter").get("STIN")
n_mx = $o1.get("mx_n")
nsecs = $o1.get("nsecs")
sctps = $o1.get("sectypes")
i_rn = 0
i_mysa = 0
i_flut = 0
i_stin = 0
for i=0, nsecs-1 {
sec = sctps.o(i)
if (strcmp(sec.sectype, "node") == 0) {
if (i_rn < n_rn-1) {
NODE[i_rn] connect MYSA[i_mysa](0), 1
}
if (i_rn == n_rn-1) {
if (i < nsecs-1) {
NODE[i_rn] connect MYSA[i_mysa](0), 1
}
}
NODE[i_rn] all.append()
i_rn += 1
}
if (strcmp(sec.sectype, "MYSA") == 0) {
if (i < nsecs-1){
next_sec = sctps.o(i+1)
if (strcmp(next_sec.sectype, "FLUT") == 0) {
MYSA[i_mysa] connect FLUT[i_flut](0), 1
}
if (strcmp(next_sec.sectype, "node") == 0) {
MYSA[i_mysa] connect NODE[i_rn](0), 1
}
}
MYSA[i_mysa] all.append()
i_mysa += 1
}
if (strcmp(sec.sectype, "FLUT") == 0) {
if (i < nsecs-1){
next_sec = sctps.o(i+1)
if (strcmp(next_sec.sectype, "STIN") == 0) {
FLUT[i_flut] connect STIN[i_stin](0), 1
}
if (strcmp(next_sec.sectype, "MYSA") == 0) {
FLUT[i_flut] connect MYSA[i_mysa](0), 1
}
}
FLUT[i_flut] all.append()
i_flut += 1
}
if (strcmp(sec.sectype, "STIN") == 0) {
if (i_stin < n_stin-1) {
STIN[i_stin] connect FLUT[i_flut](0), 1
}
if (i_stin == n_stin-1) {
if (i < nsecs-1) {
STIN[i_stin] connect FLUT[i_flut](0), 1
}
}
STIN[i_stin] all.append()
i_stin += 1
}
}
}
objref l_rn, l_mysa, l_flut, l_stin
proc biophys() {
n_rn = $o1.get("section_counter").get("node")
n_mysa = $o1.get("section_counter").get("MYSA")
n_flut = $o1.get("section_counter").get("FLUT")
n_stin = $o1.get("section_counter").get("STIN")
n_mx = $o1.get("mx_n")
l_rn = $o1.get("lengths").get("node")
l_mysa = $o1.get("lengths").get("MYSA")
l_flut = $o1.get("lengths").get("FLUT")
l_stin = $o1.get("lengths").get("STIN")
for i=0, n_mx-1 {
if (i < n_rn) {
NODE[i] {
L = l_rn.x[i]
diam = 1.
nseg = 1
Ra = 1.e99
cm = 0.
insert pas
e_pas = 0.
g_pas = 1.e9
insert extracellular
xg[0] = 1e10
xc[0] = 0.
xraxial[0] = 1e9
}
}
if (i < n_mysa) {
MYSA[i] {
L = l_mysa.x[i]
diam = 1.
nseg = 1
Ra = 1.e99
cm = 0.
insert pas
e_pas = 0.
g_pas = 1.e9
insert extracellular
xg[0] = 1e10
xc[0] = 0.
xraxial[0] = 1e9
}
}
if (i < n_flut) {
FLUT[i] {
L = l_flut.x[i]
diam = 1.
nseg = 1
Ra = 1.e99
cm = 0.
insert pas
e_pas = 0.
g_pas = 1.e9
insert extracellular
xg[0] = 1e10
xc[0] = 0.
xraxial[0] = 1e9
}
}
if (i < n_stin) {
STIN[i] {
L = l_stin.x[i]
diam = 1.
nseg = 7
Ra = 1.e99
cm = 0.
insert pas
e_pas = 0.
g_pas = 1.e9
insert extracellular
xg[0] = 1e10
xc[0] = 0.
xraxial[0] = 1e9
}
}
}
}
endtemplate MyelAxonMammal