Jump to content

Contributions:CereStim: Difference between revisions

From BCI2000 Wiki
Swiftj (talk | contribs)
Added implementation of trains of pulses and multiple configuration IDs
Line 19: Line 19:


==Parameters==
==Parameters==
The CereStim is configured in the "CereStim" tab. The configurable parameters are:
The CereStim is configured in the "CereStim" tab.  
<gallery mode="packed" widths=350px heights=350px>
File:CerestimParameters.JPG|Figure 1: CereStim parameters, as described below.
</gallery>
The configurable parameters are:


===AppliedVoltage===
===AppliedVoltage===
Line 36: Line 40:
<!--[[File:cerestim_stimulation_definition.png|400px|thumb|right|upright=2.5|Stimulation pulse shape definition]]-->
<!--[[File:cerestim_stimulation_definition.png|400px|thumb|right|upright=2.5|Stimulation pulse shape definition]]-->
<gallery mode="packed" widths=400px heights=400px>
<gallery mode="packed" widths=400px heights=400px>
File:cerestim_stimulation_definition.png|Figure 1: Stimulation pulse shape definition.
File:cerestim_stimulation_definition.png|Figure 2: Stimulation pulse shape definition.
File:TrainImage.PNG|Figure 3: Stimulation train shape definition. The stimulation pulses in Figure 2 would take place during the "Stimulation duration" phase.
</gallery>
</gallery>
<gallery mode="packed" widths=350px heights=350px>
<gallery mode="packed" widths=350px heights=350px>
File:cerestim_stimulation_configurations.png|Figure 2: Stimulation pulse shape definition in BCI2000.
File:StimulationConfigurations.PNG|Figure 4: Stimulation pulse shape definition in BCI2000.
</gallery>
</gallery>
This parameter is where stimulation pulses are defined. You can define up to 15 different stimulation pulses. The pulse shapes are defined according to Fig. 1. For each configuration, if the  ''Cathode first'' row is <code>1</code>, then the positive magnitude pulse precedes the negative pulse. If this row is <code>0</code>, then the negative pulse precedes the positive pulse. The current sink for each pulse is the patient ground, which is the green safety connector on the back of the CereStim. However, suppose you wish to provide bipolar stimulation between two different electrodes within the brain. In that case, you can make two configurations that have the same pulse shape parameters but have reversed ''Cathode first'' parameters. These stimulation configurations can be triggered at the same time to approximate a bipolar stimulation pattern. Current can still potentially flow to the patient ground, but if the impedance between the two electrodes is significantly less than the impedance between the electrodes and patient ground, the majority of the current will flow between the two electrodes. Information on how to define these two electrodes can be found in the [https://www.bci2000.org/mediawiki/index.php/Contributions:CereStim#StimulationTriggers StimulationTriggers] parameter. Note that valid frequencies depend on the phase and interphase duration of the pulse.
This parameter is where stimulation pulses are defined. You can define up to 15 different stimulation pulses. The pulse shapes are defined according to Fig. 1.  
 
'''Additional Notes:'''
* For each configuration, if the  ''Cathode first'' row is <code>1</code>, then the positive magnitude pulse precedes the negative pulse. If this row is <code>0</code>, then the negative pulse precedes the positive pulse. The current sink for each pulse is the patient ground, which is the green safety connector on the back of the CereStim. However, suppose you wish to provide '''bipolar stimulation''' between two different electrodes within the brain. In that case, you can make two configurations that have the same pulse shape parameters but have reversed ''Cathode first'' parameters. These stimulation configurations can be triggered at the same time to approximate a bipolar stimulation pattern. Current can still potentially flow to the patient ground, but if the impedance between the two electrodes is significantly less than the impedance between the electrodes and patient ground, the majority of the current will flow between the two electrodes. Information on how to define these two electrodes can be found in the [https://www.bci2000.org/mediawiki/index.php/Contributions:CereStim#StimulationTriggers StimulationTriggers] parameter. Note that valid frequencies depend on the phase and interphase duration of the pulse.
* If a train still has more time in its desired duration, '''new expressions won't be triggered'''. This is a software constraint and can be changed with future implementation.
* If only one pulse is desired, ''Train Duration'' and ''Train Frequency'' don't have to be specified, or they can be '''set to 0'''.


===StimulationTriggers===
===StimulationTriggers===
<gallery mode="packed" widths=350px heights=350px>
<gallery mode="packed" widths=250px heights=250px>
File:cerestim_stimulation_triggers.png|Figure 3: Stimulation triggers have an expression, configuration ID, and list of electrodes.
File:StimulationTriggers.PNG|Figure 5: Stimulation triggers have an expression, a list of configuration IDs, and list of electrodes.
</gallery>
</gallery>
This parameter defines when electrodes are stimulated, with what configuration they are stimulated with, and what electrodes are stimulated. The ''Expression'' row defines when electrodes are stimulated by specifying a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true, the electrodes will be stimulated with the pulse shape defined in the ''Configuration ID'' row. Note that two columns can have the same ''Expression'', which allows for concurrent stimulation between different electrode locations. The ''Configuration ID'' defines the applied pulse shape and corresponds to the column number in the ''StimulationConfiguration'' parameter. Lastly, the ''Electrode(s)'' row specifies which electrodes will be stimulated. Elements in this row can be single values that specify a single electrode, or an embedded list in which you can specify multiple electrodes (from 1-96).  
This parameter defines when electrodes are stimulated, with what configuration they are stimulated with, and what electrodes are stimulated.  
* '''Expression:''' The ''Expression'' row defines when electrodes are stimulated by specifying a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true, the electrodes will be stimulated with the pulse shape defined in the ''Configuration ID'' row. Note that two columns can have the same ''Expression'', which allows for concurrent stimulation between different electrode locations.  
* '''Configuration ID(s):''' The ''Configuration ID(s)'' row defines the applied pulse shape and corresponds to the column number in the ''StimulationConfiguration'' parameter. When multiple IDs are specified, they will occur in sequential order, with the subsequent stimulation configuration starting right when the previous one ends. 
* '''Electrode(s):''' Lastly, the ''Electrode(s)'' row specifies which electrodes will be stimulated. Elements in this row can be single values that specify a single electrode, or an embedded list in which you can specify multiple electrodes (from 1-96).  


'''Note:''' You can only stimulate up to '''15''' electrodes concurrently. Concurrent stimulation groups, as defined by their equivalent ''Expression'' expression, must also have non-overlapping electrode lists.
'''Additional Notes:'''  
* You can only stimulate up to '''15''' electrodes concurrently.  
* Concurrent stimulation groups, as defined by their equivalent ''Expression'' expression, must also have '''non-overlapping electrode lists'''.


===DeviceInfo===
===DeviceInfo===
Line 59: Line 74:


==Latency==
==Latency==
[[File:cerestim_stimulation_latency.png|400px|thumb|right|upright=2.5|Figure 4: Latency of stimulation is about 17.3ms on average.]]
[[File:cerestim_stimulation_latency.png|400px|thumb|right|upright=2.5|Figure 6: Latency of stimulation is about 17.3ms on average.]]
Figure 4 shows the latency of stimulation over 220 trials. Stimulation pulses were acquired using a gUSBamp at 38.4kHz and a block size of 50ms.  
Figure 6 shows the latency of stimulation over 220 trials. Stimulation pulses were acquired using a gUSBamp at 38.4kHz and a block size of 50ms.  


==See also==
==See also==

Revision as of 21:56, 6 November 2021

Versioning

Blackrock CereStim 96.

Author

Alexander Belsten (belsten@neurotechcenter.org)

Version History

  • 2021/07/21 - R6337 - Initial private release for internal testing.

Source Code Revisions

  • Initial development: 6337
  • Known to compile under: 6340
  • Broken since: --

Functional Description

This output extension integrates the Blackrock CereStim 96 intracranial stimulator with BCI2000. This integration enables automated stimulation of up to 96 electrodes with 15 different stimulation waveforms.

Integration into BCI2000

To enable the use of the CereStim with BCI2000, first enable the extension in your CMake configuration in the Extensions folder of the CMake GUI (enable EXTENSIONS_CERESTIM=On). Then generate the BCI2000 Visual Studio solution in CMake (More details about this can be found on the Configuring BCI2000 for Compilation page). Next, open the solution with Visual Studio and rebuild the BCI2000FrameworkAppModule. Then rebuild any user application module with which you want to use the extension. Once the extension is built into the user application, you can enable it by appending --EnableCereStim=1 to the user application module start executable command in your batch file.

Parameters

The CereStim is configured in the "CereStim" tab.

The configurable parameters are:

AppliedVoltage

The CereStim drives current, so the applied voltage fluctuates according to the impedance between the current source (electrode) and drain. This dropdown parameter sets the maximum applied voltage. Note that there will be no notification that this maximum has been met.

AppliedCurrent

This parameter sets the maximum applied current in microamps. Unlike the maximum applied voltage, which fluctuates and therefore may or may not hit the maximum, maximum applied current parameter serves as a safety check for your uploaded stimulation configurations. Setting this parameter to a desired maximum applied current ensures that no stimulation above this current will be applied. If set to auto, the default will be the maximum current at which the CereStim can stimulate.

AppliedPhaseCharge

This parameter sets the maximum applied phase charge, where charge=amplitude*width. Amplitude is the current amplitude in microamps, and width is phase duration in microseconds. If set to auto, this parameter will default to the maximum value.

AppliedFrequency

This parameter sets the maximum frequency that stimulation pulses can have in Hz. If set to auto, this value defaults to the maximum.

StimulationConfigurations

This parameter is where stimulation pulses are defined. You can define up to 15 different stimulation pulses. The pulse shapes are defined according to Fig. 1.

Additional Notes:

  • For each configuration, if the Cathode first row is 1, then the positive magnitude pulse precedes the negative pulse. If this row is 0, then the negative pulse precedes the positive pulse. The current sink for each pulse is the patient ground, which is the green safety connector on the back of the CereStim. However, suppose you wish to provide bipolar stimulation between two different electrodes within the brain. In that case, you can make two configurations that have the same pulse shape parameters but have reversed Cathode first parameters. These stimulation configurations can be triggered at the same time to approximate a bipolar stimulation pattern. Current can still potentially flow to the patient ground, but if the impedance between the two electrodes is significantly less than the impedance between the electrodes and patient ground, the majority of the current will flow between the two electrodes. Information on how to define these two electrodes can be found in the StimulationTriggers parameter. Note that valid frequencies depend on the phase and interphase duration of the pulse.
  • If a train still has more time in its desired duration, new expressions won't be triggered. This is a software constraint and can be changed with future implementation.
  • If only one pulse is desired, Train Duration and Train Frequency don't have to be specified, or they can be set to 0.

StimulationTriggers

This parameter defines when electrodes are stimulated, with what configuration they are stimulated with, and what electrodes are stimulated.

  • Expression: The Expression row defines when electrodes are stimulated by specifying a BCI2000 expression. When this expression evaluates true, the electrodes will be stimulated with the pulse shape defined in the Configuration ID row. Note that two columns can have the same Expression, which allows for concurrent stimulation between different electrode locations.
  • Configuration ID(s): The Configuration ID(s) row defines the applied pulse shape and corresponds to the column number in the StimulationConfiguration parameter. When multiple IDs are specified, they will occur in sequential order, with the subsequent stimulation configuration starting right when the previous one ends.
  • Electrode(s): Lastly, the Electrode(s) row specifies which electrodes will be stimulated. Elements in this row can be single values that specify a single electrode, or an embedded list in which you can specify multiple electrodes (from 1-96).

Additional Notes:

  • You can only stimulate up to 15 electrodes concurrently.
  • Concurrent stimulation groups, as defined by their equivalent Expression expression, must also have non-overlapping electrode lists.

DeviceInfo

This parameter is auto-populated with information about the hardware and firmware versions of the CereStim stimulator that is connected. This information will be viewable during offline analysis by opening the resulting .dat file.

States

CereStimStimulation

This binary state is equal to 1 when stimulation is being applied.

Latency

Figure 6: Latency of stimulation is about 17.3ms on average.

Figure 6 shows the latency of stimulation over 220 trials. Stimulation pulses were acquired using a gUSBamp at 38.4kHz and a block size of 50ms.

See also