spm2Batch by Robert C. Welsh rcwelsh at med.umich.edu
June 28, 2006
SPM is a very useful and powerful tool that has enabled thousands to analyze fMRI and PET data over the past many years. To further enable and empower the end-user I have developed and deployed these shell command line scripts at the University of Michigan Department of Psychiatry for use in the PANL group. These scripts have also been used in the Department of Radiology for preprocessing of fMRI data for neurosurgical intra-operative use. Currently these scripts have been in use since 2005 and time is ripe to make them available to the academic community world-wide.
These scripts were developed to simplify preprocessing of fMRI using the SPM2 processing package. These scripts have successfully run in both a Linux and Mac OS X environments. The scripts are written in the bash scripting language and thus very little effort is needed to enable their use at external sites. These scripts are to be called from the UNIX/LINUX/MAC OSX prompt, not the matlab prompt.
Download tarred distribution now. (You may need to right-click - sorry.)
     1) Create directory for installation, gunzip and un-tar with:
                tar -xjf spm2Batch_YYYY_MM_DD.tgz
           where YYYY_MM_DD is the time stamp of the current release.
     2) Modify code “spm2Batch_global”.
     3) Modify your “path” to include location of spm2Batch scripts.
Data organization:
The scripts are highly dependent upon and require your data to be organized in a strict manner. We have found this to be quite useful at the University of Michigan as  whole. Our organizational structure is:
                        run_XX/    (where XX is a a 2-digit sequential number)
                               img/      (un-processed images “vol*.img”)
                               a_img/    (slice time corrected  “avol*.img”)
                               ra_img/   (realigned data  “ravol*.img”)
If your structure varies from this you will need expert assistance to modify scripts. You can also attempt to override structure with appropriate flags (see HELP), but this is not guaranteed to work. Currently, internal code in the scripts expect to use ANALYZE format (looking for hdr/img pairs.)
      Each command is self-documented. Issuing the command with no command line options will result in a help screen. My local (slightly out-of-date) help file can be viewed here.
      Commands: coregOverlay, coregSPGR, warpSPGR, warpfMRI, smoothfMRI, ranfxLinks.
      Additional: Anything else you find is experimental : realignfMRI (uses FLS McFlirt), and version 2 of some scripts (coregSPGR2 etc). These are definitely sold-as-is.
If you use these scripts please include a reference to me and to this web page. Additionally, please frequent these web pages for updates.  Please put “spm2Batch” in subject line for any communications.
Small type: These scripts are copyrighted 2005-2006 by Robert C. Welsh, Ann Arbor, MI. Academic, non-profit and not-for-profit use is permitted. No guarantee or warranty is made as to the efficacy or accuracy of these scripts. These scripts are USE AT YOUR OWN RISK. Given that, I hope you find them useful and please give me feedback. I’ll do my best to respond to technical difficulties, but I am a one-man operation so please be patient. :)