Mapping points of a neuron section with points of swc file

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
ajayramak
Posts: 1
Joined: Fri Mar 21, 2014 9:59 am

Mapping points of a neuron section with points of swc file

Post by ajayramak »

Hello All

I am using NEURON 7.3 as a library in python. I import a neuronal structure in a SWC file in to neuron using the code snippet provided here:

http://www.neuron.yale.edu/phpbb/viewto ... =13&t=2272

At the moment, I am using NEURON for its functionality where it presents the 3D data of a reconstructed neuron in a tree-type data structure(parent-child access at every section). I plan to simulate the same structure later.
I use this mainly for subtree analysis, where I can write recursive algorigthms to navigate the neuronal tree structure. I have labelled subtrees of my neuron using a dummy mechanism which stores the subtree label. My foresight is that these labels can also be later used to insert mechanisms in the sections of the neuron with subtree specificity.
Now I need to also add these subtree labels to points in the original swc file. So, I need to navigate the neuronal tree, and in each section find the corresponding points in the swc file and map them to the subtree label stored in the dummy mechanism. For each section, in NEURON, I can only access the x3D, y3D, z3D and diam values and not the corresponding points in the swc file. I tried to see if I could parallelly navigate the tree structures in the swc file and in NEURON to find this mapping between NEURON section and SWC file. I found this tough since the ordering of children sections of a particular section in NEURON(i.e., in sectionRef.child[:]) and that in the swc file(according their linewise appearance) are not consistent.

The only way I can think of doing this is that, I go through all the sections, get the XYZ triplets and pointwise search the swc file for matches. But this is brute force and will take long time since, at times, my swc files have points numbering around 50000.

Do you have any idea about getting this mapping between the structure stored in NEURON HOC and swc file? May be the way import3D() works can give us a clue.

Thanks for your time and help in advance.

Ajay

p.s.: I know that I have included a lot of information which are not completely relevant to the question. Since the authors of NEURON will most likely read this, I would like to give them the complete scenario so that, if they could spare the time and effort, they could give me their opinion on my approach. Thanks :)
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Mapping points of a neuron section with points of swc fi

Post by ted »

Not sure I understand the purpose of the elaborate strategy you describe, let alone whether it will achieve your goal (whatever that is).
ajayramak wrote:I use this mainly for subtree analysis, where I can write recursive algorigthms to navigate the neuronal tree structure.
Then perhaps you find the SectionList class's subtree() method useful.
I have labelled subtrees of my neuron using a dummy mechanism which stores the subtree label. My foresight is that these labels can also be later used to insert mechanisms in the sections of the neuron with subtree specificity.
Maybe. A more natural strategy for NEURON would be to use SectionList.subtree to create the subtrees of interest, append any subtrees that have shared properties to a List, then iterate over each section of each sectionlist in that List with

Code: Select all

for i=0,treelist.count()-1 {
  forsec treelist.o(i) {
    . . . whatever you need to do to these sections . . .
  }
}
or in your case the Python equivalent of such a nested loop.
Now I need to also add these subtree labels to points in the original swc file.
I won't ask why this is useful, but if you feel it really is necessary, have at it, and good luck to you. But before you put any real effort into it, I'd suggest thinking long and hard about the utility of doing that. Remember that the points at which diameter and coordinates are measured are more than somewhat arbitrary. If you think I'd "get it" if you explained your goal and strategy in greater detail, but you'd prefer to do that in confidence, this discussion can be continued via email. My address is ted dot carnevale at yale dot edu
Post Reply