Get Vertices for an ROIΒΆ

In this example we show how to get the vertices that are inside an ROI that was defined in the SVG ROI file (see /rois.rst).

plot get roi vertices

Out:

Failed to get connection
** (inkscape:5534): CRITICAL **: 01:33:42.301: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed
** (inkscape:5534): CRITICAL **: 01:33:42.301: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed
** (inkscape:5534): CRITICAL **: 01:33:42.301: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed

<Figure size 1960x1024 with 2 Axes>

import cortex

# get vertices for fusiform face area FFA in subject S1
roi_verts = cortex.get_roi_verts('S1', 'FFA')

# roi_verts is a dictionary (in this case with only one entry)
ffa_verts = roi_verts['FFA']

# this includes indices from both hemispheres
# let's create an empty Vertex object and fill FFA

ffa_map = cortex.Vertex.empty('S1', cmap='plasma')
ffa_map.data[ffa_verts] = 1.0

cortex.quickshow(ffa_map)

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

Gallery generated by Sphinx-Gallery