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!
Matthias

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/ ā€¦
fsaverage_std_sphere.L.164k_fsavg_L.surf.gii
fsaverage_std_sphere.R.164k_fsavg_R.surf.gii
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.

Best,
Matthias

Matthias-

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
gl.resetdefaults()
gl.meshload('lh.pial')
gl.overlayload('~/neurovault/385771.L.func.gii')

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

@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.

Matlab

tic; g = gifti(ā€˜385771.L.func.giiā€™); toc
save(g,ā€˜bin.giiā€™,ā€˜Base64Binaryā€™);
tic; g = gifti(ā€˜bin.giiā€™); toc
save(g,ā€˜gz.giiā€™,ā€˜GZipBase64Binaryā€™);
tic; g = gifti(ā€˜gz.giiā€™); toc
ascii=dir(ā€˜385771.L.func.giiā€™);
bin=dir(ā€˜bin.giiā€™);
gz=dir(ā€˜gz.giiā€™);
fprintf(ā€˜ASCII is %g larger than binary and %g larger than gz\nā€™, ascii.bytes/bin.bytes, ascii.bytes/gz.bytes);

Yields

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

Python

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

0.49857211112976074
0.011422872543334961
0.009885787963867188

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

@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.
2 Likes

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