The official website for SPM can be found here.
This page describes the processes used to analyse fMRI data using SPM in its GUI mode.
The output files from a scan are not in a format that can be processed by SPM, so they have to be converted to the DICOM format. This can be done using SPM, or a seperate package such as MRI convert.
a. DICOM Converstion using SPM
- Click "Batch" button. Navigate to the "SPM" dropdown menu, hover over the "Util" sub-heading and click on "DICOM Import"
- Under "DICOM files", select your fMRI images.
- Under "Output directory", select the folder you want the reconstructed images to be saved into.
- Under the "Output image format" options, select the "Single file (nii) NIfTI" format
- Click the play button at the top
b. DICOM Converstion using MRI convert
- To the right of the top box in MRI convert, click "Add folder". Navigate to your scan folders, and select all of the runs that you want to analyse.
- From the dropdown menu between the two boxes, select NIfTI.
- To the right of the bottom box click "Options" and ensure that only the options checked in the check boxes are items you want in your converted files' filenames. Also ensure that "Save each subject in a seperate directory", "Save each series in a seperate directory" and "Save as .nii file" are all checked.
- Click "Directory" to select your output directory, and then click "Convert all."
COREGISTERING ANATOMICAL TO TEMPLATE
Coregistration refers to the spatial alignment of a series of images. The subject's T1 anatomical image needs to be coregistered to the T1 template at the start of pre-processing the scan data. Further coregistration is done later on in the process, using images from each run of the scan.
- On the SPM menu, click "Coregister," and from the drop-down menu select "Est and Res" (estimate and reslice).
For the "Reference Image", navigate to the following path: Documents --> MATLAB --> spm8 --> templates, and select the T1.nii file.
- For the "Source image", navigate to the folder containing the subject's T1 anatomical image (labelled mprage), and select the image file.
- Leave all the other settings as they are, save and run the batch.
- The newly coregistered image should be saved in the mprage folder.
Each run of each scan contains a few dummy runs in the beginning of the scan, which should be kept seperate from the rest of the data as it can have an influence on later processing.
The next step is realignment (aka motion correction). This step registers all the images of a specified run from one subject to each other, and gives us information regarding how much the subject moved their head during the scan. This information is later used to ensure that functional images are accurately mapped onto structural ones.
- On the SPM menu, click "Realign," and from the drop-down menu, select "Est and Res".
- Under the "Data" heading, use the "Session" file selector to select all the converted DICOM files of the specified run for the subject.
- For "Estimation options," "Quality" controls the quality of the images generated, on a range of 0 to 1. The "Interpolation" option also increases quality of images, with higher degree B-Spline options producing higher quality images. This should be changed to a minimum of "4th Degree B-Spline." The rest of the "Estimation Options" can be left as they are.
- Under "Reslice Options," the "Resliced Images" option should be changed to "Mean Image only". The rest of the options can be left as they are. Save and run the batch.
- Repeat for all images in each run of the scan.
This step of coregistration is slightly different from the one completed previously; here, we coregister each image of a run to the coregistered image we generated earlier.
- For the "Reference Image," navigate to the anatomical image folder, where the coregistered anatomical image should be saved (the file starting with r), and select it.
- For the "Source Image," navigate to the folder of the run you want to coregister and select the mean image that was generated during the realignment phase (the file starting with the word "mean").
For the "Other images," select the whole series of images EXCEPT the mean image.
- The rest of the options can be left as they are. Save and run the batch. Repeat for each run.
Add a section in for this around here.
Spatial smoothing is a tool used to cope with functional anatomical variability not compensated by normalisation and improves the signal to noise ratio.
- On the SPM menu, click the "Smooth" button.
For the "Images to smooth" section, navigate to a folder containing one run of subject, and select all of the riles with the prefix "r" EXCEPT the mean images. These "r" prefix images were generated during the coregistration step.
- "FWHM" refers to the size of voxel that you want to smooth. This can be changed according to your study (but should be the same in each run). We tend to use "6 6 6".
- Leave the other options as they are and run the batch.
- Click the "Specify 1st-level" button on the SPM interface.
- For the directory, navigate to the folder where you want your statistical analysis to be output. Put some run information in the folder name, so you can identify folders with specific analyses later.
- For the "Units of design," select seconds. For the interscan interval, enter the duration of each of your scans in seconds (usually 1s for multiband and 2.5s for non-multiband but check the specific durations for your experiment).
Under "Data & Design," select "New:Subject/session," and for "Scans," select the newly smoothed files, which have the "s" prefix (make sure the mean files are not selected). Under "Conditions," select "New:Condition."
Each condition of a study is represented by a "New:Condition" option. For example, if you are analysing left hemisphere actiavtion vs right hemisphere activation in the visual cortex, You would name your condition left or right, set stimulus onsets and durations for each condition depending on your study. The "Time modulations" and "Parametric Modulations" options can be left unchanged, as can all of the following options.
- Once the conditions are set up, save and run the batch.
- For this step, click "Estimate" on the SPM menu, and select the SPM.mat file you just generated from the folder you saved it in.
- Leave the other options as they are and run the batch.
- Click the results button on the SPM interface. Navigate to the folder where your estimated SPM.mat file is saved and select it.
In the SPM contrast manager, click "Define new contrast..." For this example, where we continue the comparison between left and right hemisphere visual cortex activation, one of the contrasts will be left vs. right. Assuming that the left visual stimulus was onset before the right, the design matrix should be named "Left > Right", and filled as 1 -1. After entering these values in the box, press submit, and the design matrix in the dialogue box should highlight the targetted contrasts. Then click OK.
Now select your Left > Right contrast and press "Done.
- On the results window, select "none" for "apply masking," hit enter when the title for comparison is shown, press none for the "p value adjustment," decide on the threshold p value (eg. 0.001), and the number of voxels you want in your extent threshold (eg. 5).
- To see activation over a 3D image of the subject's brain, click overlay, and select your co-registered mprage anatomical image.