path length calculation

Anything that doesn't fit elsewhere.
Post Reply
schubert

path length calculation

Post by schubert »

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
ted
Site Admin
Posts: 6299
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: path length calculation

Post by ted »

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.
This

Code: Select all

proc showdist() { local offset
        distance(0, 0.5)
        forall {
                printf("\n")
                print secname()
                for (x) {
                        print x, " ", x*L, " ", distance(x)
                }
        }
}
will print the distance from every node of every section to the midpoint of
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)
(bearing in mind that the sections are not always connected to each other at the end, but in an interval of [0,1]).
It is a bad idea to attach a child section to an internal node of its parent. Why?
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...).
Post Reply