Getting parents until soma

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
Nin
Posts: 41
Joined: Thu May 03, 2007 4:04 pm
Location: Institute of Science and Technology (IST Austria)
Contact:

Getting parents until soma

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

Re: Getting parents until soma

Post 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
Post Reply