Attention: The EBRAINS IAM will be down Monday, the 21st July 2025, from 17.00 CEST (my timezone) for up to 1 hour. This will any affect services requiring an EBRAINS login, we apologise for any inconvenience caused.


Widget 3D Head

Version 14.1 by ldomide on 2022/05/20 10:35

NOTE - Not yet released, but testable here 

https://lab.ch.ebrains.eu/hub/user-redirect/lab/tree/shared/TVB%20Widgets/REPO/tvb-widgets/notebooks

Purpose

It is a Jupyter widget intended for visualization of the 3D Head data available for a patient:

  • surfaces of different types (cortex, face, skull, etc)
  • connectivity region centers
  • sensors locations (SEEG, MEG, EEG)

Inputs

It supports the above data in the form of their corresponding TVB datatypes:

  • Surface (CorticalSurface, FaceSurface, etc)
  • Connectivity
  • Sensors (SensorsInternal, SensorsMEG, SensorsEEG)

Installation

pip install tvb-widgets

API usage

We need to first import the widget API from tvbwidgets package, together with the TVB API and the display function:

import tvbwidgets.api as api

from tvb.simulator.lab import *

from IPython.core.display_functions import display 

Then, we instantiate the HeadWidget and a FaceSurface datatype that we want to visualize. Using the add_datatype method we add the surface to our widget and display the widget:

widget = api.HeadWidget()

face = surfaces.FaceSurface().from_file()

face.configure()

widget.add_datatype(face)
display(widget)

Next, we can continue adding other datatypes to this widget, by calling add_datatype multiple times. A maximum of 10 datatypes are supported by this widget.

The Config object can be used to tweak the display options for each datatype.

In the code below, we add a Connectivity and SEEG Sensors:

conn = connectivity.Connectivity().from_file()

conn.configure()

widget.add_datatype(conn)

seeg = sensors.SensorsInternal().from_file()

seeg.configure()

widget.add_datatype(seeg, api.HeadWidgetConfig(name='SEEG'))

We can also provide a RegionMapping to be used as colormap for a surface: 

reg_map = region_mapping.RegionMapping.from_file()

config = api.HeadWidgetConfig(name='Cortex')

config.add_region_mapping_as_cmap(reg_map)

cortex = surfaces.CorticalSurface().from_file()

cortex.configure()

widget.add_datatype(cortex, config)

Public

TVB Widgets