[WARNING: This page is part of the old tutorials, please refer to the new documentation]


C1. Review continuous recordings and edit markers

Authors: Francois Tadel, Elizabeth Bock, John C Mosher, Sylvain Baillet

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.

License

This tutorial dataset (MEG and MRI data) remains a property of the MEG Lab, McConnell Brain Imaging Center, Montreal Neurological Institute, McGill University, Canada. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from the MEG Lab.

If you reference this dataset in your publications, please aknowledge its authors (Elizabeth Bock, Esther Florin, Francois Tadel and Sylvain Baillet) and cite Brainstorm as indicated on the website. For questions, please contact us through the forum.

Download and installation

Import the anatomy

Without the individual MRI

If you do not have access to an individual MR scan of the subject (or if its quality is too low to be processed with FreeSurfer), but if you have digitized the head shape of the subject using a tracking system, you have an alternative: deform one of the Brainstorm templates (Colin27 or ICBM152) to match the shape of the subject's head.
For more information, read the following tutorial: Warping default 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. These markers can then be used to import the recordings in the database (ie. to do the segmentation of the continuous 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 new information in the tab "Record" 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 Record/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 Record tab.

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 > Montages, with the drop-down menu in the Record tab or with a keyboard shortcut (Shift+A, B, C...). Default groups of sensors are available for some MEG systems, but you can also create your own groups of sensors with the menu "Edit montages".

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 automatically re-evaluate 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 Record tab.

Display options

Filters for visualization

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 artificially the length of the signal with a mirror symmetry on each side, to avoid the strong edge effects that these filters can generate. These 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.

After testing the high-pass, low-pass and notch filters, uncheck them. If not you will probably forget about them, and they will stay on until you restart Brainstorm.

onlineFilter.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 these triggers simultaneously to the electric stimulator, which converted them into electric pulses sent to the wrists of the subject, and to the acquisition computer, which recorded 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 Record tab:

eventSelect.gif

These two lists are interactive. If you click on a event group (left list), it shows the occurrences for the selected event group 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 Record tab.

These "events" can represent either stimulation triggers that were recorded during the acquisition, or additional markers that were placed by the user during the analysis (eye blinks, epileptic spikes).

Adding events

First create a new group of events called "Test", with the menu "Events > Add group". It creates a new event group with no occurrences (x0).

addGroup.gif

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

addEvent_done.gif

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

Extended events

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 recordings.

extEventSel.gif extEvent.gif

Custom shortcuts

When reviewing long recordings and adding manually lots of events (eg. when marking manually epileptic spikes), using the menus presented previously is not very convenient because they require many mouse clicks. Using the menu Events > Edit keyboard shortcuts, you can associate custom events to the key 1 to 9 of the keyboard. Define the name of the event type to create for each key, and then simply press the corresponding key to add/delete a marker at the current time position.

evtCustom.gif

Bad segments

It is very common to have portions of the recordings heavily contaminated by events coming from the subject (eye blinks, movements, heartbeats, teeth clenching...) or from the environment (stimulation equipment, elevators, cars, trains, building vibrations...). Some of them are well defined and can be removed efficiently, it is the purpose of the next tutorial, some cannot. For this last category, it is usually safer to mark the noisy segments as bad, and ignore them for the rest of the analysis.

To mark a segment of recordings as bad, the procedure is the same as for defining an extended event: select a time window, and then tag it as bad with one of the following methods.

It creates a new event group BAD, and add an extended event to it. Later, when epoching this file (extracting time blocks around the markers and saving them in the database), the trials that contain a segment marked as bad will be imported but marked as bad, and ignored in the rest of the analysis.

bad.gif

Saving modifications

Now you can delete all the event groups that you've just created and leave only the "left" and "right" triggers: select the unwanted event groups and press the Delete key, or use the menu Events > Delete group.

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 are asked whether to save the modifications or not. If you answer "Yes", the modifications are saved only in the database link (Link to raw file), not in the original file itself. Therefore, you would see the changes the next time you double-click on the "link to raw file" again, but not if you open the original .ds file in another protocol or with an external program.

saveModif.gif

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

Other menus

menuFile.gif

File

Events

Shortcut summary

Keyboard shortcuts

Mouse shortcuts

Other views

Topography views

Exactly as introduced in the ?tutorial #5 "Exploring the recordings", you can display a variety of 2D/3D maps of these recordings. Right-click on the node "Link to raw file" > MEG > ...

topo.gif

Remember that you can open a set of figures for a specific continuous file, save this configuration and re-open it with another file with the menu Window layout options > User setups.

topo.gif

Cortical sources

As presented in tutorial #6 to #8, you can compute successively for this raw file: a head model, a noise covariance matrix, and an inverse model. Right-click on the folder "Subject01" to get all the menus.

At the end you can see four new files in the database. Right-click on the source file associated with the "Link to raw file" and try the different visualization menus.

Delete all these new files before you move on to the next tutorial, keep only the channel file and the "Link to raw file".

sourcesTree.gif

sourcesView.gif

Next

Learn how to correct the artifacts caused by eye blinks and the heartbeats on these recordings using ?Signal Space Projections.





Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):


Tutorials/TutRawViewer (last edited 2018-06-28 12:31:16 by ?MartinCousineau)