ezmsg.lsl.outlet#

Functions

generate_source_id(name, stream_type, channel_count, nominal_srate, channel_format)[source]#

Generate a stable source_id hash from stream metadata.

Parameters:
  • name (str | None)

  • stream_type (str | None)

  • channel_count (int)

  • nominal_srate (float)

  • channel_format (str)

Return type:

str

Classes

class LSLOutletSettings(stream_name: str | None = None, stream_type: str | None = None, map_file: str | None = None, use_message_timestamp: bool = True, assume_lsl_clock: bool = False)[source]#

Bases: Settings

Parameters:
  • stream_name (str | None)

  • stream_type (str | None)

  • map_file (str | None)

  • use_message_timestamp (bool)

  • assume_lsl_clock (bool)

stream_name: str | None = None#
stream_type: str | None = None#
map_file: str | None = None#

Path to file containing a list of channel names and locations. This feature is experimental and not tested.

use_message_timestamp: bool = True#

Whether to push the data with the incoming timestamps (True, default) or to ignore the incoming timestamps and push the data with the current pylsl.local_clock (False). When True, the incoming data must have a “time” dimension.

assume_lsl_clock: bool = False#

When use_message_timestamp is True, this indicates whether the incoming timestamps were already in the lsl clock (see LslInletSettings). If False, the incoming timestamps are assumed to be in the system time.time clock and are converted to the lsl clock. Note: Ignored when use_message_timestamp is False.

__init__(stream_name=None, stream_type=None, map_file=None, use_message_timestamp=True, assume_lsl_clock=False)#
Parameters:
  • stream_name (str | None)

  • stream_type (str | None)

  • map_file (str | None)

  • use_message_timestamp (bool)

  • assume_lsl_clock (bool)

Return type:

None

class LSLOutletState[source]#

Bases: State

outlet: StreamOutlet | None = None#
clock_sync: ClockSync = <ezmsg.lsl.util.ClockSync object>#
hash: int = 0#
class LSLOutletUnit(*args, settings=None, **kwargs)[source]#

Bases: Unit

Represents a node in a Labgraph graph that subscribes to messages in a Labgraph topic and forwards them by writing to an LSL outlet.

Parameters:
  • stream_name – The name of the created LSL outlet.

  • stream_type – The type of the created LSL outlet.

  • settings (Settings | None)

INPUT_SIGNAL = InputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>]()#
SETTINGS#

alias of LSLOutletSettings

STATE#

alias of LSLOutletState

async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

create_processor()[source]#
async update_clock()[source]#
Return type:

None

async lsl_outlet(msg)[source]#
Parameters:

msg (AxisArray)

Return type:

None

class OutletProcessor(*args, settings=None, **kwargs)[source]#

Bases: object

Parameters:

settings (LSLOutletSettings | None)

__init__(*args, settings=None, **kwargs)[source]#
Parameters:

settings (LSLOutletSettings | None)

property state: LSLOutletState#
shutdown()[source]#
check_metadata(message)[source]#
Parameters:

message (AxisArray)

Return type:

bool

reset(message)[source]#
Parameters:

message (AxisArray)

Return type:

None

send(message)#

Call self as a function.

Parameters:

message (AxisArray)

generate_source_id(name, stream_type, channel_count, nominal_srate, channel_format)[source]#

Generate a stable source_id hash from stream metadata.

Parameters:
  • name (str | None)

  • stream_type (str | None)

  • channel_count (int)

  • nominal_srate (float)

  • channel_format (str)

Return type:

str

class LSLOutletSettings(stream_name: str | None = None, stream_type: str | None = None, map_file: str | None = None, use_message_timestamp: bool = True, assume_lsl_clock: bool = False)[source]#

Bases: Settings

Parameters:
  • stream_name (str | None)

  • stream_type (str | None)

  • map_file (str | None)

  • use_message_timestamp (bool)

  • assume_lsl_clock (bool)

stream_name: str | None = None#
stream_type: str | None = None#
map_file: str | None = None#

Path to file containing a list of channel names and locations. This feature is experimental and not tested.

use_message_timestamp: bool = True#

Whether to push the data with the incoming timestamps (True, default) or to ignore the incoming timestamps and push the data with the current pylsl.local_clock (False). When True, the incoming data must have a “time” dimension.

assume_lsl_clock: bool = False#

When use_message_timestamp is True, this indicates whether the incoming timestamps were already in the lsl clock (see LslInletSettings). If False, the incoming timestamps are assumed to be in the system time.time clock and are converted to the lsl clock. Note: Ignored when use_message_timestamp is False.

__init__(stream_name=None, stream_type=None, map_file=None, use_message_timestamp=True, assume_lsl_clock=False)#
Parameters:
  • stream_name (str | None)

  • stream_type (str | None)

  • map_file (str | None)

  • use_message_timestamp (bool)

  • assume_lsl_clock (bool)

Return type:

None

class LSLOutletState[source]#

Bases: State

outlet: StreamOutlet | None = None#
clock_sync: ClockSync = <ezmsg.lsl.util.ClockSync object>#
hash: int = 0#
class OutletProcessor(*args, settings=None, **kwargs)[source]#

Bases: object

Parameters:

settings (LSLOutletSettings | None)

__init__(*args, settings=None, **kwargs)[source]#
Parameters:

settings (LSLOutletSettings | None)

property state: LSLOutletState#
shutdown()[source]#
check_metadata(message)[source]#
Parameters:

message (AxisArray)

Return type:

bool

reset(message)[source]#
Parameters:

message (AxisArray)

Return type:

None

send(message)#

Call self as a function.

Parameters:

message (AxisArray)

class LSLOutletUnit(*args, settings=None, **kwargs)[source]#

Bases: Unit

Represents a node in a Labgraph graph that subscribes to messages in a Labgraph topic and forwards them by writing to an LSL outlet.

Parameters:
  • stream_name – The name of the created LSL outlet.

  • stream_type – The type of the created LSL outlet.

  • settings (Settings | None)

INPUT_SIGNAL = InputStream:unlocated[<class 'ezmsg.util.messages.axisarray.AxisArray'>]()#
SETTINGS#

alias of LSLOutletSettings

STATE#

alias of LSLOutletState

async initialize()[source]#

Runs when the Unit is instantiated. This is called from within the same process this unit will live. This lifecycle hook can be overridden. It can be run as async functions by simply adding the async keyword when overriding.

Return type:

None

create_processor()[source]#
async update_clock()[source]#
Return type:

None

async lsl_outlet(msg)[source]#
Parameters:

msg (AxisArray)

Return type:

None