Review continuous recordings and edit markers

This tutorial describes how to review a continuous file and add time markers. It is based on a median nerve stimulation experiment recorded at the Montreal Neurological Institute in 2011 with a CTF MEG 275 system. The sample dataset contains 6 minutes of recordings at 1200Hz for one subject and includes 100 stimulations of each arm. The segmentation of the T1 MRI of the subject was performed using FreeSurfer.

Download and installation

Import the anatomy


Access the raw file

The basic tutorials you read before explain how to import recordings in the database: this operation creates a copy of all the data in Matlab .mat files in the Brainstorm database folders. You could process continuous recordings in the same way, but the .mat format has this limitation that the entire file has to be read even when you want to access just a portion of it. Long recordings usually cannot fit in memory and have to be split in small blocks of a few seconds, which makes it very difficult to review and process.

Brainstorm offers the possibility to visualize continuous MEG/EEG recordings in any of the supported file formats without having to fully "import" them. A link to the native file is created in the database, which can be then manipulated almost like the "imported" recording blocks. Only the description of the file is saved in the database, and when displaying it the values are read directly from the native file.

In addition, an interface allows to edit the time markers that are saved in the file. Those markers can then be used to import the recordings in the database (ie. to do the segmentation of the continous recordings in epochs/trials). Then the imported epochs/trials (hard copies in .mat format) can be pre-processed and averaged.

Review the recordings

Open the file

Right-click on the data file > MEG (all) > Display time series.

displayTsMenu.gif

You can see a new tab "Event" and a figure showing the recordings.

rawPanel.gif

As described in the basic tutorials, you can set the current time by using either the time panel (buttons and text field), or the figure (click on the white or grey areas of the figure). But you can notice that only a few seconds are visible in the figure, while the time panel (top left of the previous figure), indicates that we have 360s of recordings. Only a small block of the continuous file has been loaded in memory. This small time window can be configured with the tab Event/Page settings, with the text boxes Start and Duration.

The time series figure is similar to the ones that were presented in the previous tutorials, with a few new elements. The navigation bar at the bottom represents the time of the entire raw file, where the events are also represented by dots. The '<<<' and '>>>' buttons are the same as the ones in the time panel, and jump to the previous/next segment in the file. Clicking on the bar or dragging the red cursor change the current time window as well.

Sensor selection

Let's switch to a nicer representation of the recordings time series: click on the "Display mode" button in the toolbar of the main Brainstorm window.

tsColumn.gif

Now the traces are displayed in columns, but all the channels are displayed in the same figure, which makes it unreadable. Select a subset of channels by right-clicking on the figure > Display setup, or by using one of the keyboard shortcuts (Shift+A, B, C...). Default groups of sensors re available for some MEG systems, but you can also create your own groups of sensors with the menu "Edit selections".

tsChannelSelection.gif

Amplitude scale

In this display mode, the amplitude scale is represented on the right of the figure. You can adjust this vertical scale:

When scrolling in time to a different page, the amplitude scale is by default kept. You can change this behavior to re-evaluate automatically an optimal scale each time you change the current time window. This option is called "Auto-scale amplitude" and is disabled by default. To activate it: click on the "AS" button on the right of the figure, or check the menu "Display > Auto-scale amplitude" in the Event tab.

Display options

Online filter

With the Filter tab, you can apply a band-pass filter to the recordings, or remove a set of specific frequencies (example: the 50Hz or 60Hz power lines contamination and their harmonics). The filters are applied only to the time window that is currently loaded; hence if the segment is too short for the required filters, the results could be inaccurate.

The option "Mirror signal before filtering" triples artifically the length of the signal with a mirror symmetry on each side, to avoid the strong edge effects that those filters can generate. Those online filters are not very accurate, they just provide a quick estimate for visualization only, the results are not saved anywhere. To filter properly the continuous files, please use the Process1 tab.

onlineFilter.gif

EEG Average reference

When reviewing EEG recordings, you can switch between the original values and the average reference by clicking on the "AVG REF" button in the toolbar of the main Brainstorm window. In this case, there is no EEG recorded in the file, so selecting this option or not does not change anything.

Average reference computation: at each time point, the average of all the electrodes values is subtracted from each electrode.

avgRef.gif

Events, markers, triggers

Lists of events

You probably noticed little green and blue dots on top of the recordings in the MEG figure. They represent the triggers of the electric stimulation. The stimulation computer sent those triggers simultaneously to the electric stimulator, which was converting them into electric pulses sent to the wrists of the subject, and to the acquisition computer, that was recording them together with the values of the MEG sensors.

All the temporal markers that are available in the file are listed in the Recordings section of the Event tab:

addGroup_done.gif

Those two lists are interactive. If you click on a event group (left list), it shows the occurrences for the selected event in the right list. If you click on one particular event in the right list, the current time is set in the MEG figure to the selected event. If you click on a dot representing an event in the MEG figure, the corresponding event group and occurrence are selected in the Event tab.

Those "events" can represent either stimulation triggers that were recorded during the acquisition, or additional markers that were placed by the user during the analysis.

Adding events

First create a new group of events, define its name (test) and its color (red), with the "Events" menu in the Event tab:

addGroup.gif addGroup_done.gif

Then set the current time were you want to add a new Test even, by clicking on the figure (current time = where the vertical red line is). Select the group event "Test" and add a few occurrences with any of the three methods:

addEvent_done.gif

Now remove all the events occurrences, but not the group "Test":

You can also use this interface to create events that have a temporal extension, ie. they last for more than one time sample. This is usually used to define bad/artifacted segments in the data.

extEventSel.gif extEvent.gif

Custom shortcuts

Saving modifications

When you close the raw file viewer, or the last figure that shows a part of the raw file, the dataset is unloaded, the file is released and the memory is freed.

If you edited the events for this file, you would be asked whether to save the modifications or not. If you answer "Yes", the modifications to the events are only saved in the Brainstorm definition of the file, not in the raw file itself. So you would see your changes the next time you open the file with Brainstorm, but not if you open the raw file again with an external program.

saveModif.gif

Note that events you edit are not saved automically until that moment. As you would do with any other type of work, save your work regularly, to limit the damages of a program or computer crash. In the Event tab, menu File > Save modifications.

saveModifMenu.gif

Shortcut summary

Keyboard shortcuts

Mouse shortcuts

Other views

Topography views

Exactly as introduced in the ?tutorial #4 "Exploring the recordings", you can display a variety of 2D/3D mappings of those recordings. Right-click on the node "Link to raw file" > MEG (all) > ...

topo.gif

Cortical sources

As presented in tutorial #5 to #7, you can compute successively for this raw file: a head model, a noise covariance matrix, and an inverse model.

At the end you can see three new files in the database. Right-click on the sources and try the different visualization menus.

Important: Remember that you probably still have the online filter on; the band-pass options you specify in the Filter panel are kept until you close Brainstorm.

sourcesTree.gif

sourcesView.gif

Tutorials/TutRawViewer (last edited 2013-01-04 21:23:54 by agrippa)