.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/quickflat/plot_connected_vertices.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_quickflat_plot_connected_vertices.py: ============================================== Plot which vertices are inside the same voxels ============================================== Show lines connecting vertices on the flatmap that are actually within the same voxels in a given scan. Here, we used advanced compositing to be explicit about display options for the connecting lines. .. GENERATED FROM PYTHON SOURCE LINES 13-29 .. image-sg:: /auto_examples/quickflat/images/sphx_glr_plot_connected_vertices_001.png :alt: plot connected vertices :srcset: /auto_examples/quickflat/images/sphx_glr_plot_connected_vertices_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Generating a flatmap cache Failed to get connection ** (inkscape:5268): CRITICAL **: 01:28:18.292: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed ** (inkscape:5268): CRITICAL **: 01:28:18.293: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed ** (inkscape:5268): CRITICAL **: 01:28:18.293: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed Shared voxel array not found, generating... Caching mapper... | .. code-block:: default import cortex import numpy as np import matplotlib.pyplot as plt # Create an empty pycortex Volume volume = cortex.Volume.empty(subject='S1', xfmname='retinotopy', value=np.nan) # Plot a flatmap with the data projected onto the surface fig = cortex.quickflat.make_figure(volume, with_curvature=True, with_colorbar=False) # Advanced compositing addition of connected vertices. # Note that this will not currently resize correctly with a figure. lines = cortex.quickflat.composite.add_connected_vertices(fig, volume, exclude_border_width=None, color=(1.0, 0.5, 0.1, 0.6), linewidth=0.75, alpha=0.3, recache=True) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 2 minutes 3.094 seconds) .. _sphx_glr_download_auto_examples_quickflat_plot_connected_vertices.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_connected_vertices.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_connected_vertices.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_