netneurolab / neuromaps

A toolbox for comparing brain maps
https://netneurolab.github.io/neuromaps
Other
246 stars 55 forks source link

Question about transforming to sphere space #156

Closed Aceticia closed 4 months ago

Aceticia commented 7 months ago

Description of issue

Hi, thanks for the fabulous package. I have some data in MNI space and I'm interested in resampling them to the fsaverage space but represented on the sphere. I assume the normal mni_to_fsaverage transforms to the pial?

Code of Conduct

justinehansen commented 7 months ago

mni_to_fsaverage is transforming a 3D volumetric image to a 1D vector of length $n$, where $n$ is the number of vertices in fsaverage space. You can use plotting software such as the connectome workbench to plot the output on many different surface e.g. sphere, pial, midthickness, grey/white matter boundary. You'll just need the spherical (or pial, or midthickness, etc) fsaverage surface to do the plotting, which you can fetch from neuromaps.atlas.fetch_fsaverage().

So in your case what I'd do is:

  1. use mni_to_fsaverage to transform your volume to the surface, and save the output (two giftis) somewhere
  2. run fetch_fsaverage() which will download all the fsaverage surface files
  3. use connectome workbench to plot on the sphere by loading in the LH and RH sphere files (which you downloaded in step 2) as well as your output giftis from step 1 to visualize data on the sphere

I hope that helps!

Justine