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.

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.

  • plot retinotopy flatmap
  • plot retinotopy flatmap
Mask not found, generating...
Background RRGGBBAA: ffffff00
Area 0:0:1960.5:1024 exported to 1960 x 1024 pixels (96 dpi)
Background RRGGBBAA: ffffff00
Area 0:0:1960.5:1024 exported to 1960 x 1024 pixels (96 dpi)

import cortex
import matplotlib.pyplot as plt
from urllib.request import urlretrieve


# Download the dataset and load it
_ = urlretrieve(
    "https://s3.us-west-1.wasabisys.com/glab-public-datasets/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,
                                                    curvature_contrast=0.5,
                                                    curvature_brightness=0.5,
                                                    curvature_threshold=True)
plt.show()

right_data = ret_data.angle_right
cortex.quickshow(right_data, with_curvature=True,
                                                     curvature_contrast=0.5,
                                                     curvature_brightness=0.5,
                                                     curvature_threshold=True)
plt.show()

Total running time of the script: (0 minutes 4.567 seconds)

Gallery generated by Sphinx-Gallery