File: plot_parcellation.py

package info (click to toggle)
pysurfer 0.3%2Bgit15-gae6cbb1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,032 kB
  • sloc: python: 1,947; makefile: 125
file content (44 lines) | stat: -rw-r--r-- 970 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"""
Using Annotation Files
======================

Display a Freesurfer cortical parcellation from an annotation file.

"""
print __doc__

import os
from os.path import join as pjoin
from surfer import Brain


subject_id = 'fsaverage'
hemi = 'lh'
surface = 'inflated'

"""
Bring up the visualization
"""
brain = Brain(subject_id, hemi, surface,
              config_opts={"cortex": "bone",
                           "background": "ivory"})

"""
Display the 'aparc' parcellation borders.
To use annotations that live in your subject's
label directory, just use the annot name.
"""
brain.add_annotation("aparc")

"""
You can also display the regions with "filled in" colors
"""
brain.add_annotation("aparc", borders=False)

"""
You may also provide a full path to an annotation file
at an arbitray location on the disc.
"""
subjects_dir = os.environ["SUBJECTS_DIR"]
annot_path = pjoin(subjects_dir, subject_id, "label", "lh.aparc.annot")
brain.add_annotation(annot_path)