项目作者: levchenkoegor

项目描述 :
ISC method for M/EEG data
高级语言: Python
项目地址: git://github.com/levchenkoegor/Inter-Subject_Correlation.git
创建时间: 2019-09-29T17:14:33Z
项目社区:https://github.com/levchenkoegor/Inter-Subject_Correlation

开源协议:BSD 2-Clause "Simplified" License

下载


Inter-subject correlation (ISC) for EEG data

This repository contains several functions for calculating inter-subject correlation for electroencephalography (EEG) data.
The algorithm was described in details in the next article
Correlated Components of Ongoing EEG Point to Emotionally Laden Attention – A Possible Marker of Engagement?

Getting started

ISC.py contains all necessary functions for calculating Inter-subject correlation (ISC). The function train_cca(data) takes a dictionary
where keys are names of conditions and values are 3-D numpy arrays structured like (subjects, channels, samples). It returns
a 2-D numpy array W with all spatial filters (which maximize correlation in the data) in descending order.

The function apply_cca(X, W, fs) takes the same X as for training, numpy array of spatial filters and frequency sampling.
It returns ISC, ISC_persecond, ISC_bysubject values and scalp projections of spatial filters A.

You can run the example below:

  1. X = dict(Sin=np.random.rand(10, 32, 512*60))
  2. X['Sin'][:,24,:] = np.sin(np.linspace(-np.pi, np.pi, 512*60))
  3. [W, ISC_overall] = train_cca(X)
  4. isc_results = dict()
  5. for cond_key, cond_values in X.items():
  6. isc_results[str(cond_key)] = dict(zip(['ISC', 'ISC_persecond', 'ISC_bysubject', 'A'], apply_cca(cond_values, W, 250)))

For the visualization you should just run visualization.py after spatial filters are applied.

Some features will be added soon:

  1. Scalp projections of spatial filters.
  2. Statistical tests.
  3. Visualisation with stimuli.