Contributions:gEstimFilter

This filter allows for cortical stimulation with the g.tec gEstim PRO. This extension resides in the Application module and allows for electrical stimulation. Note: As of rev.6131, this extension does not work the the gEstim FES Research. The extension has only been tested with the g.Estim PRO.
Versioning
Authors
Kristopher Kaleb Goering (kaleb.goering@gmail.com)
Alexander Belsten (belsten@neurotechcenter.org)
Will Engelhardt (engelhardt@neurotechcenter.org)
Source Code Revisions
- Initial development: --
- Tested under: 6191
- Known to compile under: 6191
- Broken since: --
Installation / Versions
The gEstimPro drivers must be installed. Contact gTec to obtain access.
The gEstim has 2 modes that can be used in BCI2000: basic and advanced. These are set by the parameter DeviceMode. There are a variety of features that require the advanced mode, which can only be enabled when a gTec USB dongle is attached. These also require various firmware versions, detailed below.
| Feature | Minimum Firmware |
|---|---|
| Supermode | 1.23 |
| Asymmetric (Lilly) pulses | 1.7 |
To use the dongle with BCI2000, you need to download the Sentinel LDK HASP driver. To make sure this is downloaded, when you plug in the gEstim USB, check Device Manager, and Sentinel HASP Key should appear under Universal Serial Bus controllers.
Integration into BCI2000
This extension resides in the private directory of BCI2000. It must be enabled in CMake by selecting BUILD_GESTIMFILTER. Then recompile the BCI2000FrameworkAppModule, and the application module you are using. Lastly, append the enable flag to your batch file (ex: Start executable StimulusPresentation --local --ActivateEstim=1).
Parameters
The gEstim device is configured in the gEstim tab. The configurable parameters are:
Set-up Preferences

ActivateEstim
Enables/disables device.
UseStimulusPresentation

EstimOn to stimuli to trigger stimulationThis parameter can be enabled when using the Stimulus Presentation application module, and it is desired to stimulate on a particular stimulus, as defined in Stimulus Presentation's Stimuli parameter. To configure this functionality, enable this parameter and then navigate to the Application tab in BCI2000 and scroll down to the Stimuli matrix, as shown in Fig. 1. After opening the Stimuli matrix, add another row and name it EstimOn. Now, stimulation will be triggered on all stimuli defined in this matrix has its EstimOn row set to 1. Stimulation will not occur on stimuli that have this row set to 0.
DeviceMode
Device mode, with available options of Default, Basic, Handheld, Advanced, and FES. Changing the mode affects the default configuration settings and the maximum and minimum limitations of the device.
UseMultipleConfigurations
Enables the use of StimulationConfigurations table. This allows for multiple stimulation configurations during a run. Whenever stimulation is triggered through the EstimOn row or through StimulationExpression, it will trigger the most recently uploaded configuration.
Only some gEstim devices, with an updated firmware, can quickly change stimulation configurations with the use of SUPERMODE. If you enabled UseMultipleConfigurations and your device cannot enable SUPERMODE, BCI2000 will warn you. It will still work to switch stimulation parameters, but it will take longer than 200ms.

DynamicStimulation
Enable to use States as Parameters in the StimulationConfiguration table. This allows for having stimulation settings on the fly. However, this bypasses any stimulation preflight checks, as the stimulation values won't be known until the moment of stimulation. The states are evaluated at the sample in which the StimulationConfigurations Expression is true. Use with caution.
DoSelfTest
Enables user to disable the Self-test. g.Tec recommends performing the self-test before every use in case the device is faulty.
QuietStimulation
Enable to silent the stimulation.
EnableExternalTrigger
Enable to use the digital input 1 (DIN1) as the external trigger for stimulation. This parameter mimics the same behavior as the native Matlab app for gEstim, allowing for DIN1 to be used as both for Start/Abort or just for Start. Using the external trigger lowers the stimulation latency.
Stimulation Parameters
StimulationConfigurations
An adaptable way to set any valid stimulation configuration for gEstim. This table is recommended for use instead of the individual parameters. Using this table, you can specify biphasic, monophasic, or asymmetric pulses. You can upload before you start the stimulation, or start immediately after switching the configuration. Details are below.
-
Option 1: a default StimulationConfigurations table
-
Option 2: to use asymmetric pulses, have this configuration
Table that allows for multiple configurations. The parameters in the table are the same as below. The first row, Expression, can either correlate to uploading the stimulation or uploading and starting the stimulation. To start immediately after upload, leave StimulationExpression empty and turn UseStimulusPresentation off. Otherwise, StimulationExpression or the EstimOn row will start the stimulation that was uploaded. The AbortExpression will still abort any active stimulation.
StimulationExpression
Expression to start g.Estim stimulation. See the expression page for more details on how to define an expression.
AbortExpression
Expression to abort g.Estim stimulation.
Modularity

Modularity of pulses; Biphasic or Monophasic
Must be biphasic when specifying asymmetric pulses.
Polarity
Polarity of pulses; Alternating or Steady
Must be steady when specifying asymmetric pulses.
PhaseDuration
Duration of time of each +/- phase.
InterphaseDuration
Duration of time with no stimulation between each pulse's phases.
Magnitude
Magnitude of the pulse in milliamps. This quantity is peak-to-zero.
Both magnitudes must be greater than 0 when specifying asymmetric pulses. The 2nd pulse will automatically be negative.
NumberOfPulses
Number of pulses per train.
PulseFrequency
Frequency of each pulse in a train. Note that the PhaseDuration and InterphaseDuration impose a limit on the PulseFrequency. Make sure this parameter adheres to this limitation.
NumberOfTrains
Number of trains.
FrequencyOfTrains
Frequency of trains. Note that the total duration of each train (determined by length of each pulse and the number of pulses) imposes a restriction on this parameter. Make sure that FrequencyOfTrains adheres to this restriction.
Jitter
Jitter of trains between 0 and 100% in increments of 1%
Electrode Settings

ElectrodeType
Type of electrode being used: 1 Circle, 2 Depth, 3 Other.
CircleDiameter
For circle electrode type. Exposed diameter of the electrode in micrometers in increments of 1μm.
ContactDiameter
For depth electrode type. Contact diameter of the electrode in micrometers in increments of 1μm.
ContactLength
For depth electrode type. Contact length of the electrode in micrometers in increments of 1μm.
ExposedSurfaceArea
For other electrode type. Exposed surface area of electrode in square micrometers between in increments of 1μm2.
State Variables
EstimStimulus
This binary state is 1 when a stimulation train is running and 0 otherwise.s
EstimCurrent
Applied current in µA, reported from the stimulator. 16 bit state.
EstimVoltage
Applied voltage in mV, reported from the stimulator. 16 bit state.
EstimImpedance
Impedance of tissue in Ω in 16 bit state. Calculated using EstimCurrent and EstimVoltage values.
SCIT
To help out with creating the BCI2000 parameters, a GUI has been made which should make it easy to translate your stimulation specifications into BCI2000 parameter files. The GUI also visualizes the stimulation from three different perspectives, making it easy to tell if your parameters are really what you want. There is a Stimulation Configuration tool user reference which will further tell you how to use this tool.
-
Figure 3: The gEstim GUI which creates BCI2000 parameters from stimulation specifications.
This tool currently does not have the new StimulationConfigurations parameter, so it only allows for one configuration to be exported.
Latency

The above figure details the latency between positive evaluation of the StimulationExpression and pulse delivery.


