Displaying multiple subject-specific surface electrodes on a std.141.* surface

Hello -

I’m working with some ecog data, and I’d like to display the results from all electrodes on a standard freesurfer brain.

I ran recon-all on each subject’s T1 volume in their native space, and I then mapped each patient’s CT-based electrodes to their native T1 volume using Trotta et al.'s (2017) software toolkit.

Now I would like to display the combined density of cortical electrodes on a freesurfer standard brain surface. Specifically, I tried running 3dVol2Surf based on the instructions on https://openwetware.org/wiki/Beauchamp:SurfaceAveraging

-spec fs/std.141.fs_both.spec
-surf_A lh.smoothwm
-sv t1_native.nii.gz
-grid_parent lh_ecog.nii.gz
-map_func mask
-oob_value 0
-out_niml lh_ecog.niml.dset

This creates a single patient’s electrode dataset that I can load onto any standardized (std.141.*) surface, but I’m confused as to how to combine electrode native space coordinates/datasets from multiple patients.

Thank you for your help, and sorry if I’m missing something obvious.


Since they are standard surface meshes, they have node correspondence (one node (index) is supposed to mean approximately the same location across subjects, subject to the FreeSurfer registration). That means you can combine/compare across subjects right now.

But the orig space coordinates will indeed vary. If coordinates matter, they should come from some template space, such as TLRC or MNI. But note that you can use ANY related standard mesh surface for node correspondence, including either of those template spaces. So just pick a std.141 surface from the template of your choice, such as suma_MNI152_2009.tgz. That has similar node correspondence with all of your subjects, but suddenly the coordinates mean something useful.

Does that seem reasonable?

  • rick

Hi Rick -

Thank you for the quick response. So if I understand you correctly, in order to display all electrodes at once on a standard surface, all electrode coordinates should be warped to a standard space (MNI). From there, I can then run 3dVol2Surf on the collective MNI electrodes.


Hi Pete,

No, it is much easier. By using the std.141 surfaces, you already have node correspondence. Now just display the results on an MNI surface dataset, like the one that I linked to.

Looking at your link to Mike’s openwetware site, that is what he is doing in the section “Displaying the Average Functional Data”. He copies the MNI_N27 surfaces to the results directory, and uses those standard space (not just mesh) surfaces for display of the newly created surface data. You could do something similar.

  • rick

Ah! It hadn’t dawned on me how I can use AFNI 3d* commands with *.niml.dset objects. Noice.

After performing 3dVol2Surf with each patient’s electrodes to the standard MNI surface, I combined them with:

3dcalc -a s00_lh_ecog.niml.dset -b s01_lh_ecog.niml.dset -expr 'a+b' -prefix all_lh_ecog

I then plotted that on the standard MNI surface, and it’s exactly what I wanted.


Thank you!

Hi Pete,

I’m glad this is working for you, but just want to be sure… You mention:

“After performing 3dVol2Surf with each patient’s electrodes to the standard MNI surface”…

To be sure, you are probably running 3dVol2Surf to map to the std.141 surfaces in orig space, is that right? Only after that (and after any 3dcalc/3dMean -sum/3dttest++ commands) would you display the result on a std.141 MNI space surface.

Just making sure,

  • rick

Yes, I registered each patient’s electrodes to their std.141.* surface before mapping them all on the std.141.MNI* surface.

Thanks again!

Great, I’m glad that worked out!

  • rick