a non-recursive way to determine the branch order
Posted: Sun Dec 17, 2006 7:15 am
I suggest a non-recursive way to determine the brach order of a dendrite tree. This function will check if the parent section is a branch point or not. Finally the function return the order of the actual section. The code of this function is:
Example: To determine the branch order of section [130] you can access the function in this way:
Code: Select all
func branchpoint() {local branch localobj sr
branch=0
sr = new SectionRef()
while (sr.has_parent){
if (sr.nchild==2) {
branch=branch+1
}
access sr.parent
sr = new SectionRef()
}
return branch
}
Example: To determine the branch order of section [130] you can access the function in this way:
Code: Select all
access dend[130]
print branchpoint()