-
Notifications
You must be signed in to change notification settings - Fork 136
/
plot_retinotopy_flatmap.py
39 lines (30 loc) · 1.27 KB
/
plot_retinotopy_flatmap.py
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
"""
================================
Plot Example Retinotopy Flatmaps
================================
This demo shows how to plot example retinotopy data onto a subject's brain
on a flatmap. In order for this demo to work, you need to download this
dataset_, but that can also be done automatically through the `urllib`
command that is included.
.. _dataset: http://gallantlab.org/pycortex/S1_retinotopy.hdf
S1 is the example subject that comes with pycortex, but if you want to plot
data onto a different subject, you will need to have them in your filestore,
and you will also need a flatmap for them.
"""
import cortex
import matplotlib.pyplot as plt
try: # python 2
from urllib import urlretrieve
except ImportError: # python 3
from urllib.request import urlretrieve
# Download the dataset and load it
_ = urlretrieve("http://gallantlab.org/pycortex/S1_retinotopy.hdf",
"S1_retinotopy.hdf")
ret_data = cortex.load("S1_retinotopy.hdf")
# The retinotopy data has to be divided into left and right hemispheres
left_data = ret_data.angle_left
cortex.quickshow(left_data, with_curvature=True, cvmin=-5., cvmax=5., cvthr=True)
plt.show()
right_data = ret_data.angle_right
cortex.quickshow(right_data, with_curvature=True, cvmin=-5., cvmax=5., cvthr=True)
plt.show()