dear group,
i'm facing a rather simple problem with the neuron program i can't fix.
i'd like to print out the distance from each section (from the point on at which it is connected to its parent) to the soma.
so for each section i'd like to calculate the way along all the parent sections up to the origon of the section itself (bearing in mind that the sections are not always connected to each other at the end, but in an interval of [0,1]).
i'm having trouble with referencing the sections in a forall-loop
thank you in advance,
alexander schubert
path length calculation
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: path length calculation
Thisi'd like to print out the distance from each section (from the point on at which it is connected to its parent) to the soma.
Code: Select all
proc showdist() { local offset
distance(0, 0.5)
forall {
printf("\n")
print secname()
for (x) {
print x, " ", x*L, " ", distance(x)
}
}
}
the default section. Assuming that every child section is attached by its
0 end to its parent, you only need to replace the contents of the forall { }
loop with
print secname(), " ", distance(0)
It is a bad idea to attach a child section to an internal node of its parent. Why?(bearing in mind that the sections are not always connected to each other at the end, but in an interval of [0,1]).
Because the actual point of attachment will depend on the parent's nseg. So
you might think you are attaching a child section to 0.7, but if nseg is not a multiple
of 5, it will actually be attached to a different place. And if you change nseg to a
value that destroys existing nodes (e.g. changing nseg from 5 to 3), you will move
the child branch to a new location (in this example, from 0.7 to 0.8333...).