Skip to content

← diagnostics package

Alert

Shows and/or sounds an alert if incoming values are a 1 (ON), otherwise does nothing (this node does not pass data through).

It is assumed the incoming packet contains a data tensor with either 1s or 0s (ON or OFF). The require_all parameter determines behavior if there are some 1s and some 0s. Use an upstream node, such as the Step node, to set this value (i.e., based on a threshold). Alternatively, this node can be configured to trigger an alert when a given event marker(s) is received in a marker stream (see stream_properties property). This node also creates a new marker stream with alerts which can be wired into an LSLOutput node for notification via LSL. Version 0.10.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

notifs

Notifications/alerts as markers in a marker stream

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

Pop up a notification window when alert is ON.

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

play_sound

Play a sound (computer beep) when alert is ON. On linux this requires the sox library to be installed on the system (i.e., sudo apt install sox) and may also require pulseaudio (i.e., sudo apt install pulseaudio).

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

sound_properties

Properties of the sound to play. This can either be a two element list with frequency (Hz) and duration (seconds) of the sound to play (i.e., [440, 0.5] for a 440 Hz tone lasting 0.5 seconds), or a string representing the filename of a sound file (.wav) to play. Note that, while file playback is asynchronous, the frequency/duration format will block NeuroPype for the duration of the audio.

  • verbose name: Sound Properties
  • default value: [440, 0.5]
  • port type: Port
  • value type: object (can be None)

continuous_alert

If true, the alert will be sent with each packet, if an alert is triggered. If false, the alert will only be sent if the previous packet did not trigger an alert. Set to false if you only want an alert when i.e. a threshold (or other trigger) is first tripped; set to true if you want a continuous alert while the threshold or trigger is tripped.

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

require_all

Require all values in the incoming packet to be 1 (ON) before sending an alert. If false, an alert will be sent if any value in the packet is 1.

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

alert_on_marker

If this is set, an alert will be triggered when a matching event marker is received instead of when the data stream has a value of 1. Wildcards (*, ?) are supported (so *on will trigger on any marker ending in on. If this is empty or None, then an alert will be triggered if the data tensor of the incoming packet has a value of 1 (or multiple values of 1 if require_all is set).

  • verbose name: Alert On Marker
  • default value: None
  • port type: StringPort
  • value type: str (can be None)

alert_message

Message to display in the alert window or print in the logs.

  • verbose name: Alert Message
  • default value: Alert triggered
  • port type: StringPort
  • value type: str (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)