Free, accurate neuron building script

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2013
Free, accurate neuron building script

Hi all,

I realized I han't let people here know about this; Earlier this year I wrote a python script to allow C4D users to import neuron morphology data and automatically create accurate spline-based 3D models of nerve cells, based on data collected by scientists from a number of different species (including humans).

I've open-sourced the script and made it available at:

https://github.com/NWoolridge/NeuronBuild

Just download the NeuronBuild_1.5.py file and place it in your scripts location (or copy and paste the text of the script into your script editor). You will need to browse and download some neuron morphology files from:

http://neuromorpho.org/

My thanks to Graham Johnson for catching some bugs and improving the script...


A simple pyramidal neuron on the left, and a more complex basket cell on the right.



From the ReadMe:

A script to import swc files downloaded from neuromorpho.org, and create accurate spline-based models of neuronal structure. The original swc file format is detailed here:

Cannon, R.C, Turner, D.A, Pyapali, G.K, Wheal, H.V. An on-line archive of reconstructed hippocampal neurons. Journal of Neuroscience Methods. 84 1–2. pp 49-54. 1998

The reconstruction units are μm (micrometers). Note: soma (cell body) definitions vary from file to file; this script assumes a three point spline (which is very common). The soma object is disabled by default, since they rarely produce acceptable geometry. Note: use of neuromorpho files may come with an obligation to cite the original publication.

How to use:

- add to your C4D scripts folder (on Mac OS X: Applications/MAXON/CINEMA 4D R14/library/scripts or in the user prefs folder)
- Browse and download a .swc or .swc.txt file from http://neuromorpho.org/
- Open the script manager in C4D, the script should be in the pop-up menu at the top of the window.
- In the Script manager in C4D load the NeuronBuild script and click "Execute".
An import options dialog should appear; choose options for imported geometry, and click "Import File".
- In the open file dialog, choose the swc file and click "OK".
- A neuron should appear in your viewport.

If all the geometry options are chosen, the geometry consists of a HyperNURBs object, which contains a Connect object, which contains a null object, which contains the sweep objects that define the axons and dendrites. Since the Soma (cell body) definition in the swc files is so rudimentary, you may want to delete or hide it, and let the soma be defined by the merging dendrite roots. Within the sweep objects are n-sided splines (named "Profile") set to 6-sides; you could search for these objects and change the number of sides to 4 to simplify the geometry. Also in the SweepNURBs objects are the splines that define the dendrite paths, and rail splines that define their radius.
 
  05 May 2013
Great job Nick
 
  05 May 2013
Looks like a lot of work went into this.

Appreciated - thank you

Last edited by deepshade : 05 May 2013 at 01:34 AM.
 
  05 May 2013
Worked great! Thanks, really interesting Nick.
 
  05 May 2013
Cool. Might experiment with this later.
__________________
۩PRIST

 
  05 May 2013
Very cool, Nick!
A big THANK YOU!

edit: Having fun! Rat cells on cloners.
Some of the dendrites aren't quite completing the connection. Is that a setting or a data problem, Nick?
Attached Images
File Type: jpg WoolridgeNeuronBuilder1.jpg (97.6 KB, 127 views)

Last edited by ScientiaViz : 05 May 2013 at 06:01 PM.
 
  05 May 2013
Great work!

Thanks for making this script free Nick, a nice tool to help harness vast amounts of scientific neuron data available online. A very elegant solution indeed.
Attached Images
File Type: jpg Dopaminergic_.jpg (13.7 KB, 156 views)
 
  05 May 2013
Originally Posted by Gary3fx: Thanks for making this script free Nick, a nice tool to help harness vast amounts of scientific neuron data available online. A very elegant solution indeed.


Hi Gary,

And thank you for alerting me to the existence of neuromorpho.org in the first place!
 
  05 May 2013
Thanks, Nick. This is very cool!
 
  05 May 2013
That is great. Thanks a lot.

cheers

celke
 
  05 May 2013
Thank you very much!

Weird shit those neurons....
 
  05 May 2013
This is just amazing! Thank you, Nick!

Cube
 
  05 May 2013
Originally Posted by ScientiaViz: Having fun! Rat cells on cloners.
Some of the dendrites aren't quite completing the connection. Is that a setting or a data problem, Nick?


Hmm, I'm not sure... Could you upload or point to the data file that's giving you problems? I tested on a range of different files, but I easily could have missed some edge case....
 
  05 May 2013
Thanks Nick.
The Amaral file I downloaded was named c12971.CNG.swc.
If you want I can email my C4D file.
-A
 
  05 May 2013
Originally Posted by ScientiaViz: Thanks Nick.
The Amaral file I downloaded was named c12971.CNG.swc.
If you want I can email my C4D file.
-A


I got the file from neuromorpho.org... Interesting file; it has a series of structures at the end of the file with the ID "10", which is not standard for the file format (as far as I know). They are not part of the neuron, but contours that provide some context or orienting info, perhaps from the brain structure from which they were derived...

The script ideally should ignore them, but it just builds them anyway... I'll revise the script!

Most of the dendrite branches connect well in this file, but there are some "misses"; That seems to happen in some files. I'm not sure if it is a data quality problem or a script logic issue (although its self-serving, I tend to think its the former... ).

Nick
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:48 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.