Skip to main content Skip to navigation

A Worked fMRI Example

In this section, we analyze with the SwE toolbox a reapeated-measures fMRI dataset from

Henson, R.N.A, Shallice, T., Gorno-Tempini, M.-L. & Dolan, R.J (2002). Face repetition effects in implicit and explicit memory tests as measured by fMRI. Cerebral Cortex, 12, 178-186.

The same dataset has also been analyzed by SPM in Section 30.4 of the SPM8 manual (the manual and the dataset can be found here). More precisely, the dataset consists of 36 contrast images obtained after using an "informed" basis set (consisting of the canonical HRF and its two partial derivatives with respect to time and dispersion) in single-subject fMRI analyses applied on 12 subject fMRI scans.


The analysis with the SwE toolbox

Here, we assume that the SwE toolbox has already been downloaded and installed correctly (see the manual if it is not the case).

To start the toolbox, type swe in the MATLAB command window and the following GUI should appear:swe_gui.png

Press the "Specify model" button of the SwE GUI and the following batch system with the SwE module "Data & Design" already loaded should appear:

Batch

Highlight the field "Directory", press the button "Select files" and select the directory where the files of the analysis will be created.

Highlight the field "Scan", press the button "Select files" and select in numerical order the 36 contrasts images (con_0003.img, con_0004.img,..., con_0038.img) that can be found in the folder "cons_informed" of the downloaded file "face_rfx.zip". Note that the ordering of the scans is important as other variables (Groups, Visits and Subjects) must follow the same ordering. The correspondance of each of these scans is shown in the following table:

  Canonical HRF Temporal derivative Dispersion derivative
Subject 1 con_0003.img con_0015.img con_0027.img
Subject 2 con_0004.img con_0016.img con_0028.img
Subject 12 con_0014.img con_0026.img con_0038.img

For our example, we may assume that all the subjects share a common covariance matrix. Therefore, highlight the field "SwE type" and select the "modified SwE". Then, highlight the field "Groups", press the "Edit value" button and enter a vector of 1 by, for example, using the MATLAB command ones(36,1).

Highlight the field "Visits", press the "Edit value" button and enter a vector of visit/repeated-measure categories. For our example, there are 3 repeated-measures categories corresponding to the canonical HRF, the temporal derivative and the dispersion derivative. This can be specified by using the MATLAB command kron((1:3),ones(1,12)).

Highlight the field "Small sample adjustments" and select the type of bias corrective factor to be applied to the residuals prior their use in the estimation of the SwE. As the simulations in Guillaume et al. (in submission) tend to show that the "type 3" is generally preferable, select "type 3" in the menu.

Highlight the field "Degrees of freedom type" and select the "approx" option.

Highlight the field "Subjects", press the "Edit value" button and specify the vector of subjects. In our example, this can be done by using the MATLAB command kron(ones(1,3),1:12).

Highlight the field "Covariates", press "New: Covariate", highlight the field "Vector", press the "edit value" button and enter your first covariate. Then, highlight the field "Name", press the "edit value" button and enter a name for your first covariate. This process can be repeated several times to add all the covariates needed to construct the design matrix. In our example, 3 covariates defining the canonical HRF, the temporal derivative and the dispersion derivative can be specified by entering the following MATLAB commands: kron([1 0 0],ones(1,12)), kron([0 1 0],ones(1,12)) and kron([0 1 0],ones(1,12)), respectively.

The remaining fields are similar to a classic SPM batch job and can be let unchanged for our example. The batch window should then look like this:

Bath final

Finally, push the green "Run Batch" button. An SwE.mat file containing all the information related to the data and design should then be created in the specified working directory and the following window showing the design matrix should appear:

Design matrix

To start estimating the parameters of this specified model, press the button "Run model" of the SwE GUI and select the SwE.mat file just created. The toolbox should then compute all the estimates needed for the analysis and update the SwE.mat file.

Once the computation is done, press the "Results" button of the SwE GUI and select the updated SwE.mat file. The toolbox should then open the following SwE contrast manager allowing the test of several contrasts:

SwE contrast manager

In the contrast manager, press "Define new contrast", select F-contrast in the "type" section, enter the MATLAB command eye(3) in the "contrast" section, enter "Faces vs Baseline: Informed" in the "name" section and press the "OK" button. This contrast will reveal voxels that exhibit some form of event-related responses captured by at least one of the three basis functions.

Now, press the "Done" button in the SwE contrast manager, press the "none" button (section "apply masking"), accept "Faces vs Baseline: Informed" as title for comparison and the toolbox will compute the inferences images (i.e. the F-score image spmF_0001.img, the equivalent chi-squared-score image spmX_0001.img and the degrees of freedom image edf_0001.img) in the working directory. Note that it can take several minutes for F-contrasts with a rank superior to 1, like it is the case here.

Once the computation is done, press the "FDR" button, validate "0.05" as a FDR p-value, validate "0" as extent threshold and the toolbox should display the following result:

result1

Note that, like this, it is difficult to visualise where the effects are exactly. Therefore, in order to see better which areas of the brain are activated, you can press the "whole brain" button and a list summarising the most important activations in the brain should appear:

result2

You can also select "sections" in the "overlay" menu and select the image single_subj_T1.nii situated in the subfolder "canonical" of your SPM8 or SPM12 main folder. You should then get the following display:

result3

You can navigate through it in order to see more pricesely the areas of activation. Note that you may also want to impose a more restrective threshold. To do so, go into "Contrasts" > "Significance level" > "Change..." as shown below:

result4

Then, you can reselect an FDR correction (button "FDR"), change the significance level (e.g., 0.01) and eventually the extent threshold (e.g., 10 voxels) or select an uncorrected threshold instead (button "none").

Similarly to the SPM analysis in Section 30.4 of the SPM manual, you can test contrasts only focused on one basis function. To do so, go into "Contrasts" > "New Contrast..." and you will go back to the SwE contrast manager. There, you can specify the following contrasts:

  • t-contrast [1 0 0] (i.e. positive effects on the canonical HRF)
  • F-contrast [0 1 0] (i.e. positive or negative effects on the temporal derivative)
  • F-contrast [0 0 1] (i.e. positive or negative effects on the dispersion derivative)

and restart the procedure to compute the inference images and display the results for each new contrast.

Testing the three new contrasts and using a FDR correction at 0.05 level of significance, you should get the three following displays:

canonicaltemporaldispersion















Note here that, overall, the areas of activation obtained with the SwE method are similar to those obtained with the SPM procedure (see Section 30.4 of the SPM8 manual). Nevertheless, if we look more in details, we can observe differences between the two methods. This is mainly due to these three facts:

  1. Here, FDR corrections are used while it was Random Field Theory corrections with the SPM procedure. Note that the FDR correction can be enabled in a classic SPM analysis by setting the SPM global variable defaults.stats.topoFDR to 0 instead of 1. Note also that, in order to make a more objective comparison, one can use an uncorrected threshold (with the same significance level) for both methods and compare the results.
  2. The SPM procedure assumes and estimates a unique covariance structure for all the voxels in the brain. This can lead to invalid inferences in voxels where the true covariance structure is different from the one estimated. In contrast, the SwE estimates a different covariance matrix for each voxel, making the inferences valid for each voxel.
  3. Due to the fact that the SwE procedure estimates a covariance matrix for each voxel in the brain, more degrees of freedom have to be used compared to the SPM procedure which estimates only one unique covariance structure for the whole brain. This makes the SwE procedure less powerful than the SPM procedure.