Brain is a flexible graphical user interface for 3D visualizations on an MNI brain. It can be use to display deep sources, connectivity, region of interest…
If you need help with the Brain module, ask your questions in the dedicated gitter Brain chat
1.1.2. Main features¶
- Modular and responsive GUI
- Take screenshot with controllable dpi
- Save the GUI state (buttons, sliders, checkbox…)
- Main brain templates
- Zoom, translate and rotate the brain
- Control the brain appearance, transparency, hemisphere…
- Import custom templates
- Add sources to the scene (EEG, MEG, intra-cranial…)
- Connect those sources (Connectivity with several color properties)
- Project source’s activity onto the surface
- Brain comes by default with the Brodmann and AAL volume
- Import nifti files
- Display brain sections
- Localize sources using the cross-sections
- 3-D volume using several rendering methods
- Region Of Interest (ROI)
- Display ROI
- Add custom ROI templates
- Project source’s activity on ROI
1.1.3. Import and use Brain¶
The Brain module can be imported as follow :
from visbrain import Brain
1.1.5. GUI description¶
The Brain graphical user interface is subdivided into three main parts :
- Menu (Save/load GUI config, take a screenshot…)
- Settings panel (display by default)
- Main canvas where the brain is displayed
- Colorbar canvas (hide by default)
- Cross-sections canvas (hide by default)
22.214.171.124. Settings panel tabs¶
- Settings tab (background color, object opacity and slice, light)
- Brain tab (brain template, ROI, cross-sections, volume)
- Sources tab (source’s properties, text, cortical projection and repartition, time-series, pictures)
- Connect tab (connectivity settings)
- Cbar tab (colorbar properties of the selected object)
|b||Display / hide the brain|
|x||Display / hide cross-sections|
|v||Display / hide volume|
|s||Display / hide sources|
|t||Display / hide connectivity|
|r||Display / hide Region Of Interest (ROI)|
|c||Display / hide colorbar|
|“+”||Increase brain opacity|
|“-“||Decrease brain opacity|
|CTRL + p||Run the cortical projection|
|CTRL + r||Run the cortical repartition|
|CTRL + d||Display / hide quick settings panel|
|CTRL + n||Screenshot window|
|CTRL + w||Screenshot of the entire window|
|CTRL + t||Show the shortcuts panel|
|CTRL + q||Exit|
1.2.1. MNI templates¶
By default, Brain comes with three brain templates respectively B1 (with cerebellum), B2 and B3 (smoothest).
Further brain templates can be downloaded here.
Sources can be added to the scene using (x, y, z) MNI coordinates and comes with a relatively large number of properties (radius, color, shape…). Source’s array of coordinates must be have a shape of (N, 3) with N the number of sources. In addition, several objects can be attached to sources :
- Text : add a text to each source.
- Source’s data : must be (N,) vector of data (for instance beta power, entropy, amplitude…). The radius of each source is then proportional to the data attached to it. This activity can be projected onto the brain surface using the cortical projection.
- Connectivity : must be a (N, N) upper triangular array describing how to connect sources
- Time-series and/or pictures : finally, it’s also possible to visualize signals (such as time-series, spectral signals…) and 2-D pictures (time-frequency maps, comodulogram…)
126.96.36.199. Cortical projection and repartition¶
- Cortical projection : correspond to the projection of source’s activity onto the brain (or ROI) surface.
- Cortical repartition : correspond to the number of sources contributing to each vertex of the surface. This is particularly convenient to inspect how sources are distributed on the surface.
Both methods use a radius parameter and only vertices with an euclidian distance under radius are going to be considered. From the GUI, those functions can be executed from the menu Project, from the tab Sources/Properties/Projection, using keyboard Shortcuts or Brain methods.
188.8.131.52. Connect sources¶
Sources can be connected together using connectivity links. Brain provides three ways of coloring those links :
- Strength : color each link according to the connectivity strength
- Count : color each connectivity node according to the number of connections to it
- Density : color each link according to the number of existing links in a controllable sphere.
184.108.40.206. Attach time-series and/or pictures¶
As a complement, Brain provides the ability to visualize directly into the MNI brain time-series and pictures.
In the current 0.3.0 visbrain version, time-series and pictures don’t rotate with the brain. As a consequence those elements can only be visualized in axial view. This should be solved in next release.
Brain templates are surfaces defined by vertices and faces. In contrast, volumes are defined with a 3-D array (Nx, Ny, Nz). There is three scenarios where volumes can be used in Brain:
- Cross-sections : inspect volumes using slices
- Region Of Interest (ROI) : display deep brain regions
- 3-D volume rendering : use VisPy.visuals.Volume rendering methods (mip, translucent, additive and iso)
Those volumes can be used to visualize nifti, dycom or any image files. By default, Brain comes with two volume files : Brodmann areas and Anatomical Automatic Labeling (AAL).
Cross-sections correspond to an axial, sagittal and coronal slice of the volume and can either be visualize in 3-D (inside the brain template) or in slitted view
220.127.116.11. Region Of Interest (ROI)¶
If a volume is provided with corresponding labels, ROIs can be extracted and then be transformed into a mesh, compatible with source’s projection methods.
The user functions correspond to a bundle of functions that can be used to control Brain operations without opening the graphical interface. This can be convenient to generate a large amount of pictures.
- 1.3.1. Main Brain class inputs
- 1.3.2. GUI functions and settings
- 1.3.3. Load and save GUI configuration
- 1.3.4. Brain methods
- 1.3.5. Sources methods
- 1.3.6. Time-series methods
- 1.3.7. Pictures methods
- 1.3.8. Connectivity methods
- 1.3.9. Colorbar methods