brainmass.viz.plot_functional_connectivity

brainmass.viz.plot_functional_connectivity#

brainmass.viz.plot_functional_connectivity(data, *, is_matrix=False, labels=None, ax=None, **kwargs)[source]#

Plot a functional-connectivity matrix.

When data is a (time, region) time series (the default), the functional connectivity is computed via braintools.metric.functional_connectivity() and plotted. When is_matrix is True, data is treated as an already-computed (region, region) FC matrix.

Parameters:
  • data (array_like or brainunit.Quantity) – Either a (time, region) time series or a (region, region) FC matrix (see is_matrix). Units are stripped before computing FC.

  • is_matrix (bool, optional) – If True, data is a precomputed FC matrix. Default False.

  • labels (sequence of str, optional) – Tick labels for both axes.

  • ax (matplotlib.axes.Axes, optional) – Axes to draw on. A new figure/axes is created when None.

  • **kwargs – Forwarded to plot_connectivity().

Returns:

The axes drawn on.

Return type:

matplotlib.axes.Axes

See also

plot_connectivity

the underlying heatmap helper.

braintools.metric.functional_connectivity

the surfaced metric.

Examples

>>> import brainmass
>>> sig = brainmass.datasets.load_dataset('example_signal')
>>> ax = brainmass.viz.plot_functional_connectivity(sig.signal)
>>> len(ax.images)
1