I'm trying to integrate some new functionality into a mountain of legacy code, and this functionality comes from something that's written half in Python and half in HOC, so I'm unsure of what my errors are doing.
I'm trying to add a spine to my detailed morphology, and I'm trying to use exactly the same spine as in someone else's project.
So I added this function to my cell's template:
Code: Select all
proc add_spine_ra(){localobj sref
PI = 3.14159265359
sref = $o1
x = $2
neck_diam = $3
neck_len = $4
spine_head_area = $5
ra = $6
create spine[2]
L_head = 2*sqrt(spine_head_area /4/PI) //sphere has the same surface area as cylinder with L=diam
diam_head = L_head
spine[0]{
L = neck_len
diam = neck_diam
insert pas
cm =CM
g_pas=1/RM
e_pas = E_PAS
Ra = ra
regspines.append()
}
spine[1]{
L = L_head
diam = diam_head
insert pas
cm =CM
g_pas=1/RM
e_pas = E_PAS
Ra = ra
regspines.append()
}
connect spine[1](0) ,spine[0](1)
sref.sec{
connect spine[0](0), x
}
}
In my code I access a target section, and try to type this:
Code: Select all
target_section = new SectionRef()
//add a spine to the cell
add_spine_ra(target_section, 0.5, 0.25,1.35,2.8,201.78)
This is a bit of a sloppy hack job here, since my original idea (use my external tools to add a spine) doesn't seem to be working right.