.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/quickstart/plot_retinotopy_flatmap.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_quickstart_plot_retinotopy_flatmap.py: ================================ 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. .. GENERATED FROM PYTHON SOURCE LINES 18-46 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/quickstart/images/sphx_glr_plot_retinotopy_flatmap_001.png :alt: plot retinotopy flatmap :srcset: /auto_examples/quickstart/images/sphx_glr_plot_retinotopy_flatmap_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/quickstart/images/sphx_glr_plot_retinotopy_flatmap_002.png :alt: plot retinotopy flatmap :srcset: /auto_examples/quickstart/images/sphx_glr_plot_retinotopy_flatmap_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Mask not found, generating... Failed to get connection ** (inkscape:5434): CRITICAL **: 01:31:30.199: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5434): CRITICAL **: 01:31:30.199: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5434): CRITICAL **: 01:31:30.200: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed Failed to get connection ** (inkscape:5438): CRITICAL **: 01:31:31.326: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5438): CRITICAL **: 01:31:31.326: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5438): CRITICAL **: 01:31:31.326: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed | .. code-block:: default import six import cortex import matplotlib.pyplot as plt if six.PY2: from urllib import urlretrieve elif six.PY3: 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, 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() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 6.018 seconds) .. _sphx_glr_download_auto_examples_quickstart_plot_retinotopy_flatmap.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_retinotopy_flatmap.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_retinotopy_flatmap.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_