I have a neuron model and I am trying to get the route from each leaf ( terminal ) to the routh.
First I use this code to get a list of all terminals
Code: Select all
objref tree
tree = new SectionList()
soma[0] distance()
soma[0] tree.wholetree()
objref terminals, thisone
terminals = new SectionList()
forsec tree {
thisone = new SectionRef()
if (thisone.nchild == 0 ) terminals.append
}
objref thisone
Then I want to trace the route back to the root, I try to run this code:
Code: Select all
objref Leaff
Dist = new Vector()
forsec terminals {
Leaff = new SectionRef()
while (Leaff.has_parent){
Leaff.parent
.....
}
}
Code: Select all
/usr/local/nrn/x86_64/bin/nrniv: stack empty
I found out that the error is in
Code: Select all
Leaff.parent
Code: Select all
objref Leaff
Dist = new Vector()
forsec terminals {
Leaff = new SectionRef()
Leaff.parent
}
What exactly is the problem?