wanderine/BROCCOLI — pull request #2 by Noughmad (2013-12-24 17:29:49+00:00)
Title: Wrapper for Python and Nipype

I'm sending a pull request as suggested on the email thread.

There are several parts, I will try to list and explain them in few words. Everything new is in the code/Python_Wrapper folder.

1. A SWIG file (broccoli_lib.i) that exports all the functions in BROCCOLI_LIB to Python. There are also some extra python utility functions (in broccoli/broccoli_common.py) that mainly deal with transferring data from Numpy arrays to BROCCOLI.

2. Python modules and functions for registration, motion correction and first level analysis in the broccoli folder. These are just higher-level wrappers, mostly equivalent to those in *.cpp files in Matlab_Wrapper.

3. Nipype interfaces for each of the above modules, in nipype/interfaces/broccoli. They define the relevant parameters, load the input files, and pass their contents to the higher-level wrappers. All the interfaces share some common parameters, which control OpenCL device and platform and whether results are shown as graphs.

4. Simple tests for the above interfaces, in nipype/interfaces/broccoli/tests. They are not really unit tests, instead they replicate the functionality of test_*.m files in Matlab_Wrapper.

So far, T1MNI, EPIT1 registrations and motion corrections produce results that are identical to those of Matlab wrappers. First level analysis does not, some parameters are correct, but the output volumes are wrong. I will update this repository as I make progress.

As a programmer and free software enthusiast, it also pains me that there is no documentation, either in BROCCOLI or in the new Python wrapper. I think I manage without it, but I could add some comments if you think it's useful.