Warning:  Due to planned infrastructure maintenance, the EBRAINS Wiki and EBRAINS Support system will be unavailable for up to three days starting Monday, 14 July. During this period, both services will be inaccessible, and any emails sent to the support address will not be received.

Attention: The EBRAINS Chat will down on Thursday, the 10th of July 2025 starting from 18.00pm CEST (my timezone) for up to 1 hour. 

Warning: The EBRAINS Drive, EBRAINS Bucket and EBRAINS Lab will down today, Wednesday, the 9th of July 2025 starting from 19:30 CEST (my timezone) for up to 1 hour.


Widget Connectivity

Version 9.1 by paulapopa on 2025/06/24 12:02

Widget Connectivity

Source code: https://github.com/the-virtual-brain/tvb-widgets

This is part of a Pypi release: https://pypi.org/project/tvb-widgets/

tvb-widgets is also already installed in the official image released for EBRAINS lab, where you can test it directly.

Purpose

Jupyter lab widgets for visualizing or do operations on a connectivity

1. ConnectivityWidget

Visualization:

    - in 2D can visualize weights or tracts matrixes;

conn2d.png

    - in 3D can visualize regions and their respective edges 

conn3d.png

To show/hide the Connectivity centers/edges, access the controls available in the upper-right corner:

visible.png

Operations:

 - remove selected nodes from a connectivity, results in a new connectivity containing only the nodes that were not selected;

 - remove unselected nodes from a connectivity, results in a new connectivity containing only the selected nodes;

 - remove unselected edges, results in a new connectivity with the same number of regions but without the edges of unselected regions;

 - remove selected edges,  results in a new connectivity with the same number of regions but without the edges of selected regions.

Usage:

After instantiating the widget it allows export of the currently selected connectivity:

from tvbwidgets.api import ConnectivityWidget
from tvb.datatypes.connectivity import Connectivity

conn = Connectivity.from_file() # defaults to connectivy_76.zip
conn.configure()

wid = ConnectivityWidget(conn, default_active_tab='viewers') # default_active_tab can be any value between 'viewers'|'operations'|'both'

display(wid)
# ....do some operations...
# replace None in the method below with the gid of the connectivity you wish to export
# if no gid is provided it will export the connectivity currently viewed

new_connectivity = wid.get_connectivity(gid=None)  
new_connectivity

2. SpaceTimeVisualizerWidget

- this is a 3D representation of the delayed-connectivity structure

- the space-time visualizer disaggregate the weights matrix and each slice corresponds to connections that fall into a particular distance (or delay) range. The first slice is the complete weights matrix. Click on any of the subsequent slices to see the corresponding 2D matrix plot. Also, choose the conduction speed and ranges you are interested to explore and the plot will update instantly.

st1.png

- clicking on a connectivity slice, brings that particular slice in the center an you can visualize it in 2D mode

st3.pngst4.png

- in the tab called Plots Overview you get a 2D summary of all the current slices

st2.png

Public

TVB Widgets