EegQualityMetrics¶
Computes quality metrics for an EEG dataset/file (average for the entire dataset/file).
For offline (non-streaming) data only. Thi node expects an incoming packet to contain a full file/dataset to process. If multiple packets (datasets) are received in succession, (i.e., if multiple files are being processed), average metrics for all datasets will be generated if the concatenate files option is selected; the metrics for each individual dataset/file will be exported to CSV if that option is selected. Non-EEG channels should be removed before running this node (i.e., using AssignChannelLocations and RemoveUnlocalizedChannels). The output (all_quality_metrics_out) of this node can be wired into the QualityMetricsPlots node for generating plots (providing the Reporting package is installed), or the output of individual quality metrics can be wired into a visualization nodes (use TopoPlot for session average outputs, and TimeSeriesPlot for measures over time).
Version 2.5.1
Ports/Properties¶
data¶
Data to process.
all_quality_metrics_out¶
A dictionary containing all the quality metrics, to be wired into the QualityMetricsPlots node. This can take the place of all the other outgoing data ports.
diag_flat_out¶
Flatline channels (session average)
diag_bad_out¶
Bad Channel metric (session average)
diag_drop_out¶
Channel Dropout metric (session average)
diag_cor_out¶
Channel Correlation metric (session average)
diag_noise_out¶
Noise Level metric (session average)
art_rem_out¶
Artifact Ratio metric (session average)
art_ratio_time_out¶
Artifact Ratio metric (by time)
ln_data_out¶
Line Noise metric (session average)
diag_drop_time_out¶
Channel Dropout metric (by time)
ln_data_time_out¶
Line Noise metric (by time)
data_badtime_out¶
Data after bad time windows removed (by time)
bad_channels¶
A list of the channel removed (names).
channel_range¶
Channel range to retain. Use a Python slice (0:10) or range (0..10) syntax with the indexes of the channels as they appear in the data.
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.
line_noise_frequency¶
Frequency in Hz that line noise is expected due to AC power (e.g . USA is 60 Hz, Europe is 50 Hz). Use 'auto' to detect the mains frequency automatically.
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.
convolution_method¶
FIRFilter coefficients can be convolved with the input signal using multiple methods. The standard method performs time-domain convolution. For long signals (>214 samples) using filters with a modest number of coefficients (>24), it can be faster to do the convolution in the frequency domain using the overlap-add method.
flatline_max_fraction¶
Maximum fraction of time, relative to the session length, a channel must be flatlined to be flagged as "flatlined".
bad_channel_corr_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.
bad_channel_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.
bad_channel_num_samples¶
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.
bad_channel_use_clean_window¶
Use clean time windows for calibration for the bad channel metric computation. 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 (uncorrelated with neighboring channels, HF noise) during time windows when the data is considered "good" overall (other channels are ok).
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. (For the Bad Channel setting, see bad_channel_use_clean_window.)
init_on¶
Time range to calibrate (initialize) the filter on. This parameter can take a single number or two numbers. In case of streaming data, this should always be a single number, representing the number of seconds to buffer from the start of the data, for calibration. In case of offline (recorded) data, this can either be a single number, in which case it represents the window of time in seconds from the beginning of the recording to be used; or, it can be a list of two numbers, in which case this refers to a range of data in seconds, relative to the start of the data, to be used for calibration. The latter allows you to calibrate on data other than the first segment of the data (i.e., if known to be bad), or to avoid running the (fairly expensive) filter on a very long file or on each fold of a cross-validation. Note that a value of 0 here will in the case of offline data be interpreted as the entire file, and in the case of streaming data will raise an error.
calib_seconds¶
Amount of data, in seconds, to buffer for calibration on streaming data. For offline (non-streaming) data use the "calibration range" (init_on) parameter instead.
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.
max_bad_channels¶
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.3 (very lax cleaning of only coarse artifacts).
montage¶
Optionally a montage file (.l ocs format) to use. This may be a montage file that ships with Neuropype (available in resources/montages), in which case only the filename is needed, or the full path to a montage located elsewhere. This is only needed if electrodes locations are not accurately determined using one of the standard montages.
concatenate_files¶
Concatenates the result of each incoming file, to generate multi-file averages. Uncheck if generating a single report for each file.
use_caching¶
Enable caching. This will significantly speed up re-use of the same data.
compute_time¶
Compute metrics over time. Set to false if concatenating multiple files.
win_len¶
Sliding window length for line noise metric over time. A longer window will yield a better estimate, but the spectrum will change more slowly and will also react more slowly to changes. Typical settings for EEG phenomena are 0.5 to 5 seconds, but for very slowly (or rapidly) changing brain dynamics, longer (or shorter) windows may be used.
offset_len¶
Amount of shift or offset between the beginning of the time window segments. If this value is not set, it is assumed that the overlap length is half of the window length, corresponding to 50% overlap.
unit¶
Unit in which the window and offset length is given.
use_legacy¶
Use legacy method for computing artifact ratio.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.