Functional localizer experiment used to define category-selective cortical regions (published in Stigliani et al., 2015)
Notes:
The code in this package uses functions from Psychtoolbox-3 and is compatible with MATLAB R2016b and later versions. The repetition time (TR) of fMRI data for the localizer experiment must be a factor of its block duration (6 s by default).
Contents:
This repository contains stimuli and presentation code for a functional localizer experiment used to define category-selective cortical regions that respond preferentially to faces (e.g., fusiform face area), places (e.g., parahippocampal place area), bodies (e.g., extrastriate body area), or printed characters (e.g., visual word form area).
The localizer uses a mini-block design in which 12 stimuli of the same category are presented in each 6 second block (500 ms/image). For each 4 minute run, a novel stimulus sequence is generated that randomizes the order of five stimulus conditions (faces, places, bodies, characters, and objects) and a blank baseline condition. We recommend collecting at least 4 runs of data per subject (16 minutes total) to have sufficient power to define regions of interest.
Each of the five stimulus conditions in the localizer is associated with two related image subcategories with 144 images per subcategory (see ~/fLoc/stimuli/
for entire database):
- Bodies
- body — whole bodies with cropped heads
- limb — isolated arms, legs, hands, and feet
- Characters
- word — pronounceable pseudowords (adapted from Glezer et al., 2009)
- number — uncommon strings of digits
- Faces
- adult — portraits of adult faces
- child — portraits of child faces
- Objects
- car — four-wheel motor vehicles
- instrument — musical string instruments
- Places
- house — outdoor views of buildings
- corridor — indoor views of hallways
The specific image categories packaged with the localizer were selected to contain common sets of parts, such that all images from a given category are different configurations of the same basic components. This is intended to minimize differences in within-category similarity across image sets.
To normalize the low-level properties of stimuli from different categories, we placed each exemplar on a phase-scrambled version of another randomly selected image from the database. We also matched the mean luminance and histograms of grayscale values of each image using the SHINE toolbox (see Stigliani et al. (2015) for more details).
The localizer code will prompt you to select which stimulus set to use when executing the experiment. You can further customize which image categories to include by editing the fLocSequence
class file (see below for more details). Three options are provided by default:
Default categories | ||||||
---|---|---|---|---|---|---|
Bodies: body |
||||||
Characters: word |
||||||
Faces: adult |
||||||
Objects: car |
||||||
Places: house |
Alternate categories | ||||||
---|---|---|---|---|---|---|
Bodies: limb |
||||||
Characters: number |
||||||
Faces: child |
||||||
Objects: instrument |
||||||
Places: corridor |
Both categories | ||||||
---|---|---|---|---|---|---|
Bodies: body limb |
||||||
Characters: word number |
||||||
Faces: adult child |
||||||
Objects: car instrument |
||||||
Places: house corridor |
To ensure that participants remain alert throughout the experiment, a behavioral task is selected while executing the localizer code. Three options are available:
- 1-back — detect back-to-back image repetition
- 2-back — detect image repetition with one intervening stimulus
- Oddball — detect replacement of a stimulus with scrambled image
Task probes (i.e., image repetitions or oddballs) are inserted randomly in half of the stimulus blocks. By default participants are alloted 1 second to respond to a task probe, and responses outside of this time window are counted as false alarms.
Behavioral data displayed at the end of each run summarize the hit rate (percentage of task probes detected within the time limit) and the false alarm count (number of responses outside of task-relevant time windows).
Follow the instructions below to setup the localizer code for your computer and equipment and then execute the experiment using the runme
function (~/fLoc/runme.m
).
- Clone fLoc repository on the computer you will use to present stimuli, and navigate to the functions directory (
~/fLoc/functions/
). - Modify the input registration functions for your local keyboard, button box, and trigger (optional):
- get_keyboard_num.m — Change value of
keyboard_id
to the "Product ID number" of your local keyboard (line 9) - to get "Product ID number" enter PsychHID(‘Devices’) in the command window - then enter ans.productID - the number output should be input as 'keyboard_id' in line 9 - get_box_num.m — Change value of
box_id
to the "Product ID number" of the button box used at your scanner facilities (line 9) - start_scan.m — Change specifications to be compatible with your local trigger box (line 6)
- get_keyboard_num.m — Change value of
- Add Psychtoolbox to your MATLAB path.
- Navigate to base experiment directory in MATLAB (
~/fLoc/
). - Execute the
runme
wrapper function and enter the following information when prompted:- Participant's initials or other session-specific identifier
- Triggering option:
- Enter
0
if not attempting to trigger scanner (e.g., while debugging) - Enter
1
to automatically trigger scanner at onsets of experiments
- Stimulus set:
- Enter
1
for the default set (body, word, adult, car, house) - Enter
2
for the alternate set (limb, number, child, instrument, corridor) - Enter
3
for both sets (presented in alternation in separate runs)
- Number of runs to execute
- Task for participant:
- Enter
1
for 1-back image repetition detection - Enter
2
for 2-back image repetition detection - Enter
3
for oddball detection
- Wait for task instructions screen to display.
- Press
g
to start experiment (and trigger scanner if option is selected). - Wait for behavioral performance to display after each run.
- Press
g
to continue experiment and start execution of next run.
- Press
[Command + period]
to halt experiment on a Mac or[Ctrl + period]
on a PC. - Enter
sca
to return to MATLAB command line. - Please report bugs on GitHub.
- On Gennari: '[Option + command + esc]' to quit the performance window after run is complete
The runme
wrapper function generates an object session
of the class fLocSession
that is used to both run the experiment and store information about the participant, stimulus, and task performance. This generates a custom stimulus sequence for each run of the experiment that is stored in an object seq
of the class fLocSequence
. Class files in ~/fLoc/functions/
can be edited to customize the experimental design.
Data files are saved in session-specific subdirectories in ~/fLoc/data/
that are labeled with ID strings concatenating the session name, date, task, and number of runs (e.g., AS_09-Aug-2017_oddball_4runs
).
- Each data subdirectory stores
.mat
files suffixed with_fLocSession.mat
(which contain session information) and_fLocSequence.mat
(which contain stimulus information). - Data subdirectories also contain stimulus parameter (
.par
) files that are used for analyzing fMRI data (.par
files are written in a format compatible with vistasoft by default).
The runme
function in the base experiment directory will prompt the experimenter for session information when called without input arguments. Alternatively, you can specify these settings in advance by including the following input arguments:
- name — session-specific identifier (e.g., participant initials)
- trigger — option to trigger scanner (0 = no, 1 = yes)
- stim_set — stimulus set to use (1 = default, 2 = alternate, 3 = both)
- num_runs — number of runs (stimuli repeat after two runs per set)
- task_num — which task to use (1 = 1-back, 2 = 2-back, 3 = oddball)
- start_run — run number to begin with (if experiment is interrupted)
As described in more detail below, if the experiment is interupted you can also load the participant's *_fLocSession.mat
file from their data directory and enter run_exp(session, start_run)
to execute all runs from start_run to num_runs.
To customize which image subcategory is used for each stimulus condition, edit the fLocSequence
class file as detailed below:
- Add a property to the
fLocSequence
class file calledstim_set3
that lists a one subcategory for each condition in the propertystim_conds
. For example:
stim_set3 = {'limb' 'word' 'adult' 'car' 'corridor'};
- Insert an additional case switch in
fLocSequence
'sget.run_sets
method for your custom selection of subcategories. For example:
case 4
run_sets = repmat(seq.stim_set3, seq.num_runs, 1);
- Modify the
stim_set
argument check in therunme
function to include your custom option. For example:
while ~ismember(stim_set, 1:4)
stim_set = input('Which stimulus set? (1 = standard, 2 = alternate, 3 = both, 4 = custom) : ');
end
We strongly recommend including each of the five main stimulus conditions in the localizer (bodies, characters, faces, objects, places) regardless of the specific region/s you are interested in defining, as this provides a stronger test of selectivity compared to only comparing responses between a few categories.
To include other stimulus conditions in the localizer, create a new fork of the repository and follow the instructions below:
- Add a new image category to the stimulus database:
- Collect 144 examples of a new stimulus category of your choice (e.g.,
hammer
for the condition Tools). - Control low-level image properties (luminance, contrast, visual field coverage, etc.) to minimize differences with existing categories.
- Generate image filenames composed of a category label and image number delimited by a dash (e.g.,
hammer-144.jpg
). - Place stimuli in a separate directory in
~/fLoc/stimuli/
named after the image category.
- Collect 144 examples of a new stimulus category of your choice (e.g.,
- If introducing a new stimulus condition to the localizer (e.g., Tools), append the name of the condition to the cell array of conditions labels in the
fLocSequence
propertystim_conds
. - Include the name of the new image category (e.g.,
hammer
) in the corresponding index of the cell arrays of image cagegory labels in thefLocSequence
propertiesstim_set1
andstim_set2
(or create a newstim_set3
property as described above). - Note that changing the number of stimulus conditions will affect dependent properties of the
fLocSequence
class such as run duration (run_dur
).
Other aspects of the experimental design can be modified by changing constant properties in the fLocSequence
class file.
- Stimulus duty cycle — the duration of each stimulus cycle (stimulus duration + interstimulus interval) is set in
stim_duty_cycle
. - Stimuli per block — the number of stimuli in a block is set in
stim_per_block
. This parameter will also affect dependent properties such as run duration (run_dur
). - Interstimulus inverval — the duration of the interstimulus interval is set depending on task in
fLocSequence
'sget.isi_dur
method.
To analyze fMRI data from the localizer experiment using functions from vistasoft:
- Clone the vistasoft and fLoc repositories on your machine and add to your MATLAB path.
- Put all fMRI data files (
.nii.gz
) in the appropriate session directory in~/fLoc/data/
with session-specific stimulus parameter (.par
) files (e.g.,~/fLoc/data/s01/script_fLoc_run1.par
):- fMRI data file names should end with
_run#.nii.gz
with run numbers incrementing from one (e.g.,~/fLoc/data/s01/fLoc_run1.nii.gz
). - Stimulus parameter files should end with
_run#.par
with run numbers incrementing from one (e.g.,~/fLoc/data/s01/script_fLoc_run1.par
).
- fMRI data file names should end with
- Optionally, put anatomical MRI scans (
.nii.gz
) in the same session directory:- An anatomical inplane scan named
*Inplane*.nii.gz
should be included if possible (e.g.,~/fLoc/data/s01/Inplane.nii.gz
). - A high-resolution whole-brain scan named
t1.nii.gz
can also be included in a3Danatomy
subfolder (e.g.,~/fLoc/data/s01/3Danatomy/t1.nii.gz
).
- An anatomical inplane scan named
- The function
fLocAnalyis
automates the following data processing and analysis procedures for a single session:- Initialize vistasoft session directory in
~/fLoc/data/[session]
. - Perform slice timing correction (assuming interleaved slice acquisition).
- Perform within-run motion compensation (and check for motion > 2 voxels).
- Perform between-runs motion compensation (and check for motion > 2 voxels).
- Fit GLM in each voxel across all runs of the localizer.
- Generate vistasoft-compatible brain maps of the following model parameters:
- GLM betas (one map file per predictor in GLM design matrix)
- Residual variance of GLM (one map file per session)
- Proportion of variance explained (one map file per session)
- Default statistical contrasts comparing betas for each condition vs. all other conditions (one map per non-baseline condition).
- Initialize vistasoft session directory in
- To run the automated fMRI data analysis pipeline for a single session, use
fLocAnalysis(session, init_params, glm_params, clip, stc)
with the following arguments:- session — full path to session directory to analyze (char array).
- init_params — optional struct of initialization/preprocessing parameters (struct).
- glm_params — optional struct of GLM analysis parameters (struct).
- clip — number of TRs to clip from the beginning of each localizer run (int).
- stc — flag controlling slice time correction (logical; default = 0, no correction).
- A log file named
fLocAnalysis_log.txt
is written in each session directory as the analysis progresses. This log file contains a high-level description of completed stages of the analysis. - To run the automated analysis pipeline across a group of sessions, use
fLocGroupAnalysis(sessions, clip, stc)
with the following arguments:- session — full path to session directory to analyze (char array).
- clip — number of TRs to clip from the beginning of each localizer run (int).
- stc — flag controlling slice time correction (logical; default = 0, no correction).
- For group analysis, a log file named
vistasoft_log.txt
is also written in each session directory. This log file captures vistasoft outputs otherwise printed to the command line. - To view a parameter map overlaid on the subject's anatomy:
- Navigate the to the appropriate session data directory.
- Enter
mrVista
in the command line to open a vistasoft inplane view. - Change the Data Type (upper-right menu in GUI) from Original to GLMs.
- Click File -> Parameter Map -> Load Parameter Map and select a
.mat
file from the session GLMs directory (e.g.,~/fLoc/data/s01/Inplane/GLMs/face_vs_all.mat
).
Note for VPNL users: If analyzing MUX data from the CNI, always clip 2 TRs from beginning of each run. For non-MUX data, clip (countdown duration)/(TR duration) TRs from each run. In both cases, stimulus parameter files begin at the end of the countdown.
Stimulus parameter (.par
) files saved in session data subdirectories contain information needed to generate the design matrix for a General Linear Model (GLM):
- Trial onset time (time relative to the start of the experiment in seconds)
- Condition number (0 = baseline)
- Condition name
- Condition plotting color (RGB values from 0 to 1)
After acquiring and preprocessing functional data, a General Linear Model (GLM) is fit to the time series of each voxel to estimate β values of response amplitude to different stimulus categories (e.g., Worsley et al., 2002). For preprocessing we recommend performing motion correction, detrending, and transforming time series data to percent signal change without spatial smoothing.
Category-selective regions are defined by statistically contrasting β values of categories belonging to a given stimulus domain vs. all other categories in each voxel and thresholding resulting maps (e.g., t-value > 3):
- Character-selective regions
- Body-selective regions
- Face-selective regions
- Place-selective regions
- Object-selective regions
- [
car
instrument
] > [word
number
body
limb
child
adult
corridor
house
] - selective voxels are not typically clustered in occipitotemporal cortex when contrasted against characters, bodies, faces, and places
- object-selective regions in lateral occipital cortex can be defined in a separate experiment (contrasting objects > scrambled objects)
- [
Lateral Occipital Cortex | Posterior Ventral Temporal Cortex | Mid Ventral Temporal Cortex |
---|---|---|
Category-selective regions defined in three anatomical sections of occipitotemporal cortex are shown above on the inflated cortical surface of a single subject with anatomical labels overlaid on significant sulci and gyri (see reference to labels above). Green: place-selective, Blue: body-selective, Black: character-selective, Red: face-selective.
To acknowledge using our localizer or stimulus set, you might include a sentence like one of the following:
"We defined regions of interest using the fLoc functional localizer (Stigliani et al., 2015)..."
"We used stimuli included in the fLoc functional localizer package (Stigliani et al., 2015)..."
Stigliani, A., Weiner, K. S., & Grill-Spector, K. (2015). Temporal processing capacity in high-level visual cortex is domain specific. Journal of Neuroscience, 35(36), 12412-12424. html | pdf
Anthony Stigliani: astiglia [at] stanford [dot] edu
Kalanit Grill-Spector: kalanit [at] stanford [dot] edu