Skip to content
Pycortex is a python-based toolkit for surface visualization of fMRI data
JavaScript Python C CSS C++ HTML Objective-C
Branch: master
Clone or download
MShinkle and marklescroart Fsaverage transform (#334)
Related to fsaverage transform: 
* ENH add mri_surf2surf matrix
* ENH: allow setting custom subjects_dir in mri_surf2surf
* ENH: informative outputs for calls to freesurfer functions
* ENH: added caching of surf2surf transforms in pycortex filestore (in surf2surf directory in each subject)
* ENH: added function to map vertex object from one subject (using cached transforms) to another subject via freesurfer's sphere registration. 

Not related to fsaverage, misc fixes included because this PR went on too long:
* FIX: misc python3 fixes, incl removal of fstrings and whitespace
* FIX: dict comprehension fix in anonymization code.
* ENH: update to freesurfer alignment to allow optional reference image input from intial alignment
* ENH: added output text to fs_manual() to clarify how to save transform, option for which surface to use for fs aligner.
* FIX: killed string/bytes bug w/ addition of data to cutting in blender
* ENH: Update to cut_surface to check whether fiducial vertex count matches inflated vertex count; avoids wasted work segmenting surfaces that won't flatten
* FIX: potential config-stored cache was not correctly handled in freesurfer re-import of flatmaps.
* minor changes (cleanup, simplification) to fs_align and, minor changes to function (preserving vmin, vmax, cmap)
Latest commit 3ad1939 Sep 27, 2019


Build Status

quickflat demo

Pycortex is a software library that allows you to visualize fMRI or other volumetric neuroimaging data on cortical surfaces.


python3 -m venv env  # use `virtualenv env` for python 2
source env/bin/activate
pip install -U setuptools wheel numpy cython
pip install -U git+git://

This command creates a new virtualenv for pycortex to resolve dependencies. Run source env/bin/activate whenever you need pycortex.


NEW: Massively updated documentation for pycortex is available at You can find many examples of pycortex features in the pycortex example gallery.

To build the documentation locally:

pip install sphinx_gallery
pip install numpydoc
cd docs
make html
# open `docs/_build/html/index.html` in web browser


Pycortex is best used with IPython. Install it in your virtualenv using

source env/bin/activate
pip install ipython

To run the pycortex demo,

$ ipython
In [1]: import cortex
In [2]: cortex.webshow(cortex.Volume.random("S1", "fullhead"))


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

Getting help

Please post on NeuroStars with the tag pycortex to ask questions about how to use Pycortex.

You can’t perform that action at this time.