How to run SIFT simulation

From SCCN
Jump to: navigation, search

This page shows an unofficial introduction for using SIFT simulator. I wrote this page based on the following environment: Fedora 28, Matlab R2017b, EEGLAB 14.1.2, SIFT 1.52.

Contents

Preparation

First of all, you have to have EEGLAB and SIFT downloaded, installed, and launched successfully. Now, SIFT may contain several functions that have the same name as other functions. For example, several versions of 'PropertyGrid' could be found in your paths. To find them out, try the following code on the command line.

which -all PropertyGrid

You may have only one included by SIFT, or you may have more than one. In any case, we need to make sure (i.e. otherwise it won't work) that all the functions called from SIFT should refer to those contained by SIFT itself. From Matlab GUI, 'Home'-'Set Path', select all SIFT-related paths by pressing shift button while selecting all of them, press 'Move to Top', then 'Save' and 'Close'.

Sift00.png

Linear Dynamical System-Vector Autoregressive process

Select the GUI menu item

This is easy, just click the rightmost menu item. This corresponds to generate simulated sources. If you want to obtain their scalp projection, see below for 'EEG simulator'.

Sift01.png

Launch PropertyGrid GUI to accept user inputs

This is the famous PropertyGrid used everywhere in EEGLAB plugins. The menu items are self descriptive. The most important parameter here would be the top one labeled 'Simulation'. If you click it, you'll find 8 items in a list, including 'Schelter 2005 Eq 5' etc. In this page, we use the first model labeled 'Epileptic Seizure' as the example throughout. Press 'OK' to start the process.

Sift02.png

Wait until the progress bar reaches the end

You'll see the 5 rainbow-colored bars that shows progress of the processes. It won't take more than 10 s if you choose the default parameters on the previous window. When calculation is done, the EEGLAB function pops up. This is unrelated to the current simulation, so press 'OK' to continue.

Sift03.png

Confirm the results

When calculation is done, you'll see these three windows pop up. The index numbers in the time-series data plot correspond to the index numbers used on the right schematic model. Press 'OK' to continue.

Sift04.png

Confirm the updated EEGLAB GUI

Now you see the updated EEGLAB main GUI. Confirm the number of channels (13), the number of epochs (100), sampling rate (this is 100Hz, not 1000Hz!), epoch length (5 s).

Sift05.png

If you continue to analyze this data using SIFT, then you should be able to replicate the relations shown in the schematic illustration.

Access to the generated data

The generated 13-channel data are stored in EEG.data which has the size of 13 x 500 x 100 for channel, time points, and trials (epochs), respectively.

EEG Simulator

Select the GUI menu item

This GUI menu generates 1) the simulated sources as shown above, then 2) project them to scalp EEG channels. To perform source-to-scalp projection, it uses pre-computed 90-anatomical region atlas and international 10-10 system 64-ch scalp recording sensor labels and locations. This template information is included by the downloaded SIFT package and no need to take any action to set it up.

Sift10.png

Launch PropertyGrid GUI to accept user inputs

This window is important because just pressing 'OK' does not work. You have to first choose a model from the top GUI menu. As described, we select 'Epileptic Seizure'. This means that there will be 13 sources in the model. We need to specify the corresponding number of source locations by either entering their equivalent current dipole locations by xyz coordiantes (but in Talairach or MMN coordinate system? This needs to be clarified) or specifying their anatomical labels (looks like those used in AAL atlas by Tzourio-Mazoyer et al., 2002, but better to be confirmed also). For the test purpose, we choose the latter and click 13 check boxes for selecting anatomical labels from the dropdown menu under 'Scalp Data Generation'-'ForwardModel'-'SourceShape'-'RoiAtlasLabels'. You may choose any 13 regions for now to see if it works. When done, press 'OK'.

Sift11.png

Wait until the progress bar reaches the end

If everything goes well, you do not need to do anything. Just watch the progress bar extending to the end. It took longer than just simulating the sources in my case.

Sift12.png

What if I encounter this error?

I got this error message.

Sift13.png

Fortunately, I knew what it is through my experience with updating clean_rawdata. And I know that this may not cause the problem for most of non-Linux users (unless you set a model with a crazily large number of network nodes.) This JAVA-based RAM check function returns very small amount for my environment (Fedora 28). I guess it depends on the definition of 'available RAM amount' by each OS. Even if the returned answer is 0.71 GB as in the example, there is much more RAM space available and HDD swap never occurs. You can always check how much RAM can be used via OS resource monitor. Based on this, I implemented the following change on sim_fwdProj.m. There are more than one place that has the same error function, but the first one appears in line 241. I suggest you replace the function error() to warning() to let the calculation continue.

%error('This operation will require %0.5g GiB of memory. You do not have sufficient memory.',bytesReq/1024^3);
warning('This operation will require %0.5g GiB of memory. You do not have sufficient memory.',bytesReq/1024^3); % 12/02/2019 Makoto. Modified.

Confirm the results

When calculation is done, you will see the same set of figures. Note the two warning messages shown in the command line, which were generated by my mod suggested above. Note also that the 13 time-series data shown here refers to source activation, not the 64-channel projection yet.

Sift15.png

Confirm the updated EEGLAB GUI

Now you see the updated EEGLAB main GUI. Confirm the number of channels (64, not 13!), the number of epochs (100), sampling rate (this is 100Hz, not 1000Hz!), epoch length (5 s).

Sift17.png

Confirm the scalp projection

To visually inspect the generated scalp projection 'recorded' at the scalp sensors, you have to manually open the scroll plot using EEGLAB function. 'Plot'-'Channel Data (Scroll)' opens the interactive GUI to browse the 64-ch time-series data.

Sift16.png

Access to the generated data

The generated 64-channel data are stored in EEG.data which has the size of 64 x 500 x 100 for channel, time points, and trials (epochs), respectively.


Author: Makoto Miyakoshi, Swartz Center for Computational Neuroscience (SCCN), Institute for Neural Computation (INC), UC San Diego