SPM Scripts & Functions

Please note that since 2010 I no longer update John’s Gems, and have instead integrated them into my blog Neuroimaging Tips & Tools . Please use the John-Gems tag in the blog to find all the Gems; you may also find it useful to search by SPM version specific keywords as well.

Here are a few popular files that were embeded in old John’s Gems & the blog.

Bash script to generate set of 24 motion-derived regressors

  • mp_diffpow24.sh Takes the 6-column motion parameter text file and produces a 24-column text file. The first 6 are copies of the input (6 rigid body motion parameters), the next 6 columns are the squares of these parameters, the next 6 columns are the temporal derivatives of the motion parameters, and the final 6 columns are the squares of of the temporal derivaties. The result is then suitable to be added as “multiple regressors” in a first level SPM fMRI analysis.