Analysis code for "The neural representation of personally familiar and unfamiliar faces in the distributed system for face perception" by Visconti di Oleggio Castello, Halchenko, et al., 2017, Scientific Reports
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
notebooks
LICENSE.md
README.md
Singularity
compute_dsmroi_firstlev.py
ev_roi_clf.py
expdir.py
fmri_ants_openfmri.py
group_multregress_openfmri.py
hmax_familiarvsunfamiliar-id.Rmd
hmax_familiarvsunfamiliar-id.nb.html
make_unionmask.py
mds_betweenwithin_corr.Rmd
mds_betweenwithin_corr.nb.html
mds_rois.py
permutation_testing_ev.Rmd
permutation_testing_ev.nb.html
pymvpa2cosmo.py
pymvpa_hrf.py
requirements.txt
run_sl.py
run_tfce_mvdoc_fx.m
stack_betas.py

README.md

Analysis scripts for "The neural representation of personally familiar and unfamiliar faces in the distributed system for face perception"

This repository contains preprocessing and analysis scripts for Visconti di Oleggio Castello, M., Halchenko, Y. O., Guntupalli, J. S., Gors, J. D., & Gobbini, M. I. (2017). The neural representation of personally familiar and unfamiliar faces in the distributed system for face perception. Scientific Reports, 7(1), 12237. https://doi.org/10.1038/s41598-017-12559-1

The dataset is available through DataLad. Once datalad is installed in your system, you can get the data with

# install the dataset without downloading any data
datalad install -r ///labs/gobbini/famface
# download the data
datalad get famface

NOTA BENE: The latest release of this dataset is in BIDS format, however the scripts are still configured to run with the old OpenfMRI format. You can checkout the old file structure as follows

cd famface/data
git checkout openfmri-v1.0.0

Setting up the environment

We recommend using either a NeuroDebian virtual machine, or a container (Docker or Singularity) with NeuroDebian installed to replicate these analyses. In particular, the Python scripts might rely on specific versions of python packages. For example, the preprocessing script fmri_ants_openfmri.py won't work with newer versions of Nipype (> 0.11.0) because of recent refactoring. We kept track of the versions of the most important Python packages in the requirements.txt file. If you're using conda, you can get started as follows:

conda create --name famface python=2.7
pip install -r requirements.txt

You should also have FSL and ANTs installed.

Using the singularity image

We provide a Singularity definition file that can be used to build a container with all the necessary packages to run the analyses (except MATLAB--testing in progress with Octave).

Once Singularity is installed on your system, the image can be built as follows (assuming singularity 2.4.x)

sudo singularity build famface.simg Singularity

alternatively, the image can be pulled from Singularity Hub with

singularity pull --name famface.simg shub://mvdoc/famface

Inside the container we provide the mountpoints /data and /scripts, so for example one could run the preprocessing for one participant as follows

singularity run -e -c \
  -B $PWD:/scripts \
  -B /path/to/famface:/data \
  famface.simg \
  python /scripts/fmri_ants_openfmri.py \
     -d /data/data -s sub001 \
     --hpfilter 60.0 \
     --derivatives \
     -o /data/derivatives/output \
     -w /data/workdir -p MultiProc

Here we are assuming that /path/to/famface is the path to the famface directory as pulled from datalad, which contains a data directory. Note that all the paths passed to the script need to be relative to the filesystem inside the container.

Running the following will instead enter the container for interactive analyses:

singularity run -e -c \
  -B $PWD:/scripts \
  -B /path/to/famface:/data \
  famface.simg 

Please note that some paths in the scripts might be hardcoded, so they need to be changed prior to running the scripts.

Preprocessing and GLM modeling

  • fmri_ants_openfmri.py: nipype pipeline to perform preprocessing (spatial normalization to MNI 2 mm using ANTs, first and second level univariate analysis using FSL). Based on the example with the same name from stock Nipype
  • pymvpa_hrf.py: script to run a GLM using PyMVPA and Nipy, to extract betas used for multivariate analysis
  • make_unionmask.py: script to make a union mask
  • stack_betas.py: script to stack betas for multivariate analysis

Analysis

GLM

  • group_multregress_openfmri.py: nipype pipeline to perform third (group) level univariate analysis with FSL. Based on the pipeline provided by Satra Ghosh and Anne Park (our thanks to them!)

MVPC

Similarity of Representational Geometries

Auxiliary and miscellaneous files

Response to Reviewers