Displaying surface files generated by neurovault

Dear experts, dear community,
can anyone give me some suggestions how to display the surface files generated with neurovault.org? When you upload a volume file (.nii), neurovault.org offers the option to convert it to a surface file (.func.gii), using the new method by Wu et al. (2018). This is really useful :slight_smile: However, I am not sure how to best display them. In particular, I wondered what is the appropriate template to overlay them on, and where I could download it (should it be a .surf.gii file?). Also, if you can recommend me a toolbox for display, that would be great. For example, I tried wb_view. Do you have other suggestions?
Many thanks for your help, and creating the great platform neurovault.org!

Those maps should work with fsaverage or fsaverage5 surfaces distributed with FreeSurfer. You can use FreeView (also part of FreeSurfer) or Connectome Workbench that you already mentioned.

Thanks for helping me out Chris!

So - if anyone is interested - this is what I did with the surfaces in workbench so far: I have downloaded the github files that Yeo’s group kindly provides (https://github.com/ThomasYeoLab/CBIG/). In there, I could find some surf.gii files in fsaverage space and 164k, at … /data/templates/surface/standard_mesh_atlases_20170508/resample_fsaverage/ …
These surfaces work for the overlay of the .func.gii files I obtained from neurvault (download as surface). As far as I can tell, this looks okay. Note, however, that this fsaverage is a spherical surface. I could not find midthickness, inflated or similar for the fsaverage with 164k. If someone has some more suggestions, I would be grateful. I still have to try it in FreeView, and probably that’s the more straightforward thing to do.



Another option is to use Surfice that can read the NeuroVault GIfTI files as well as FreeSurfer format files.

  1. Find the study (e.g. 385771) you want to view , and Download the Surface.
  2. Launch Surfice.
  3. Choose your FreeSurfer mesh the File/Open menu item. Surfice comes with the left hemisphere pial map (lh.pial) so that is what I will use here, but you can also drag-and-drop any mesh from FreeSurfer you want (e.g. fsaverage\rh.white)
  4. Choose Ovelays/AddOverlays menu item and select the GIfTI file.
  5. You may want to change the overlay intensity or shader (below I show the MatCap and Toon shaders).

Alternatively, you can write a Python script for this. Below is a minimal script, but the Scripting/Python menu provides a lot of templates:

import gl

Dear Chris (Rorden),
thanks, Surfice is super helpful! I almost made it, but then I got the message “Unable to read GIFTI overlays with ASCII data. Solution: convert to more efficient BINARY data”. I could’t figure out how to fix this, sorry. I there something I could try?
I used Surf Ice 2 - September-2019, from https://www.nitrc.org/frs/?group_id=984
Many thanks again,

@matthias_schurz I will release a new version of Surfice in the next few days to handle ASCII data. In the mean time you can use Python or Matlab to convert the data to a binary representation (Matlab conversion shown below).

@ChrisGorgolewski is there a chance that NeuroVault could store the GIfTI files in a binary representation? While the requirement for Base64 makes GIfTI binaries inherently inefficient, the speed, size and accuracy issues of ASCII make it the lesser of two evils. Below are times and file sizes for Matlab and Python. My own compiled code shows similar issues.


tic; g = gifti(‘385771.L.func.gii’); toc
tic; g = gifti(‘bin.gii’); toc
tic; g = gifti(‘gz.gii’); toc
fprintf(‘ASCII is %g larger than binary and %g larger than gz\n’, ascii.bytes/bin.bytes, ascii.bytes/gz.bytes);


Elapsed time is 0.094242 seconds.
Elapsed time is 0.014464 seconds.
Elapsed time is 0.044254 seconds.
ASCII is 2.06076 larger than binary and 2.4491 larger than gz


import nibabel as nib
import time
start = time.time()
asc = nib.load(‘385771.L.func.gii’)
print(time.time() - start)
start = time.time()
bin = nib.load(‘bin.gii’)
print(time.time() - start)
start = time.time()
gz = nib.load(‘gz.gii’)
print(time.time() - start)

results in


Thanks @Chris_Rorden, this works fine for me. After the conversion, I can display func.gii surfaces from Neurovault in SurfIce. They look great!

@matthias_schurz I have released Surfice v1.0.20200529. This should resolve your issue, and a few others:

  • Show contours for atlases and overlays (select Scripting/Python/contour menu item for demo) suggested by Ahmad Beyh, Marco Catani and Flavio Dell’ Acqua
  • Support ASCII GIfTI files
  • Support CIfTI parcellation maps
  • Support AFNI .niml.dset format
  • Linux distribution now available for GTK2 and QT5, see notes for installation.
1 Like

Many thanks again @Chris_Rorden, the new version works great here!
Best, Matthias