Quick help on 4d image registration

Post date: Jul 2, 2013 10:00:16 AM

Updated in January, 2016.

This post is intended to briefly explain how to use my 4d image registration algorithm for simultaneous motion correction and slice timing in fMRI. This algorithm was designed to simultaneously correct for both continuous subject motion and slice timing effects while being robust to actual BOLD fluctuations. I would recommend its usage over my previous tool called INRIalign, which is no longer maintained as far as I know.

The 4d registration algorithm is now included in the NiReg package, developed as part of the NiPy project (Neuroimaging in Python). Python is a high-level programming language which compares with Matlab to some extent but is free, unlike Matlab. You don't need Matlab to run any NiPy algorithm.

You can install NiReg following the standard Python installation procedure: download the source code, unzip it, and run the magical command python setup.py install from a terminal. This should work fine if the dependencies are already installed on your system and if you have a C compiler (on Windows, I would use mingw back in the days, which may still work well although I cannot guarantee that since I have switched to Linux for several years). Alternatively, you can use easy_install and/or follow the same installation guidelines as those given for the core NiPy package at http://nipy.org/nipy/users/installation.html.

Once you have NiReg installed on your system, you will need to write a small Python script to run the 4d registration algorithm. There is currently no graphical interface to guide you through the argument selection like in the slice timing and motion correction tools from SPM, FSL or AFNI... Writing this Python script should however not be too difficult even if you are not familiar with Python. You might even find it easier than launching a UI at the end of the day. For that, you can adapt the following example script:

https://github.com/nipy/nireg/blob/master/examples/space_time_realign.py

Alternatively, you can launch the 4d registration algorithm via the nipype processing framework. This, again, will require a couple of Python code lines but might be easier.

I hope these indications help. Should you need further assistance, please contact me directly or, even better, via the NiPy list (nipy-devel at neuroimaging dot scipy dot org).