Skip to content

Description

Preprocess EEG only. Outputs as <filename>.preprocessed.h5 and does not generate a report.

PARAMETERS

Category: Input/Output

This pipeline expects one file (or a Path Iterator formatted path name) and its path is relative to your Neuroscale account storage bucket. (The easiest way to run it is to go to your Storage page, select the file, click the Task button which will take you to the Create Task page, and then select this pipeline. The filename will be filed in automatically.)

input path

The input data file(s) that the pipeline will process. This can be a list of files, or a wild card expression (studies/Subject*/myfile.set). If more than one file is specified or is found to match the expression, a separate report will be generated for each file.

stream names

Names of the streams to extract. Technical comment: this corresponds to the name of the stream chunk in the data packet, which is typically the modality (e.g., 'eeg') possibly followed by some suffix (since stream names must be unique), e.g., 'eeg1'). A few nodes may also create derived streams from a stream and then append additional suffixes, e.g., 'eeg1-hr' for a heart rate stream that was derived from the 'eeg1' stream. If selection_criteria is also specified, the criteria will be evaluated first, and the stream_names will be selected from among those matching the criteria (if any).

channels to import

List of channels to retain. Comma-separated lists of channel names. If empty, all channels will be retained.

use caching

Enable caching. This will significantly speed up re-use of the same data.

Category: Skip

skip if exists

If True, skip processing files if <filename>.preprocessed.h5 has already been generated.

skip preprocessing

Whether or not to skip the preprocessing stage. This should usually be False, unless the data has already been preprocessed (filtered, rereferenced, cleaned, etc.) and the input file is this preprocessed version of the data.

skip dejitter

Skip timestamp dejittering.

skip artifact removal

Skip artifact and bad time window removal. For debugging.

skip bad channel removal

Skip bad channel removal. For special cases.

skip low pass filter

Skip low pass filter. For debugging.

skip high pass filter

Skip high pass filter. For debugging.

skip interpolate

Skip interpolation of missing channels. Channel interpolation results in a less-than-full rank matrix of data. This can be a problem for some signal processing algorithms (e.g. ICA) so it may be desirable to skip interpolation. However, skipping interpolation will likely result in different channel sets for different data chunks. For this reason, interpolation should only be skipped when multi-chunk data will be aggregated in source space and not in sensor space.

Category: Signal

This pipeline preprocesses the EEG data including:

  • high and low pass filtering
  • rereferencing
  • removing and reinterpolating bad channels
  • removing bad time windows
  • cleaning artifacts
  • de-jittering timestamps
  • rescaling
  • Parameters for some of these functions are included in this section.

scale factor

Scaling factor. The signal is scaled by this factor. Can be used for manual unit conversion.

use notch filter

Use a notch filter to remove line noise. If true, this will be applied at the beginning of the preprocessing chain before bad channel and artifact removal.

notch frequency

Target frequency in Hz to remove using a notch filter at the beginning of the preprocessing chain.

lowpass frequencies

High noise frequencies to be filtered out with a lowpass filter. You can either give the cutoff frequency as a single value, or two frequencies (separated by a comma), to specify the rolloff curve.

lowpass stop atten

Minimum attenuation in stopband for the lowpass filter. This is the minimum acceptable attenuation, in dB, in the stopband, which is ideally infinitely suppressed, but in practice 30-80 dB are often enough unless there is enormous drift (e.g., with some dry headsets).

highpass frequencies

Low noise frequencies to be filtered out with a highpass filter. You can either give the cutoff frequency as a single value, or two frequencies (separated by a comma), to specify the rolloff curve.

highpass stop atten

Minimum attenuation in stopband for the highpass filter. This is the minimum acceptable attenuation, in dB, in the stopband, which is ideally infinitely suppressed, but in practice 30-80 dB are enough, depending on the amplitudes of the signals to attenuate.

re-referencing

Re-referencing. For common average referencing, enter: ['CAR']. To reference to certain channels, a list of comma-separated channel labels can be given. Leave empty to skip re-referencing.

desired sampling rate

Target sampling rate (in Hz). If you want to resample the data, specify the sampling rate here. Leave empty to not performing resampling.

fix unit

Runs the FixSignalUnit node to determine the signal unit from the signal data. Sets the unit to uV by default.

desired unit

Desired unit of the signal. If set to keep, then the signal is not altered (but the inferred unit will be stored in the annotation).

bad channel correlation threshold

Correlation threshold. Higher values (above 0.7) are more stringent and will remove more channels (i.e., moderately bad channels get removed). Values below 0.6 would be considered very lax (i.e., only the worst channels get removed). This threshold is based on the correlation between a channel and what one would expect the channel to be given the other channels. Note that this parameter is only used when channel locations are available as it is based on each channel's positional neighbors.

skip artifact removal

Skip artifact and bad time window removal.

Category: Bad Channel Detection

correlation threshold

Correlation threshold. Higher values (above 0.7) are more stringent and will remove more channels (i.e., moderately bad channels get removed). Values below 0.6 would be considered very lax (i.e., only the worst channels get removed). This threshold is based on the correlation between a channel and what one would expect the channel to be given the other channels. Note that this parameter is only used when channel locations are available.

bad channel noise threshold

High-frequency noise threshold. Lower values (below 3.5) are more stringent and will remove more channels (i.e., moderately bad channels will get removed). Values above 5 would be considered very lax (i.e., only the worst channels get removed). This threshold is based on the amount of high frequency noise compared to other channels, and is measured in standard deviations.

RANSAC subset size

Size of random channel subsets to use. This is for use in a RANSAC estimator, and is given as a fraction of the total number of channels. Smaller subsets together with higher number of Ransac samples gives a more robust estimate, at increased computational cost during calibration.

RANSAC subset count

Number of random channel subsets to use. This for use in a RANSAC estimator. Higher numbers together with smaller subset sizes give a more robust estimate, at higher computational cost during calibration.

max allowed broken fraction

Maximum duration or fraction of broken data to tolerate. Maximum time, either in seconds or as fraction of the calibration data, if below 1.0, during which a channel may be broken while still considered good (i.e., usable). This value should not be larger than half the duration of the calibration data.

remove unlocalized chans

Remove unlocalized channels. Set to False to allow channels that have no positions or do not match an available montage.

montage

Choose the montage to use from among a list of common options. If set to auto, the best-matching montage will be used.

Category: Artifact Removal

burst removal cutoff

Threshold for burst-type artifact removal, in standard deviations. Data portions whose amplitude is larger than this threshold (relative to the calibration data) are considered bad data and will be removed. The most aggressive value that can be used without losing too much EEG is 3. A quite conservative value would be 10.0.

use clean window

Use clean time windows to calibrate artifact removal thresholds. This applies to all artifact removal steps that involve such a calibration, including bad-channel removal and burst-artifact removal. Setting this to False will flag channels as bad if they are across the entire file including time windows when the data is considered bad. Set to True (default) is a more stringent test that only flags channels as bad if they are deemed so during time windows when the data is considered 'good' overall (other channels are ok).

calib seconds

Minimum amount of data to gather for calibration. When this filter is run online and has not yet been calibrated, then it will first buffer this many seconds of data in order to compute its measures before any output is produced. (This is used both for bad channel removal and artifact removal.)

initialize on this time range

Time range to initialize on. If two numbers are given, either in seconds, or as fractions of the calibration data (if both below 1), then the filter will be initialized only on that subset of the calibration data. Another use case is to select an initial baseline period in a longer recording, in order to avoid having to re-run the (fairly expensive) filter in each fold of a cross-validation.

clean signal range

Minimum and maximum of clean signal range, in multiples of standard deviation. The minimum and maximum standard deviations within which the power of a channel must lie (relative to a robust estimate of the clean EEG power distribution in the channel) for it to be considered not bad. Use values between [-10 15].

max bad channels allowed (bad time window removal)

Maximum fraction of bad channels allowed. The maximum fraction of bad channels that a retained window may still contain (more than this and it is removed). Reasonable range is 0.05 (very clean output) to 0.30 (very lax cleaning of only coarse artifacts).

max allowed broken fraction

Maximum duration or fraction of broken data to tolerate. Maximum time, either in seconds or as fraction of the calibration data, if below 1.0, during which a channel may be broken while still considered good (i.e., usable). This value should not be larger than half the duration of the calibration data.

asr legacy

Set as True to deal with pymanopt tensorflow library conflicts with ASR.