SPM/Batch
From Wikibooks, open books for an open world
< SPM(Redirected from SPM/Writing batch scripts)
See this Powerpoint presentation for an overview.
[edit] Batch Script for SPM8
See the relevant chapter in the SPM manual.
Any batch script should follow the template:
spm('defaults','fmri');
spm_jobman('initcfg');
matlabbatch{1}.spm... = ...;
spm_jobman('run',matlabbatch);
The Batch Scripts for SPM5 below can also be used in SPM8.
For general comments on SPM8 scripting see the SPM scripting page.
[edit] Batch Script in SPM5
Examples of script (for SPM5 and compatible with SPM8) are provided with the SPM Data Sets, for example:
- First Level block fMRI data analysis
- First Level event-related fMRI data analysis
- Second Level fMRI data analysis
- DCM/PPI
- Multi-Subject PET data analysis
See also:
- http://www.icn.ucl.ac.uk/courses/MATLAB-Tutorials/Sessions2008_09/sessions2008_09.htm#S13 for a generic multi-subject preprocessing script.
- http://www.mrc-cbu.cam.ac.uk/people/rik.henson/personal/analysis.html
- http://imaging.mrc-cbu.cam.ac.uk/imaging/SpmBatch5
[edit] Batch Script for SPM2
There is an example batch script written by Rik Henson, for a single subject fMRI data set (preprocessing and statistics).