g.HIamp

class gpype.backend.sources.g_hiamp.GHIamp[source]

Bases: AmplifierSource

g.HIamp EEG amplifier for real-time data acquisition.

Interface to g.tec’s g.HIamp wired EEG amplifier system.

NUM_TIMELINE_CHANNELS = 1
class Configuration[source]

Bases: Configuration

Configuration class for g.HIamp amplifier parameters.

class Keys[source]

Bases: Keys

Configuration key constants for the g.HIamp amplifier.

ENABLE_DI = 'enable_di'

Configuration key for enabling the digital trigger input

ENABLE_COUNTER = 'enable_counter'

Configuration key for enabling counter channel

class OptionalKeys[source]

Bases: OptionalKeys

Configuration keys that may legitimately be absent.

SERIAL = 'serial'

The serial of the unit that opened, wherever one did. A process that opens no device – a server, or a replay – keeps None, which means what it meant to the author: whichever amplifier answers first.

__init__(serial=None, sampling_rate=None, channel_count=None, frame_size=None, enable_di=None, enable_counter=None, enable_oscar=False, edge_id=None, **kwargs)[source]

Initialize g.HIamp amplifier interface.

Parameters:
  • serial (str) – Device serial number. Uses first available if None.

  • sampling_rate (float) – Sampling frequency in Hz.

  • channel_count (int) – Number of EEG channels to acquire.

  • frame_size (int) – Samples per data frame (NumberOfScans).

  • enable_di (bool) – Enable digital trigger input channel.

  • enable_counter (bool) – Enable counter channel (increments each block).

  • enable_oscar (bool) – Run OSCAR artifact removal on this stream.

  • edge_id (Optional[str]) – Which edge runs this node, matched against the edge process’s –edge-id. None, the default, is every edge; ignored when the pipeline is not distributed.

  • **kwargs – Additional parameters for AmplifierSource.

Raises:
  • NotImplementedError – If not running on Windows.

  • RuntimeError – If GDS library unavailable or device init fails.

  • ValueError – If the sampling rate, frame size or channel count is not a whole number.

channel_units()[source]

One ‘uV’ per EEG channel (vendor/gds-headers’s GDSClientAPI_gHIamp.h: GDS_GHIAMP_SCALING.Offset is in uV), None for the digital input when enabled, and None for the arrival stamp. A channel enabling enable_counter overwrites a measured channel at a position this node does not track (see setup’s docstring), so it is still declared ‘uV’.

Return type:

Optional[list]

setup(data, port_context_in)[source]

Mark the digital input as a trigger, and stamp beside it.

The digital input is the only channel appended after the measured ones, so its position is unambiguous. Saying it is a trigger is what keeps a filter off it: a bandpass turns an edge into a decaying oscillation, and nothing about the result announces that it was ever an event.

The configuration counts the channels handed to the driver, so the digital input is added here, on the port, and the arrival stamp after it.

Enabling the counter replaces one of the measured channels rather than appending one, and which one is not exposed here, so it stays in the measured block exactly as it has always been.

Parameters:
  • data (dict[str, ndarray]) – Input data arrays (empty for source nodes).

  • port_context_in (dict[str, dict]) – Input port contexts (empty for source nodes).

Return type:

dict[str, dict]

Returns:

Output port contexts describing the channel layout.

start()[source]

Start g.HIamp data acquisition.

Initiates hardware data streaming and activates the amplifier for real-time EEG data processing.

Return type:

None

stop()[source]

Stop g.HIamp data acquisition and cleanup resources.

Stops hardware streaming and ensures proper shutdown of amplifier connection.

step(data)[source]

Process one step of data through g.HIamp source.

Parameters:

data (dict[str, ndarray]) – Input data dictionary with PORT_IN key containing EEG data.

Return type:

dict[str, ndarray]

Returns:

Output data dictionary with PORT_OUT key containing EEG data.