Use our efficient False Belief Localizer

This script will identify brain regions involved in Theory of Mind and social cognition in individual participants, by contrasting activation during false-belief stories, in which characters have incorrect beliefs about the state of the world, with activation during false-photograph stories, in which a photograph, map or sign depicts a world state that is misleading or outdated. The experiment takes under 10 minutes of scan time to be run in its entirety and was designed based on the item analysis reported by Dodell-Feder et al., 2010.

To run this script, you need Matlab and the PsychToolbox.

Note: If you use this localizer, please credit David Dodell-Feder, Nicholas Dufour, and Rebecca Saxe.


  • subjID: STRING The string you wish to use to identify the participant. “PI name”_”study name”_”participant number” is a common convention. This will be the name used to save the files.
  • run: NUMBER The current run number. (e.g., 1).

Example usage: 


The script outputs a behavioural file into the behavioural directory. This contains information about the IPS of the scan, when stories were presented, reaction time, and response info. It also contains information necessary to perform the analysis with SPM. The file is saved as

In the event of a crash, the script creates a running behavioural file of partial data after each trial.


  1. Belief (stimuli 1b to 10b)
  2. Photo (stimuli 1p to 10p)


The run length can be calculated according to the following:
(blocks per run)*(fixation duration + story duration)+(fixation duration)

The phrases used above are related to the variable values according to the following:
trials per run = trialsPerRun
fixation duration = fixDuration
story duration = storyDur

The default configuration is:
(10 trials per run) * (12 sec fixation + 14 sec story) + (12 sec fixation) =
10 * (12 + 14) + 12 = 272 seconds, 136 ips (given 2 sec TR).


Note 1
Make sure to change the inputs in the ‘Variables unique to scanner/computer’ section of the script.

Note 2
The use of intersect(89:92, find(keyCode)) determines if the keystroke found by KbCheck is one of the proper response set. Of course, these intersection values are a consequence of the workings of our MRI response button. Your response button may differ. Use KbCheck() to determine which button pushes from the response box correspond to numbers 1:4. Otherwise, you may not retain any behavioural data.

Note 3
For simplicity, we have set up the experiment so that the order of items and conditions is identical for every subject – they see design 1 in run 1, with stimuli 1 – 5 form each condition, in that order. In our own research, we typically counterbalance the order of items within a run, and the order of designs across runs, across subjects (so half of our participants see design 1 in run 2). If you are comfortable enough with matlab, we encourage you to add this counterbalancing back into the experiment – and make sure to save separate variables for each subject tracking the order of items and conditions across runs.

We analyze this experiment by modelling each trial as a block with a boxcar lasting 14 seconds, during the whole period from the initial presentation of the story to the end of the question presentation. These boxcars are flanked by non-jittered rest periods of 12 seconds each (the fixation duration in the script). While we have analyzed the statement and question periods separately, we have found that the outcomes are nearly identical, due to the BOLD signal being predominantly due to participants reading and encoding the text, rather than answering the questions.

Analysis consists of five primary steps:

  1. Motion correction by rigid rotation and translation about the 6 orthogonal axes of motion.
  2. (optional) Normalization to the SPM template.
  3. Smoothing, FWHM, 5 mm smoothing kernel if normalization has been performed, 8 mm otherwise.
  4. Modeling
    • Each condition in each run gets a parameter, a boxcar plot convolved with the standard HRF.
    • The data is high pass filtered (filter frequency is 128 seconds per cycle)
  5. A simple contrast and a map of t-test t values is produced for analysis in each subject. We look for activations thresholded at p < 0.001 (voxelwise) with a minimum extent threshold of 10 contiguous voxels.

Random effects analyses show significant results with n > 10 participants, though it should be evident that the experiment is working after 3 – 5 individuals.

SPM Parameters

If using scripts to automate data analysis, these parameters are set in the SPM.mat file prior to modeling or design matrix configuration.

SPM.xGX.iGXcalc = {‘Scaling’} — global normalization: OPTIONS: ‘Scaling’|’None’
SPM.xX.K.HParam = filter_frequency — high-pass filter cutoff (secs) [Inf = no filtering]
SPM.xVi.form = ‘none’ — intrinsic autocorrelations: OPTIONS: ‘none’|’AR(1) + w’ = ‘hrf’ — Basis function name
SPM.xBF.T0 = 1 — reference time bin
SPM.xBF.UNITS = ‘scans’ — OPTIONS: ‘scans’|’secs’ for onsets
SPM.xBF.Volterra = 1 — OPTIONS: 1|2 = order of convolution; 1 = no Volterra

Download & Installation

  1. To download the script and its associated stimuli, click here [version: Sep 7, 2011]
  2. Extract the folder.
  3. From within matlab, cd into the extracted folder
  4. Type ‘setup’ and follow the onscreen instructions