ERPLAB Studio Panels: Reject Artifactual Time Segments - ucdavis/erplab GitHub Wiki

The Reject Artifactual Time Segments panel in the EEG tab allows you to delete periods of EEG in which there are large, idiosyncratic artifacts (e.g., large movement artifacts). Typically, this tool is used to reject “crazy” periods of EEG rather than ordinary artifacts such as blinks or eye movements. See the manual page on Artifact Correction and Rejection for an overview.

This routine actually deletes the segments of artifactual data rather than marking segments for later exclusion. A boundary event code (-99) is inserted into the EEGset where the EEG was deleted.

You can select the segments to be deleted automatically or manually. We recommend automatic selection when possible (because it is easier for other people to reproduce your results).

Manual Selection of Periods to Delete

You can select time periods for deletion on the basis of visual inspection by selecting the Manual rejection option and then clicking View & Reject. As shown in the screenshot below, this will cause a window to appear that allows you to view the data (using the plotting parameters in the Plot Settings panel). If you drag the mouse over a period of data, that period will be highlighted in yellow. You can highlight multiple time periods in this manner. After a period has been highlighted, you can remove the highlighting by clicking again in that period.

Artifact Rejection

Once you are done highlighting the periods that should be deleted, click the Reject button, and then the selected time periods will be deleted.

Note that the rest of ERPLAB Studio will be “frozen” while you are viewing the window to select epochs for marking.

Automatic Selection of Periods to Delete

To automatically select periods for deletion, you specify which channels should be tested for artifacts in the Chans box. In most cases, the goal is to reject “crazy” periods of EEG rather than blinks or eye movements, so you will typically exclude channels with large blink or eye movement signals in the Chans box (e.g., the horizontal and vertical EOG channels, the FP1 and FP2 channels).

Artifact Rejection Panel

Artifacts are defined by using a moving window peak-to-peak algorithm. The routine slides a moving window across the data and finds the maximum and minimum amplitude within each window. The width of the window is specified in milliseconds in the Moving window width box. In most cases, a window width of 500 or 1000 ms works well. The Window step box is used to control how much the window moves as it is being slid across the data. For example, if you specify 500 ms for the Moving window width and 250 ms for the Window step, it will test from 0-500 ms, then from 250-750 ms, then from 500-1000 ms, etc. In most cases, we recommend a step size that is 50% of the window width. A smaller step size will make the routine run more slowly.

A segment of EEG will be deleted if the voltage within one or more of the to-be-tested channels exceeds the value specified in the Voltage threshold box. If one value is specified in this box, then the peak-to-peak amplitude will be compared with this threshold. If two threshold values are specified, then the most negative value in the window will be compared with the first threshold value and the most positive value will be compared with the second threshold value. For example, if you specify thresholds of -100 200, a segment will be deleted if the value within the window is ever less than -100 or is ever greater than +200.

Once you have entered the parameters, you can click the Preview button to see which time periods will be deleted. This will pop up a viewing window, with the to-be-deleted segments marked in gray. You should close this window before continuing.

Once you have verified that the parameters will delete the appropriate segments, you can click the Finalize button to create a new EEGset with those segments deleted.

Options

The panel includes several options (which apply only to automatic selection of periods to delete). First, it is sometimes useful to filter the data prior to determining which windows contain artifacts. Otherwise, slow drifts or brief high-frequency noise bursts could cause the data to exceed the threshold. If you select the Pre-filtering option, the routine will create a filtered copy of the data and use this copy for determining which time periods to delete. These time periods will then be deleted from the original, unfiltered EEGset. A cutoff of around 0.1 Hz should work well to get rid of slow drifts. You may or may not want to also filter high frequencies (depending on the nature of the artifacts that you are trying to eliminate). Note that, by selecting a narrow range of frequencies and an appropriate threshold, you may be able to isolate the kinds of artifacts that should be rejected from the continuous data (i.e., crazy data segments), leaving other artifacts to be detected after epoching (e.g., blinks), which should be your goal in using this tool.

When you use this routine, you might find that there are several marked regions that are separated by short unrejected periods (e.g., 500 ms or less). There isn't much point in keeping these brief unrejected periods. The Join artifactual segments... option causes these brief unmarked regions to be marked for rejection. Similarly, you may want to reject regions only if they exceed a certain minimum length, and you can accomplish this with the Unmark artifactual segments shorter than option. Finally, you may wish to reject a period before and after each marked section, which you can accomplish with the Add extra time... option.

⚠️ **GitHub.com Fallback** ⚠️