Skip to content

← formatting package

ExtractStreams

Extract streams which match a certain criteria, either the stream name, or certain stream properties (i.e

., modality). This will create a new packet that has only the matched streams, or returns None (not an empty Packet) if no matching streams are found. (Technical note: streams are Chunk objects in the Packet structure.) Version 2.3.2

Ports/Properties

data

Data to process.

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

streams

Names of the streams to extract. This corresponds to the name of the stream in the data packet. When importing data, or receiving live data via LSL, streams are by default named by modality (e.g., eeg, nirs), possibly followed by some suffix (since stream names must be unique), e.g., 'eeg1'), though streams may also be named after the original LSL stream name (if the use_streamnames is selected in the ImportXDF or LSLInput node). An event marker stream will by default be named markers. Some processing nodes may create derived streams and then append additional suffixes to the stream name (this is specified in the node documentation). If selection_criteria is also specified, the criteria will be evaluated first, and the stream_names will be selected from among those matching the criteria (if any). You can use the InspectPacket or PrintToConsole nodes to see the stream names in your data.

verbose name
Streams
default value
[]
port type
ListPort
value type
list (can be None)

stream_names

stream_names as been renamed to streams

verbose name
Stream Names
default value
None
port type
AliasPort
value type
list (can be None)

selection_criteria

A dictionary of criteria in the form of {'field1':'value1', 'field2':'value2'} where field is a stream property, and value is value to match. Common properties are defined in the Origin class: modality, stream_name (the name of the origin LSL stream, not the name of the stream in the data packet), source_url, subject_id, session_id, which can be referenced in the following manner: Origin.source_url etc. (see the constants.py file for a complete list). Custom properties in the desc property of the stream (as per the LSL and XDF specs) may also be specified by prefixing with desc, i.e., desc.cap.size.

verbose name
Selection Criteria
default value
{}
port type
DictPort
value type
dict (can be None)

selection_operator

The logical operator to use when multiple selection criteria are specified. If 'AND', all criteria must be met for a stream to be selected. If 'OR', any criteria may be met. This only applies to the selection_criteria property.

verbose name
Selection Operator
default value
AND
port type
EnumPort
value type
str (can be None)

support_wildcards

Support for wildcard matching. This applies to both stream_names and the selection_criteria. Note that regular expressions is not supported, only * and ? pattern matching.

verbose name
Support Wildcards
default value
False
port type
BoolPort
value type
bool (can be None)

invert

Invert the selection. If True, the selected streams will be excluded from the output.

verbose name
Invert
default value
False
port type
BoolPort
value type
bool (can be None)

if_missing

What to do if one or more of stream_names are not found in the data. If 'warn', a warning will be logged with the list of the streams not found (those which are found will be returned). If 'raise', an error will be raised if no matching streams are found. This can be useful to check that a desired list of streams are in the data before performing further downstream analysis and raise an error otherwise. If 'ignore', no warning will be logged if some or all of the streams are not found. Note that this applies to stream_names only, not to selection_criteria.

verbose name
If Missing
default value
warn
port type
EnumPort
value type
str (can be None)

verbose

Log message of extracted streams.

verbose name
Verbose
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)