Explorar o código

readme: added python example on how to list labels

Fabian Peter Hammerle %!s(int64=5) %!d(string=hai) anos
pai
achega
069514eb23
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      README.md

+ 11 - 1
README.md

@@ -1,6 +1,16 @@
 ## Usage
 
-### List Labels in Annotation Files
+### List Labels in Annotation File
+
+```python
+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
 
 ```sh
 $ freesurfer-annotation-labels tests/subjects/fabian/label/lh.aparc.annot