Skip to content

Inverse problem solver

Alejandro Ojeda edited this page Sep 10, 2019 · 3 revisions

pop_rsbl: performs Recursive Sparse Bayesian Learning inverse filtering

Use this function implements the RSBL inverse filtering algorithm described here. The RSBL algorithm does automatic EEG data cleaning, source separation, and imaging. This implementation works as a filter, sample by sample, trial by trial so that the results are "cleaned" EEG and source time series of the same trial dimension as the input.

Note: We will replace the reference above by a more accurate one once our paper is out.

EEG = pop_rsbl(EEG, saveFull, account4artifacts, src2roiReductionType, solverType, updateFreq)

Input arguments:

  • EEG: EEGLAB's structure with a valid EEG.etc.src.hmfile field, otherwise it calls pop_forwardModel to compute the forward model,
  • saveFull: enables saving the current density tensor in the cortical space (default: true). This option is necessary to visualize source maps on the cortical surface (e.g., with function pop_eegbrowserx). This option can take a lot of RAM, so it is not recommended for processing unepoch data. If the source tensor does not fit into RAM we use memory-mapped files (under the hood).
  • account4artifacts: enables artifact modeling (default: true).
  • src2roiReductionType: method for reducing the source activity from the cortical space to the ROI space (default: mean). Supported methods are: mean - each ROI takes the mean of the source values within it, sum - each ROI takes the sumation of allthe source values within it, power - each ROI takes the power of the source values within it (the power makes sense when xyz components are estimated).
  • solverType: type of optimization algorithm, just use bsbl and move on.
  • updateFreq: we update the parameter that controls the sensor noise variance lambda and the sparsity profile of the sources gamma every updateFreq samples (default: 1). Values below 10 may speed up significantly the algorithm at the price of perhaps missing transient dynamics.

Output arguments:

  • EEG.data: tensor of the same size of the input data but reconstructed using cortical source activity,
  • EEG.etc.src.actFull: a tensor of number of sources by EEG.pnts by EEG.trials that contains the source time series,
  • EEG.etc.src.act: same as EEG.etc.src.actFull but the first dimension is colapsed within ROIs that correspond to the atlas in the head model, resulting in a tensor of number of ROI by EEG.pnts by EEG.trials,
  • EEG.etc.src.roi: cell array of ROI labels.
  • EEG.etc.src.gamma: array of sparsity profile of the sources (scale) of size number of ROI (and artifact sources in case that account4artifacts=true) by time by trials.
  • EEG.etc.src.indG: indices of cortical cources, e.g., x = EEG.etc.src.actFull(EEG.etc.src.indG,:,:);,
  • EEG.etc.src.indV: indices of artifact cources, e.g., a = EEG.etc.src.actFull(EEG.etc.src.indV,:,:);
  • EEG.etc.src.logE: value of the optimization function obtained every updateFreq samples.