This article uses
N27 sample files mentioned by the
previous vignettes. If you are using this example, please execute the
following R code to set up. Alternatively, you can substitute variables
To add electrodes to the brain object, you need a electrode table
with least 5 columns:
column names are case-sensitive.
If you have performed electrode localization (see the previous
article) and exported the electrode table, the exported table can be
used here once
Electrode is filled out.
For demonstration purposes, this electrode
table will be used. Please download this file and place it at
In iEEG study, various of analyses can be performed on the electrodes. The analysis results are different, including
threeBrain can visualize them all with two lines and one
First, let’s take a look To start, generate a table as follows:
The column names are case-sensitive, and should only contain letters,
Project: (optional) the project name that this experiment belongs to
Subject: (mandatory) the subject code; must be consistent with the brain subject code
Electrode: (mandatory) integers of electrode channel number; correspond to the
Electrodecolumn in the electrode table
Time(optional) numerical time in seconds
cluster): values of the electrodes
Download sample value table from here
and save it to
Data Visualization panel, change
Display Data or use keyboard shortcut
sure the mouse is hovering on the brain) to switch to desired
sine_wave is time series. You can see the animation
Play/Pause option in the
Data Visualization panel.
In the example above, the p-value legend shows the range is from
0.5. This is because
threeBrain viewer’s default palette is symmetric around
zero, and the range is decided by the maximum absolute number. However,
the actual p-value should range from
and we might be particularly interested in
$p \leq 0.05$.
This means both the color palette and value range need to be
In the following code,
value_ranges is a named list of
such value ranges.
"p_value"=c(0,1) suggests that the
p_value variable should range from 0 to 1. All other
variables adopt the default ranges.
palettes is a named
list of color palettes. In this specific case, variable
is a vector of 64 colors.
colorRampPalette is a base-R
function to interpolate colors. Please use
help("colorRampPalette") to see the documentation.
threeBrain provides value mapping that allows electrode
values to be displayed on the surfaces. To enable this feature, open
Surface Settings panel, and click on
Surface Color, switch to
sync from electrodes,
or simply use keyboard shortcut
k (make sure the mouse is
hovering over the brain) to change.
You can also hide the electrodes by switching the electrode
hidden in the
Electrodes panel to only show the mapped results.