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.

plot connected vertices

Out:

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...

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()

Total running time of the script: ( 2 minutes 3.094 seconds)

Gallery generated by Sphinx-Gallery