Analysis & voxel-time-course simulation code for: Behavior-dependent directional tuning in the human visual-navigation network. Nau, Navarro Schröder, Frey, Doeller. 2020. Nature Communications
This code simulates voxel time courses, builds various encoding models of virtual head direction (vHD), trains them using cross-validated ridge regression, and finally tests them on held-out data. The model also estimates the vHD-tuning width for each voxel (similar to population receptive field mapping). Requires SPM12.
Click HERE for a visual depiction of the pipeline.
- Download code
- Open the script: "vHD_simulation.m"
- Set path to SPM
- Adjust the number of parallel workers to match your computer specs
- Click "run"
To get a first immpression, I recommend reducing the number of voxels for the first runs to speed tings up.
The code makes use of the navigation data of a sample participant. The log file contains two relevant variables: "headDir", the virtual head direction over time (higher temporal resolution than the imaging data) and "TR_idz", the linear indizes corresponding to each value in headDir split into TRs/functional images. The file contains data of all 5 scanning runs.
The script will visualize the results of the simulations as shown in the paper's SFig. 4C.
You can easily adapt this simulated code for new fMRI-data analyses by replacing the simulated voxel time courses for real ones (e.g. taken from an ROI). In this case, preprocess & clean your data beforehand incl. nuisance regression of head- motion parameters...).
If you have any comments or questions, please reach out to me: matthias.nau[at]nih.gov