Pycortex is a software library that allows you to visualize fMRI or other volumetric neuroimaging data on cortical surfaces. In this fork, some code has been adapted by Chris Klink (c.klink@nin.knaw.nl) to make pycortex compatible with the NHP neuroimaging pipelines (especially NHP-Freesurfer) of the Netherlands Institute for Neuroscience. Installation
To install the stable release version of pycortex, do the following:
# create a conda environment with Python 3
# here we call it 'neuro' and assume the default Python for conda is Python 3
conda create --name neuro
# activate the virtual environment
conda activate neuro
# install some prerequisite packages
pip install numpy cython scipy h5py nibabel matplotlib Pillow numexpr tornado lxml networkx jupyter jupyterlab
pip install future scipy shapely html5lib imageio wget
# install this adapted pycortex release
git clone https://github.com/VisionandCognition/NHP-pycortex.git
cd NHP-pycortex
sudo python setup.py develop
Pycortex uses a configuration file to specify where things are saved. Edit it to make it point to where you want your files. You can check the location of the filestore after installing by running:
import cortex
cortex.database.default_filestore
And you can check the location of the config file by running:
import cortex
cortex.options.usercfg
If you want to move the filestore, you will need to update the config file:
[basic]
filestore=/abs/path/to/filestore
Pycortex documentation is available at https://gallantlab.github.io/pycortex. You can find many examples of pycortex features in the pycortex example gallery. These examples are also present in this repository. In examples
you can find python code you can execute in IPython. In example-notebooks
you will find Jupyter notebooks with the same examples.
In order to make pycortex work with our NHP data we make several small changes to the code. These changes are documented here.
If you use pycortex in published work, please cite the pycortex paper:
Gao JS, Huth AG, Lescroart MD and Gallant JL (2015) Pycortex: an interactive surface visualizer for fMRI. Front. Neuroinform. 9:23. doi: 10.3389/fninf.2015.00023
Please post on NeuroStars with the tag pycortex
to
ask questions about how to use Pycortex.
- Klink et al. (2021) Population receptive fields in non-human primates from whole-brain fMRI and large-scale neurophysiology in visual cortex. eLife, DOI: 10.7554/eLife.67304
- Messinger et al. (2021). A collaborative resource platform for non-human primate neuroimaging. NeuroImage, 226, 117519. DOI: 10.1016/j.neuroimage.2020.117519