Page 1 of 1

Getting parents until soma

Posted: Sun Apr 27, 2014 3:44 pm
by Nin
I'm trying to get a list of nrn.Section objects that contains all the parents until the soma from a given section (it could be the currently accessed section). I tried several methods of SectionList, but couldn't find anything appropriate. For example, in the following example where the soma is connected to dend[0],and this section to dend[1] ... until dend[10], I could easily get the children, but not the parents as follows:

Code: Select all

>> myseclist = h.SectionList()
>> myseclist.children( sec = mycell.dend[8] ) # mycell is a custom cell type
>> myseclist.printnames()
>> dend[9]
>> dend[10]
Is there anything like parent()?

Thanks in advance.

Re: Getting parents until soma

Posted: Mon Apr 28, 2014 10:06 am
by ted
You want to use the SectionRef class--see its has_parent, has_trueparent, trueparent, and root methods.
http://www.neuron.yale.edu/neuron/stati ... ecref.html