gallantlab / pycortex

Pycortex is a python-based toolkit for surface visualization of fMRI data
https://gallantlab.github.io/pycortex
BSD 2-Clause "Simplified" License
581 stars 137 forks source link

Correspondence between different surfaces #551

Open YingtianDt opened 1 month ago

YingtianDt commented 1 month ago

Hi, thank you so much for your great work on this repo. May I ask if there is a way to find the mapping between two different surfaces (or the two surfaces registered to the same space)?

Thanks!

candytaco commented 1 month ago

Hi - pycortex encapsulates FreeSurfer's mri_surf2surf command with cortex.freesurfer.get_mri_surf2surf_matrix and cortex.database.get_mri_surf2surf_matrix. mri_surf2surf computes a vertex-to-vertex mapping between surfaces.

The method in cortex.freesurfer will compute the projection matrix on every call, while the method in cortex.database will cache the computed projection matrix to disk, and load a pre-computed matrix if it's available.

YingtianDt commented 1 month ago

Thank you so much for your response! It seems this function is originally designed for fsaverage surfaces. May I ask if you think it is okay to use it (or the functions it calls) for aligning other surfaces? For example, I want to align the S1 pial surface with fsaverage5 pial surface (both provided by pycortex db).

Any comments or suggestions will be highly appreciated!

candytaco commented 1 month ago

FreeSurfer and the corresponding FreeSurfer subjects are required to compute the surface-to-surface projection matrices. This computation is not a pycortex functionality - pycortex merely provides convenience methods so you don't need to manually call FreeSurfer. Unfortunately we do not provide the FreeSurfer subject files.

However, if you are specifically looking for the S1-to-fsaverage projection matrix, we can provide that.

YingtianDt commented 1 month ago

Thanks! I will really appreciate it if you can provide to me S1-to-fsaverage (presumably fsaverage5, but others also fine) and fsaverage-to-S1 projection matrices. It would be super helpful to me. My email is yingtian.tang@epfl.ch.

Thanks again for your time and help!