Mapping points of a neuron section with points of swc file
Posted: Fri Mar 21, 2014 11:18 am
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 :)
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 :)