Page 1 of 1
dendrite order
Posted: Wed Mar 01, 2006 11:30 am
by thats_karlo
Hello,
To make a 3D reconstraction of cell i use import "3D model" option.
Is there any way to determine the dendrite order? for example, if i have maximum dend[500], how can find out dend[150] belongs to which order of dendrits, 6th, 7th, or...order?
I'm waiting for your suggestions!
Thank's in advance
Posted: Tue Mar 07, 2006 10:28 am
by thats_karlo
HI!
I am wondering that i asked stupid question, OR my question is not clear
OR there is not a simple way to do that!
??
any idea !?
determining the "branch order" of a section
Posted: Tue Mar 07, 2006 1:11 pm
by ted
Sure there's a simple way. Use the SectionRef class. Discover the root of the tree
(use the root() method). Starting at the root of the tree, recursively descend the tree
(here, the child() and nchild() methods will be helpful) while keeping track of the level
of descent. All sections at level i are ith order. That's how to traverse the whole tree in
a single pass, finding the branch order of each section.
If you only need the branch order of a few sections, it may be simpler to start at the
section of interest and _ascend_ recursively to the root, keeping track of each level on
the way. This would use the SectionRef class's has_parent and parent methods. Example:
Code: Select all
// returns branch order of the currently accessed section
// root of tree has order 0
func branchorder() { local order localobj sr
order = 0
sr = new SectionRef()
if (sr.has_parent) {
sr.parent order = 1 + branchorder()
}
return order
}
Posted: Thu Mar 09, 2006 11:09 am
by thats_karlo
Dear Ted
Thank you very much for your reply. i wrote the following code
Code: Select all
create soma, dend[11]
access soma
access dend
connect dend[0](0), soma(0.5)
for i = 1, 2 connect dend[i](0), dend[i-1](1)
connect dend[3](0), dend[1](1)
connect dend[4](0), dend(1)
for i = 5, 6 connect dend[i](0), dend[4](1)
connect dend[7](0), soma(0.5)
for i = 8, 9 connect dend[i](0), dend[i-1](1)
connect dend[10](0), dend[8](1)
//===========================
func branchorder() {local order localobj sr
order = 0
sr = new SectionRef()
if (sr.has_parent) {
sr.parent order = 1 + branchorder()
}
return order
}
branchorder(dend[5])
in end of the *.hoc file i add your code. but when i use the function
"branchorder(dend[5])" i have syntax error! i don't know where is mistake.
Could you help me to find out where is mistake?
Thank's in advance,
karlo
Posted: Thu Mar 09, 2006 1:02 pm
by ted
A section cannot be passed as an argument to a function. The instructions for
func branchorder() state
Code: Select all
// returns branch order of the currently accessed section
In other words,
sectionname branchorder()
makes branchorder() return the order of sectionname
Posted: Thu Mar 09, 2006 2:06 pm
by ted
sectionname functionname()
calls functionname() in the context of sectionname, but doesn't do anything with the
returned value. You need to have a print or assignment statement, like this:
sectionname print branchorder()
or
sectionname foo = branchorder()
print foo
Posted: Thu Mar 09, 2006 2:13 pm
by thats_karlo
Hi Ted
Thank you so much!
It works nicely!
Have nice day!!
Karlo