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.
- verbose name: Data
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: IN
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.
- verbose name: All Quality Metrics Out
- default value: None
- port type: DataPort
- value type: dict (can be None)
- data direction: OUT
diag_flat_out¶
Flatline channels (session average)
- verbose name: Diag Flat Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
diag_bad_out¶
Bad Channel metric (session average)
- verbose name: Diag Bad Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
diag_drop_out¶
Channel Dropout metric (session average)
- verbose name: Diag Drop Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
diag_cor_out¶
Channel Correlation metric (session average)
- verbose name: Diag Cor Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
diag_noise_out¶
Noise Level metric (session average)
- verbose name: Diag Noise Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
art_rem_out¶
Artifact Ratio metric (session average)
- verbose name: Art Rem Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
art_ratio_time_out¶
Artifact Ratio metric (by time)
- verbose name: Art Ratio Time Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
ln_data_out¶
Line Noise metric (session average)
- verbose name: Ln Data Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
diag_drop_time_out¶
Channel Dropout metric (by time)
- verbose name: Diag Drop Time Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
ln_data_time_out¶
Line Noise metric (by time)
- verbose name: Ln Data Time Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
data_badtime_out¶
Data after bad time windows removed (by time)
- verbose name: Data Badtime Out
- default value: None
- port type: DataPort
- value type: Packet (can be None)
- data direction: OUT
bad_channels¶
A list of the channel removed (names).
- verbose name: Bad Channels
- default value: None
- port type: DataPort
- value type: list (can be None)
- data direction: OUT
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.
- verbose name: Channel Range
- default value: :
- port type: Port
- value type: object (can be None)
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.
- verbose name: Highpass Frequencies
- default value: [0.5, 1.0]
- port type: ListPort
- value type: list (can be None)
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.
- verbose name: Highpass Min Stopband Attenuation
- default value: 50.0
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Line Noise Frequency (Hz)
- default value: auto
- port type: EnumPort
- value type: str (can be None)
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.
- verbose name: Use Notch Filter
- default value: False
- port type: BoolPort
- value type: bool (can be None)
notch_frequency¶
Target frequency in Hz to remove using a notch filter at the beginning of the preprocessing chain.
- verbose name: Notch Frequency
- default value: 60.0
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Method Of Convolution
- default value: standard
- port type: EnumPort
- value type: str (can be None)
flatline_max_fraction¶
Maximum fraction of time, relative to the session length, a channel must be flatlined to be flagged as "flatlined".
- verbose name: Flatline Max Fraction
- default value: 0.2
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Correlation Threshold
- default value: 0.8
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Bad Channel Noise Threshold
- default value: 4
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Bad Channel Subset Size
- default value: 0.15
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Bad Channel Num Samples
- default value: 200
- port type: IntPort
- value type: int (can be None)
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).
- verbose name: Bad Channel Use Clean Window
- default value: True
- port type: BoolPort
- value type: bool (can be None)
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.
- verbose name: Burst Removal Cutoff
- default value: 10.0
- port type: FloatPort
- value type: float (can be None)
use_clean_window¶
Use clean time windows to calibrate artifact removal thresholds. (For the Bad Channel setting, see bad_channel_use_clean_window.)
- verbose name: Use Clean Window
- default value: True
- port type: BoolPort
- value type: bool (can be None)
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.
- verbose name: Calibration Range
- default value: []
- port type: ListPort
- value type: list (can be None)
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.
- verbose name: Calib Seconds
- default value: 0
- port type: IntPort
- value type: int (can be None)
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.
- verbose name: Clean Signal Range
- default value: [-4, 6]
- port type: ListPort
- value type: list (can be None)
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).
- verbose name: Max Bad Channels
- default value: 0.2
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Montage File
- default value:
- port type: StringPort
- value type: str (can be None)
concatenate_files¶
Concatenates the result of each incoming file, to generate multi-file averages. Uncheck if generating a single report for each file.
- verbose name: Concatenate Files
- default value: False
- port type: BoolPort
- value type: bool (can be None)
use_caching¶
Enable caching. This will significantly speed up re-use of the same data.
- verbose name: Use Caching
- default value: True
- port type: BoolPort
- value type: bool (can be None)
compute_time¶
Compute metrics over time. Set to false if concatenating multiple files.
- verbose name: Compute Time
- default value: True
- port type: BoolPort
- value type: bool (can be None)
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.
- verbose name: Sliding Window Length
- default value: 2
- port type: FloatPort
- value type: float (can be None)
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.
- verbose name: Offset Length
- default value: None
- port type: FloatPort
- value type: float (can be None)
unit¶
Unit in which the window and offset length is given.
- verbose name: Unit Of Measurement For Window Length
- default value: seconds
- port type: EnumPort
- value type: str (can be None)
use_legacy¶
Use legacy method for computing artifact ratio.
- verbose name: Use Legacy
- default value: False
- port type: BoolPort
- value type: bool (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)