No Description

Fabian Peter Hammerle 24189db123 pipenv: added autopep8 to dev deps 5 years ago
examples 253ca9024e Annotation: replaced attribute `vertex_{color_codes->label_index}`; changed type of attribute `labels` to dict 5 years ago
freesurfer_surface 24189db123 pipenv: added autopep8 to dev deps 5 years ago
tests 24189db123 pipenv: added autopep8 to dev deps 5 years ago
.gitignore 0303eb775c added Surface.read_triangular(), setup.py & dev pipenv 5 years ago
Pipfile 24189db123 pipenv: added autopep8 to dev deps 5 years ago
Pipfile.lock 24189db123 pipenv: added autopep8 to dev deps 5 years ago
README.md 069514eb23 readme: added python example on how to list labels 5 years ago
setup.py c9481a48cd Label: fixed color codes; added property hex_color_code; added script freesurfer-annotation-labels 5 years ago

README.md

Usage

List Labels in Annotation File

from freesurfer_surface import Annotation

annotation = Annotation.read('tests/subjects/fabian/label/lh.aparc.annot')
for label in annotation.labels.values():
    print(label.index, label.hex_color_code, label.name)

or

$ freesurfer-annotation-labels tests/subjects/fabian/label/lh.aparc.annot
index	color	name
0	#190519	unknown
1	#196428	bankssts
2	#7d64a0	caudalanteriorcingulate
3	#641900	caudalmiddlefrontal
...
33	#4614aa	temporalpole
34	#9696c8	transversetemporal
35	#ffc020	insula