FZJ-INM1-BDA / siibra-python

Software interfaces for interacting with brain atlases - Python client
Apache License 2.0
46 stars 8 forks source link

Read freesurfer .annot files as fsaverage mesh labels #575

Closed AhmetNSimsek closed 2 months ago

AhmetNSimsek commented 4 months ago
import siibra
from nilearn import plotting
conn = siibra.retrieval.repositories.GithubConnector("FZJ-INM1-BDA", "siibra-configurations", "add_visfAtlas")
siibra.use_configuration(conn)
mp = siibra.get_map(parcellation="visf", space="fsaverage")
mesh = mp.fetch(variant='inflated')
plotting.view_surf([mesh['verts'], mesh['faces']], surf_map=mesh['labels'], cmap=mp.get_colormap(), symmetric_cmap=False).open_in_browser()

See https://surfer.nmr.mgh.harvard.edu/fswiki/LabelsClutsAnnotationFiles for details of the freesurfer .annot files and https://nipy.org/nibabel/reference/nibabel.freesurfer.html#read-annot for implementation detail.