Skip to content

← diagnostics package

ChannelDiagnostics

This node calls several other nodes, such as LineNoise, CorrelationMetric and HighFrequencyNoise, to compute and display those metrics as topoplots, along with a single weighted "Bad Channel" signal quality metric also displayed as a topoplot.

This node can also optionally take in a stream of impedance values, such as those produced by the ComputeImpedance node, or which may be provided by a device (the channel names must match the channel names in the data packet coming into this node.) If provided, the impedance will be used in the bad channel classification. In the Bad Channel Classification, each channel is marked as "good" (1, green), "acceptable" (2, yellow), or "bad" (3, red). The classification is based on whether any of the following metrics are above the threshold (or below in the case of a metric where a lower value is worse, such as channel correlation) for the given channel: channel correlation, high frequency noise, impedance (if provided). There is a special case where if only the high frequency noise metric is "bad" (3), while the other metric(s) are either "good" (1) or "acceptable" (2), that channel will be set to a value of 4 and shown in purple. This allows you to distinguish cases where a channel is "bad" due to high frequency noise (which may not be immediately remediable in some situations) from cases where a channel is bad due to poor contact (which may be remediable). Note also that when computing the high frequency metric, there is the option to exclude the line noise frequency (e.g., 50 or 60 Hz) from the computation, which is set to True by default. In some cases where you don't have a separate line noise plot and are relying on the bad channel classification only, it may be preferable to set this to False. The computed metrics are also output via DataPorts, i.e., to wire into LSLOutput nodes for visualization elsewhere or into into TopoPlot node(s) for more control over the plot displays or to display only certain metrics only (in which case you should set no_plots=True). You should usually use a highpass filter (using FIRFilter) at 0.5 or 1 Hz before this node This node is for streaming data only. Version 2.0.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

impedance

Incoming impedance values; if present, will be used in the bad channel classification.

  • verbose name: Impedance
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: IN

ln_data

Line Noise values to plot. See Line Noise node for details.

  • verbose name: Ln Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

cm_data

Correlation Metric values to plot. See Correlation Metric node for details.

  • verbose name: Cm Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

hf_data

High Frequency Noise values to plot. See High Frequency Noise node for details.

  • verbose name: Hf Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

bc_data

Bad Channel Classification values to plot. These are output as values of either 1, 2, or 3 (with a special case of 4, see documentation), which correspond to good, acceptable, or bad, respectively; in the Bad Channel topoplot these values are represented by green, yellow, red, respectively.)

  • verbose name: Bc Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: OUT

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).

  • verbose name: Line Noise Frequency (Hz)
  • default value: 60Hz
  • port type: EnumPort
  • value type: str (can be None)

min_corr

Channel correlation threshold used in the Bad Channel Classification metric. This takes a list of two values. The first is the lower minimum threshold, below which channels are marked as "bad" (red in the Bad Channel topoplot), while the second is the upper minimum threshold, below which channels are marked as "acceptable" (yellow in the Bad Channel topoplot). See the Correlation Metric node for details on this metric. Note: This node presently also takes a single float instead of a list of two floats, for backward compatibility; this will be changed in a future version to only accept a list.

  • verbose name: Channel Correlation Threshold
  • default value: [0.7, 0.8]
  • port type: Port
  • value type: object (can be None)

hf_thresh

High frequency noise threshold used in the Bad Channel Classification metric. This takes a list of two values. The first is the lower bound minimum threshold, below which channels are marked as "good" (green in the Bad Channel topoplot), above which channels are marked as "acceptable" (yellow in the Bad Channel topoplot). The second in the upper bound minimum threshold, above which channels are marked as "bad" (red in the Bad Channel topoplot). See the High Frequency Noise node for details on this metric.

  • verbose name: High Frequency Noise Threshold
  • default value: [3, 4]
  • port type: ListPort
  • value type: list (can be None)

exclude_line_noise

Do not take line noise into account in the High Frequency Noise metric.

  • verbose name: Exclude Line Noise
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

impedance_thresh

Impedance threshold used in the Bad Channel Classification metric. This takes a list of two values. The first is the lower bound minimum threshold, below which channels are marked as "good" (green in the Bad Channel topoplot), and above which channels are marked as "acceptable" (yellow in the Bad Channel topoplot). The second is the upper bound minimum threshold, above which channels are marked as "bad" (red in the Bad Channel topoplot). The unit is expected to be in kOhms, and can be taken from the Compute Impedance node, or provided in an LSL stream by the device.

  • verbose name: Impedance Threshold
  • default value: [1000, 2500]
  • port type: ListPort
  • value type: list (can be None)

title_prefix

Prefix to prepend to all plot titles.

  • verbose name: Plot Title Prefix
  • default value:
  • port type: StringPort
  • value type: str (can be None)

initial_dims_hf

Initial position of the plot window on the monitor, in pixels, as [x, y, width, height]. If x, y are set to 0 the plot window will appear in the top left corner of the screen.

  • verbose name: High Freq Noise Plot
  • default value: [0, 500, 500, 400]
  • port type: ListPort
  • value type: list (can be None)

initial_dims_ln

Initial position of the plot window on the monitor, in pixels, as [x, y, width, height]. If x, y are set to 0 the plot window will appear in the top left corner of the screen.

  • verbose name: Line Noise Plot
  • default value: [0, 950, 500, 400]
  • port type: ListPort
  • value type: list (can be None)

initial_dims_cm

Initial position of the plot window on the monitor, in pixels, as [x, y, width, height]. If x, y are set to 0 the plot window will appear in the top left corner of the screen.

  • verbose name: Correlation Plot
  • default value: [0, 0, 500, 400]
  • port type: ListPort
  • value type: list (can be None)

initial_dims_bc

Initial position of the plot window on the monitor, in pixels, as [x, y, width, height]. If x, y are set to 0 the plot window will appear in the top left corner of the screen.

  • verbose name: Bad Channel Plot
  • default value: [600, 500, 500, 400]
  • port type: ListPort
  • value type: list (can be None)

hf_stop_atten

Stopband attenuation in dB for the high-frequency noise filters. Higher values (e.g. 120) give sharper filter rolloff and more accurate HF noise estimates, but increase computation time. Lower values (e.g. 80) are faster, especially on ARM-based systems.

  • verbose name: Hf Filter Stopband Attenuation
  • default value: 120
  • port type: IntPort
  • value type: int (can be None)

no_plots

Do not show any plots. Use this if you only want to output the computed metrics (i.e., to be streamed over LSL for plotting elsewhere, or saved to disk, etc.), or if you want to plot only some of the metrics (wire them into a TopoPlot node directly).

  • verbose name: No Plots
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

always_on_top

Plot windows should be always appear on top of other windows.

  • verbose name: Always On Top
  • default value: True
  • 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)