Skip to content

← utilities package

GetStreamProperty

Get (fetch) a metadata property of a given stream.

In NeuroPype, each data Packet has one or more streams (internally of type "Chunk") carrying data such as EEG or event markers. Each such stream (chunk) has a dictionary of metadata properties, holding information such as the modality of the data (EEG, NIRS, etc.), the origin of the data (file path that the data was originally loaded from), the name of the original LSL stream, the delay incurred by the applied filters, and so on. There are preset properties such as 'is_streaming', 'source_url', 'modality', 'subject_id', etc., but any custom property can also be set using the SetStreamProperties node (or when creating the originating LSL stream). You may specify a stream name or modality (i.e., EEG) to fetch properties from that stream, or else the first stream will be searched. Multi-level properties can be specified using a period (.) as a delimiter: subject.hair.length will fetch nested property <desc><subject><hair><length>. The value will be available through the prop_value output port. If the property does not exist, the output will be None. Version 1.0.0

Ports/Properties

data

Data to process.

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

prop_value

Value of the fetched property.

verbose name
Prop Value
default value
None
port type
DataPort
value type
object (can be None)
data direction
OUT

property

Property to get (fetch). I.e., 'is_streaming', 'source_url', 'modality', `subject_id', 'meta_unit', etc. See Flags, Origin and Metadata constants in the documentation for a list of commonly used properties, which are also available from the drop-down menu. You can also type in a custom property name. Use a dot (.) to indicate nested property names, i.e.: 'metadata.cap.size'. Flags (i.e., 'is_streaming') will be returned as a boolean value.

verbose name
Property
default value
None
port type
ComboPort
value type
str (can be None)

stream

Optionally, the name of stream from which to fetch the property. Leave empty to find the first stream matching the modality (if specified), or first overall (if modality is not specified).

verbose name
Stream
default value
None
port type
StringPort
value type
str (can be None)

modality

Optionally, the modality of the stream to fetch properties from. The first stream matching this modality will be returned. Ignored if stream name is specified.

verbose name
Modality
default value
None
port type
ComboPort
value type
str (can be None)

only_nonempty

Only consider streams with non-empty data.

verbose name
Only Non-Empty Streams
default value
False
port type
BoolPort
value type
bool (can be None)

handle_missing

Action to take if the property is not found. If 'none', the output will be None with no log message (nodes such as If/Else will interpret None as False). If 'warn', the output will be None with a warning. If 'error', an error will be raised.

verbose name
Handle Missing
default value
warn
port type
ComboPort
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)