File: plot_transparent_brain.py

package info (click to toggle)
pysurfer 0.11.2-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 16,352 kB
  • sloc: python: 4,786; makefile: 141; sh: 10
file content (40 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (5)
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
"""
=======================
Plot Transparent Brain
=======================

Plot a transparent brain to visualize foci below the surface.

"""
import os
from surfer import Brain

print(__doc__)

subject_id = "fsaverage"
subjects_dir = os.environ["SUBJECTS_DIR"]

"""To render a transparent brain, we are specifying an alpha <
1.0. This allows us to visualize foci that are not on the cortical
surface. When the brain see-through, rendering of binary curvature is
distracting, so we specify a color, rather than a color map as the
argument for cortex:

"""
brain = Brain(subject_id, "lh", "pial", cortex='ivory', alpha=0.5)

"""Here's a set of stereotaxic foci in the MNI coordinate system that
are not on the cortical surface which we want to display.

"""

coords = [[-20, 10, 10],
          [-25, 22, 15],
          [-18, 8, 20]]

"""Now we plot the foci in the brain. Because the foci are not on the
cortical surface, they are only visible when alpha is set to < 1.0 in
the call to Brain.

"""
brain.add_foci(coords, color="red")