Table of Contents
Preprocessing
Motivation
Although NeuroElf is mostly meant as a tool for additional analyses that are not implemented/covered by one of the more “general-use” fMRI packages, the fact that preprocessing a whole set of subjects can easily lead to error (and is also, in part, a sometimes time-consuming task, depending on the availability of scripts), I decided to implement a GUI to configure the usual steps of preprocessing following the workflow in the lab I'm currently working at.
Requirements
- a working copy of SPM5 or SPM8 (on the Matlab path)
- a set of raw data for at least one subject in either Analyze (hdr+img) or NIftI (nii) format
- for multiple subjects, all subject folders must reside in the same folder (and preferably share some naming convention)
- one anatomical scan per subject (unless the EPI template is used)
- the separation of runs into separate folders
- equal number of slices across functional runs
To invoke the UI, enter spm5_preprojobs;
without arguments.
GUI layout
How to use the dialog
Here are some step-by-step instructions to follow for the first time user:
- select one of the subject folders using the
'Browse…
' button - if necessary, adapt the folder name to contain a pattern (* or ?) to select multiple subjects
- alter the name patterns for the functional and structural subfolders within each subject's folder (must match across subjects)
- if necessary, change the filename pattern for the functional and structural image files (e.g. to select specific files)
- click the
'Search
' button to locate all subjects suitable for preprocessing - check the list of subjects and, possibly, remove any subjects to be excluded (or already preprocessed) from the list
- configure whether or not functional images should be forced to single-precision floating-point prior to preprocessing
- set whether the structural image should be coregistered to the (smoothed!) T1 template first
- select the number of volumes to skip (in case they were not dropped during scanning/NIftI image creation)
- if slice-timing is performed, configure the TR, slice acquisition order, and if required also the TA and reference slice
- configure the realignment and coregistration settings
- choose the preferred option from the available normalization algorithms
- potentially re-define the bounding box
- pick the desired re-slicing resolution
- configure the smoothing kernel (or disable smoothing in case you would like to keep the data “as raw as possible”)
- determine whether you would like to run fmriquality on each functional run
- select whether to create BrainVoyager compatible VTC files from each preprocessed run (in MNI space!)
- either only create the jobs (to run at a later time or distributed on different machines)
- or create and run all jobs
Options
Force to single-precision floating-point
In case the scanner produces a low range of intensity values (e.g. the bulk of the within-brain voxels have values around 200), rounding errors during preprocessing are likely to over-shadow a significant portion of the signal by introducing additional (and unexplained!) variance (for values around 200 this means about half a per cent!). This can lead to reduced detection power on the first level, as well as slightly increased false-negative rates on the second level (higher error on the first-level beta estimates).
While single-precision floating-point images require twice the amount of disk capacity, compared to the typically used 16-bit integer images, this ensures that the impact of rounding errors during preprocessing is minimized!
Registering the structural image to the T1 template
As mentioned in the SPM help, certain algorithms (including the segmentation) only work reliably if the structural image is already in fairly good registration prior to the respective task. This initial registration is performed on highly smoothed versions of the images to allow a very rough fit to be performed (i.e. overlap of head with template). While this is still no guarantee for a successful final segmentation, I have found it beneficial for the average dataset, and thus this option is selected by default.
Number of skipped volumes
This option allows to remove volumes entirely (also from 4D datafiles, from which the data is actually removed!) to deal with the fact that the T2* contrast takes a few seconds to stabilize (and not all scanners/sequences drop those initial volumes).
SPM specific settings
For the actual settings used in SPM preprocessing, please refer to the SPM manual!
fMRI quality check
This is an optional run of fmriquality, which allows to later easily assess whether or not to keep all runs per subject or to remove specific runs (or subjects) entirely from the analysis (which, in the latter case, should be replaced by additional data!).
VTC creation
In case the data is to be analyzed with BrainVoyager QX or NeuroElf's GLM computation, it is necessary to convert the preprocessed images into VTC format (at this time, at least); so this is also the default.