Skip to content

Render brain with a dynamic overlay

fahsuanlin edited this page Apr 16, 2018 · 2 revisions

Render brain with a dynamic overlay

Here we show examples of overlay time-varying values on a brain surface. This can be useful for visualizing fMRI or MEG/EEG data. We start by showing the fMRI responses in the file render_example_overlay_stc-lh.stc. This file can be downloaded here.

[value_lh,v_lh]=inverse_read_stc('render_example_overlay_stc-lh.stc');
etc_render_fsbrain('overlay_stc',value_lh,'overlay_vertex',v_lh,'overlay_threshold',[3 6]);

The above example sets the threshold of the overlay value (over all time points) between 3 and 6. In other words, brain areas with the overlay value smaller than 3 will have no color overlay.

You can click the brain figure and the time course of the selected point will be displayed in a separate figure. In the time course figure, there is a gray vertical line, indicating the time instant of this overlay value. Here it shows the overlay at the 97th sample over time.

Change the time instant

As you click the time course figure, you can move the vertical gray bar to the selected point. This will set a new time instant and the corresponding overlay values will be updated in the brain figure. For example, if you click time point 86, you will get the following figures.

Overlay values with a label (ROI)

You can load a label and show the time course of the selected point as well as the average time course within the label (ROI). To do this, you must first select the ROI in the label list box. The average time course within the selected label will be shown in dashed line. Below is the example of the average time course (in red dashed line) of a region from "vtx-lh.label", which can be downloaded here.

More than one set of time courses

You may want to compare the time courses at the same brain location across conditions. Thus it will be convenient to display multiple sets of time courses at the same time. To do this, you should specify the 'overlay_aux_stc' option. In the following example, we created two sets of artificial time course by circularly shift the original one by 20 and 40 samples. Then we display three time courses simultaneously.

[value_lh,v_lh]=inverse_read_stc('render_example_overlay_stc-lh.stc');

value_lh_shift1=circshift(value_lh,20,2);
value_lh_shift2=circshift(value_lh,40,2);
etc_render_fsbrain('overlay_stc',value_lh,'overlay_vertex',v_lh,'overlay_threshold',[3 6],'overlay_aux_stc',cat(3,value_lh_shift1,value_lh_shift2));

Note that "overlay_aux_stc" was used to represent a 3D variable, which was the (brain location) x (time points) x (conditions).

Now you click anywhere in the brain will show three time courses. The red one is defined by the data set in "overlay_stc", while the two other time courses are defined by "overlay_aux_stc".

Options

Here are some options you may tune your display.

  • Change the y-axis limits: you click the time course figure and type "d". A dialog box will be prompted to set the upper and lower limits of the y-axis of the time course
  • Turn on/off the color bar: in the brain figure, you can type "c" to turn on/off a color bar
  • Change the overlay value threshold: in the brain figure, you can type "d" to turn on/off a color bar
  • Change the overlay value smoothing: in the brain figure, you can type "s" to set how many smoothing iterations you need. By default we use 5 iteration steps to smooth the overlay values.
You can’t perform that action at this time.