I was completely unaware of this until someone pointed it out to me the other day, but there’s a really nice effort underway to develop a Neuroimaging package for Python:
The neuroimaging in python (NIPY) project is an environment for the analysis of structural and functional neuroimaging data. It currently has a full system for general linear modeling of functional magnetic resonance imaging (fMRI).
This strikes me as a great project for a number of reasons (see this page for more):
- The existing free software packages for fMRI analysis (or at least the two I’m moderately familiar with) have limitations that are pretty hard to live with. SPM is about as close to an industry standard as there is, but has a hideously clunky GUI, depends on expensive proprietary software (MATLAB), and lacks integration with other environments/languages. FSL is very powerful, but also lacks interoperability, and in practice, I’ve found it hard to build complex models with FSL.
- Speed. NIPY is built on SciPy/NumPy, an increasingly popular set of Python libraries for scientific computing. Much of the SciPy/NumPy code is just a wrapper for C++/Fortran libraries that do the heavy lifting. So in theory, NIPY could be very fast (though Matlab is comparable for many operations. For a nice comparison of different numerical analysis packages, see this page).
- Open source / total interoperability. In theory, SPM and FSL are both “open” to varying degrees. But as the NIPY developers note, in practice, relatively few people actually make substantial contributions to the SPM or FSL codebase. Moving to a high-level language that’s easier to learn and develop in could do a lot to increase the level of community support for any package.
- The language. I can’t see myself ever contributing much to the SPM codebase precisely because I find programming in Matlab to be about as pleasant as pulling teeth. That’s not because I’m a terrible programmer; I have a fair amount of experience with a number of other languages. It’s because Matlab isn’t really a programming language. There’s limited or non-existent support for any number of operations that are a single call away in Python or R. And if the functionality you want doesn’t exist, you’ll probably have to write it yourself. Whereas Python has freely available packages for just about everything. And the language just makes sense. If you’re going to build a new package for fMRI analysis, it’s not a bad idea to build it in a language that’s actually fun to program in.
- Great support. NIPy has great developers and institutional support (the project is maintained by the Brain Imaging Center at Berkeley), and seems likely to stay funded for the foreseeable future.
So what’s the downside? Well, the software clearly isn’t ready for prime-time yet. The developers themselves counsel you not to use it for any serious data analysis. But there’s already a reasonable amount of functionality, and it’s generally well-documented. Give it another year or two and NIPy should start to siphon users away from SPM and FSL. I’ll certainly be happy to make the switch.
nipy has evolved into nipype.
http://nipy.sourceforge.net/nipype/