Hi,
Suppose you have a complex morphology data of a cell, and you have successfully convert it to neuron.
in "sh" windowes, when i type oc> topology() i will see my sections that consists of :
soma , dend1[0], dend1[1],.........
dend2[0], dend2[1],.........
.......................................
.......................................
dend10[0], dend10[1],.........
i want to write a code that contain a for loop,which in this loop i like to have access to every section. Assume, we can show dendrtic segment with symbol dendj[0:end], that "j" showes barnch , [0:end] shows number for barnch segmant( i hope it is clear).
my for loop is like:
for j=1,end{
for i=1,end{
accecc dendj
dendj.dima=2*j // for example!
}
}
so, is there any command to find how many barnch we have? j=1,?
is there any command to find how many segment are attributed to a barnch? i=1,?
or, maybe you have other way, to have access to every segment?
Thanks in advance!
Karlo
access to section!
Have a look at the statements forall and forsec in the quick index:
http://www.neuron.yale.edu/neuron/stati ... tml#forall
http://www.neuron.yale.edu/neuron/stati ... tml#forsec
http://www.neuron.yale.edu/neuron/stati ... tml#forall
http://www.neuron.yale.edu/neuron/stati ... tml#forsec
-
thats_karlo
Hi,
thanks Raj,
I look at "forall" and "forsec" , but i doesn't help me.
consider you have soma, and 10 barnch of dendrits, and ever brach contanis defferent number of section. so, in NEURON section names are consiste of:
soma
dend1[0],dend1[1],......dend1[n1]
dend2[0],dend2[1],......dend2[n2]
....
.....
dend10[0], dend10[1],......dend10[n10]
1-do you know any way to determine, how many barnches we have?
here, 10 barnch
2- for every barnch, how many sub-section we have?
here, what 's n1,n2,....n10?
3-Can i change the name of section from
(dend1[0],..dend1[n1],dend2[0],...dend2[n2],.....dend10[n10])
to
(dend[0],dend[1],dend[2],.......,dend[100],.........dend[500])
4- Or, can i make a section list, with some command to access every emembre of list,e.g,
mylist=[dend1[0] dend1[1]........dend5[18]........dend10[11]]
for i=1, size(list){
access mylist
mylist.diam=2*i // for example!
}
await for any suggestion!
thanks,
Karlo
thanks Raj,
I look at "forall" and "forsec" , but i doesn't help me.
consider you have soma, and 10 barnch of dendrits, and ever brach contanis defferent number of section. so, in NEURON section names are consiste of:
soma
dend1[0],dend1[1],......dend1[n1]
dend2[0],dend2[1],......dend2[n2]
....
.....
dend10[0], dend10[1],......dend10[n10]
1-do you know any way to determine, how many barnches we have?
here, 10 barnch
2- for every barnch, how many sub-section we have?
here, what 's n1,n2,....n10?
3-Can i change the name of section from
(dend1[0],..dend1[n1],dend2[0],...dend2[n2],.....dend10[n10])
to
(dend[0],dend[1],dend[2],.......,dend[100],.........dend[500])
4- Or, can i make a section list, with some command to access every emembre of list,e.g,
mylist=[dend1[0] dend1[1]........dend5[18]........dend10[11]]
for i=1, size(list){
access mylist
mylist.diam=2*i // for example!
}
await for any suggestion!
thanks,
Karlo
Code: Select all
forall {
print secname()
}Alternatively you can use the topology function:http://www.neuron.yale.edu/neuron/stati ... l#topology
The output of this function also gives you how they are connected and you can read of the information you need. In this is case it might not be worth it to try to automate the process further.
With for example
Code: Select all
forsec "dend11" {
// do my thing
}Running
Code: Select all
objref dendriticSections
dendriticSections=new SectionList()
forsec "dend" {
dendriticSections.append()
}
With:
Code: Select all
forsec dendriticSections {
// do my thing
}-
thats_karlo
Thanks,
Just could you tell more one more point! in the code
i like to insert my function in part "// do my thing". Actually i use my function like
Could you tell me how can i use, my function in
forsec dendriticSections {
// do my thing
}
to do calculation for every member of section list!
thanks again,
Karlo
Just could you tell more one more point! in the code
Code: Select all
objref dendriticSections
dendriticSections=new SectionList()
forsec "dend" {
dendriticSections.append()
}
forsec dendriticSections {
// do my thing
}
Code: Select all
sectionname result=myfunc()
print result
or
access sectionname
result= myfunc()
print result
forsec dendriticSections {
// do my thing
}
to do calculation for every member of section list!
thanks again,
Karlo
Just define a function, example:
and call it:
Code: Select all
func myfunc(){
return diam
}Code: Select all
forsec dendriticSections {
print myfunc()
}