Problem
As detailed in issue #3415 opened in nilearn, vertex order does not match across all fsaverage resolutions.
I downloaded fsaverage 3 to 7 tarballs for the git annex of this repo and simply ran the following script to show that vertex order is not preserved across resolutions:
# %%
from nilearn import surface
# %%
fs3_path = "/home/alexis/singbrain/data/freesurfer_fsaverage/fsaverage3/surf/lh.pial"
fs5_path = "/home/alexis/singbrain/data/freesurfer_fsaverage/fsaverage5/surf/lh.pial"
fs7_path = "/home/alexis/singbrain/data/freesurfer_fsaverage/fsaverage7/surf/lh.pial"
fs3_coordinates, fs3_faces = surface.load_surf_mesh(fs3_path)
fs5_coordinates, fs5_faces = surface.load_surf_mesh(fs5_path)
fs7_coordinates, fs7_faces = surface.load_surf_mesh(fs7_path)
# %%
print(fs3_coordinates[:5])
print(fs5_coordinates[:5])
print(fs7_coordinates[:5])
Output:
[[-3.87359581e+01 -1.93433647e+01 6.72201385e+01]
[-9.71759605e+00 -9.23328686e+00 4.65803757e+01]
[-2.40194092e+01 4.31147995e+01 2.39262428e+01]
[-5.98615112e+01 4.93119545e-02 8.97464848e+00]
[-5.06454735e+01 -4.94050064e+01 4.78137321e+01]]
[[-3.87359581e+01 -1.93433647e+01 6.72201385e+01]
[-1.66624870e+01 -6.90612259e+01 6.12812729e+01]
[-9.71761799e+00 -9.23326397e+00 4.65803413e+01]
[-2.40194283e+01 4.31148720e+01 2.39262142e+01]
[-5.98614998e+01 4.92927618e-02 8.97456360e+00]]
[[-3.87359581e+01 -1.93433647e+01 6.72201385e+01]
[-1.66624680e+01 -6.90612564e+01 6.12812119e+01]
[-9.71762943e+00 -9.23325062e+00 4.65803223e+01]
[-2.40194435e+01 4.31149139e+01 2.39261990e+01]
[-5.98614883e+01 4.92815673e-02 8.97451496e+00]]
Here, we see that the second vertex of fsaverage3 doesn't match that of fsaverage 5 and 7.
I did some more extensive testing and it seems to me that:
fsaverage 5, 6, 7 have consistent vertex order
Suggestion
Maybe we should reorder fsaverage 3 and 4's vertices for all maps, what so you think?
Thank you for the great software anyways! ☺️
Warm regards,
Alexis