Python for neuroscience / neuroinformatics
Posted on 05. Jun, 2010 by admin in Code, How To
As many other enthusiastic python lovers, I believe that the supremacy of Matlab in way too many (neuro)scientific studies will decrease in the following years, leaving the scene to powerful python and its many libraries for scientific computing and optimized C/C++ core routines.
In this post I am collecting various resources related to Python for neuroscience. I will talk about Python 2.6 (since SciPy is not supported on Python 3) and MacOSx… but you can adapt it easily to any other OS.
- Install Python Just go to http://python.org/download/ and – as specified in the FAQs of SciPy what you currently need is Python 2.6.x.
- Learn Python If you are new to Python2, you need a reliable source to quickly learn the Python mindset. I recommend http://diveintopython.org/ – a free book for diving into Python2.
- Scientific Computing and Python Since you are interested in scientific computing, SciPy is what you need. The modules are available in the download section
- Programming Environment You might want to also have a decent reliable editor/IDE e.g. Spyder. Look here in the comments for a reliable installation solution for Mac http://code.google.com/p/spyderlib/wiki/Installation (you need to download the source code tar.gz and compile it basically)
- Other Packages If you are using SPM or FSL, your favorite MRI format might be NIfTI. Python is able to load NIfTI volumes with PyNIfTI.
- Very interesting readings At this point you are familiar with python and ready to crunch some real data. You might first want to read the special topic Python in neuroscience on Frontiers in Neuroinformatics journal.
I guess that’s enough to get you started. I will add here bits of code that I believe can help people.




