|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: ARfitStudio |
| 4 | +long_title: ARfitStudio |
| 5 | +parent: Plugins |
| 6 | +--- |
| 7 | +What is ARfitStudio |
| 8 | +------------------- |
| 9 | + |
| 10 | +First of all, ARfit is a collection of Matlab modules developed by Tapio |
| 11 | +Schneider and Arnold Neumaier for estimating parameters of multivariate |
| 12 | +autoregressive (AR) models, diagnostic checking of fitted AR models, and |
| 13 | +analyzing eigenmodes of fitted AR models. This plugin, ARfitStudio, uses |
| 14 | +it so that one can interactively clean TMS-induced short-burst (5-10 ms) |
| 15 | +artifacts and so on. The nature of the artifact does not matter (could |
| 16 | +be spikes by artifact, could be zeros, NaNs, etc), as long as the |
| 17 | +artifact duration is short and they are correctly marked. It has |
| 18 | +strength on the following points. |
| 19 | + |
| 20 | +- To perform quick (e.g. smart epoching & integration to continuous |
| 21 | + data using mcolon(); before and after correction comparison with one |
| 22 | + click, etc) and intuitive (e.g. training, correction, and blending |
| 23 | + windows overlaid on grand-median ERPs) correction of spiky |
| 24 | + artifacts. |
| 25 | +- Immediately usable after importing the continuous data; it is the |
| 26 | + very first stage of the preprocess pipeline. |
| 27 | + |
| 28 | +This plugin is dependent on ARfit and mcolon. ARfit can be installed by |
| 29 | +installing SIFT from EEGLAB plugin manager. To use mcolon(), users |
| 30 | +should compile the mex file. |
| 31 | + |
| 32 | +<http://www.mathworks.com/matlabcentral/fileexchange/174-arfit> |
| 33 | +<http://www.mathworks.com/matlabcentral/fileexchange/29854-multiple-colon/content/mcolonFolder/mcolon.m> |
| 34 | + |
| 35 | +Why ARfitStudio |
| 36 | +--------------- |
| 37 | + |
| 38 | +If there are spike artifacts with high amplitude, we cannot filter the |
| 39 | +data (because spikes spread in the time domain). In certain situation, |
| 40 | +it is more important to make them harmless for the sake of data process, |
| 41 | +rather than recovering the underlying signals (the latter is often |
| 42 | +impossible). This plugin provides a solution for it. |
| 43 | + |
| 44 | +How it works |
| 45 | +------------ |
| 46 | + |
| 47 | +It learns autoregressive model from the training period (green), which |
| 48 | +is the past of the spike, to make a prediction to replace problematic |
| 49 | +spike data points (red). For smooth connection, one can also set |
| 50 | +optional blending period (light magenta) during which predicted signal |
| 51 | +and original signals are gradually mixed with a linear slope. Thus, |
| 52 | +*this plugin replaces the bad data points using the past information* |
| 53 | +(therefore temporal interpolation). It does NOT recover the signal under |
| 54 | +the noise. One can select multiple markers for correction. In the main |
| 55 | +plot, grand-median ERPs for all the channels are shown. To save the |
| 56 | +result, just save the EEG dataset (do not check 'restore the last data' |
| 57 | +for this!) |
| 58 | + |
| 59 | +Screenshots |
| 60 | +----------- |
| 61 | + |
| 62 | + |
| 64 | + |
| 65 | + |
| 67 | + |
| 68 | + |
| 70 | + |
| 71 | +Data by courtesy of Michael Borich |
| 72 | + |
| 73 | +If you want to use ICA for the final analysis |
| 74 | +--------------------------------------------- |
| 75 | + |
| 76 | +Because this ARfit-based interpolation is performed for the same time |
| 77 | +points across channels, ICA cannot decompose this period. As a result, |
| 78 | +you'll see strange spikes in IC activations (i.e., EEG.icaact) during |
| 79 | +the correction windows. In the plots below, I show 1) ERP of IC |
| 80 | +activation for 33ch with ARfitStudio applied on channels (left), 2) the |
| 81 | +same but ARfitStudio applied on ICs (right). The noise was originally |
| 82 | +present within -/+10 ms relative to latency zero. |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +Performing ARfit-interpolation for ICA properly is complicated. |
| 88 | + |
| 89 | +1. Import data. |
| 90 | +2. Perform ARfitStudio on channels. |
| 91 | +3. Preprocess the data (high-pass filter, CleanLine plugin, |
| 92 | + clean_rawdata plugin, average referencing, AMICA plugin, DIPFIT |
| 93 | + plugin, fitTwoDipoles plugin). Note that you need to exclude the |
| 94 | + interpolated data from ICA process (those have no multivariate |
| 95 | + property across channels, so not decomposable). |
| 96 | +4. Perform ARfitStudio on IC activations. |
| 97 | +5. Backproject interpolated IC activation to reconstruct channel data. |
| 98 | + |
| 99 | +Note that the ARfitStudio is used twice, and the first application is |
| 100 | +purposed only for various filters, not even for ICA. In this way, you |
| 101 | +can obtain both clean channel signals and IC activations. For detail, |
| 102 | +see 'batchDemoForICA.m' included in the download package. I recommend |
| 103 | +you take a look because there are several cumbersome steps you have to |
| 104 | +go through. |
| 105 | + |
| 106 | +Note for batch users (03/11/2019 updated) |
| 107 | +----------------------------------------- |
| 108 | + |
| 109 | +If one wants to run the process as a batch, |
| 110 | + |
| 111 | +1. Use EEGLAB function pop_epoch() to crop out peri-event data points. |
| 112 | + Note all the negative latencies will be used as a learning period |
| 113 | + for ARfit. |
| 114 | +2. Use arfit2interpolate(). Note that the last input |
| 115 | + 'last_n_pointsToBlend' does NOT specify the additional length to |
| 116 | + the data points to the main interpolation window (as the GUI |
| 117 | + operation indicates), but it actually specifies the last data points |
| 118 | + of the main interpolation window. For example, outputData = |
| 119 | + arfit2interpolate(EEG.data, \[80 95\], 5) means, \[80:90\] for 100% |
| 120 | + interpolation, and \[91:95\] is blended with \[83% 67% 50% 33% 17%\] |
| 121 | + interpolated data blended with \[17% 33% 50% 67% 83%\] of the |
| 122 | + original data, respectively. |
| 123 | +3. Use putBackEpoch2Continuous() to re-construct the corrected, epoched |
| 124 | + data to the continuous data. |
| 125 | + |
| 126 | +Reference |
| 127 | +--------- |
| 128 | + |
| 129 | +A. Neumaier and T. Schneider, 2001: Estimation of parameters and |
| 130 | +eigenmodes of multivariate autoregressive models. ACM Trans. Math. |
| 131 | +Softw., 27, 27-57. |
| 132 | + |
| 133 | +T. Schneider and A. Neumaier, 2001: Algorithm 808: ARfit – A Matlab |
| 134 | +package for the estimation of parameters and eigenmodes of multivariate |
| 135 | +autoregressive models. ACM Trans. Math. Softw., 27, 58-65. |
| 136 | + |
| 137 | +Authors: Makoto Miyakoshi and Tim Mullen. SCCN, INC, UCSD |
0 commit comments