Finding upstream and downstream sections and segments

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Finding upstream and downstream sections and segments

Post by Corinne »

Hello,

I was wondering if there was an elegant way to find all of the upstream and downstream sections and segments from a node. For example, say I wanted to find the average voltage of all sections upstream from an current injection point. To do this I would need to know the voltage at all the nodes upstream from the cite of my injection. Is there a way to find out what the upsteam sections and segments are, or do I need to make a list by hand?

Thanks!!
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Finding upstream and downstream sections and segments

Post by ted »

Code: Select all

objref sl
sl = new SectionList()
foo sl.children() // appends all children of foo to sl
SectionRef class has useful methods--parent, child, parent etc.
Corinne
Posts: 38
Joined: Wed Feb 09, 2011 7:13 pm

Re: Finding upstream and downstream sections and segments

Post by Corinne »

I knew there would be a fabulous way to do it!

Is there an equally fabulous way to make a list of all the distal most sections of an arbor? I couldn't quite figure it out using the recommended statements.

Thanks!
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Finding upstream and downstream sections and segments

Post by ted »

First make a SectionList that contains all children of the arbor's root section. Assuming the root section's name is foo

Code: Select all

objref tree
tree = new SectionList()
foo tree.wholetree()
Then iterate over all the sections in that SectionList to identify those that have no children

Code: Select all

objref terminals, thisone
terminals = new SectionList()
forsec tree {
  thisone = new SectionRef()
  if (thisone.nchild == 0) terminals.append()
}
objref thisone // destroy link between thisone and the last referenced section
  // for the sake of safety
Post Reply