<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wengelhardt</id>
	<title>BCI2000 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.bci2000.org/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wengelhardt"/>
	<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php/Special:Contributions/Wengelhardt"/>
	<updated>2026-06-29T20:34:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12048</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12048"/>
		<updated>2025-07-30T18:48:11Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* StimulationMode */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for intra-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cortec API Version History===&lt;br /&gt;
Cortec is continually updating their devices with new API versions. In BCI2000, we currently support versions 1.0.200, 1.0.230, and 1.0.238. Each Brain Interchange Communication unit (BIC) is only compatible with one API version. To find your compatible version, connect the USB drive that comes with your BIC. Look under:&lt;br /&gt;
# &#039;&#039;&#039;Software folder&#039;&#039;&#039;: Each executable has the API version. E.g., &amp;lt;code&amp;gt;Bicapi_setup_1.0.200-bicapi-setup-1.0.200-rev35926.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Manuals foder&#039;&#039;&#039;: &#039;&#039;Appendix1_BIC_Application_Software_Short_Manual.pdf&#039;&#039;. On page 3, in Table 1, the third row contains the compatible version.&lt;br /&gt;
&lt;br /&gt;
Here are some differences between the versions. As the device is always improving, the newest version will have the most features.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Features !! 1.0.200 !! 1.0.230 !! 1.0.238 !! 1.0.260&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
!Matlab API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!C/C++ API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Stimulation modes&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!ASIC Noise Detection Mode&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Monopolar stimulation (Ch → GND)&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Measure GND impedances&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Self-tests&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Low noise recording&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
# If you receive an error, and it states your API version is incorrect, you need to change it. Locate the &#039;&#039;CMakeLists.txt&#039;&#039; under &amp;lt;code&amp;gt;BCI2000/src/private/SignalSource/Cortec&amp;lt;/code&amp;gt;. You must change Line 12, where it states &amp;lt;code&amp;gt;set(BICAPI_VERSION 200)&amp;lt;/code&amp;gt;. Change 200 to 230 or 238, depending on your device (see [[#Cortec Version History | details above]]).&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration (one column in StimulationPulses), which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows. Also, StimulationTriggers must not have more than 16 columns, as that is the highest number of configurations that can be stored on the device.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12047</id>
		<title>Contributions:CCEPFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12047"/>
		<updated>2025-07-30T18:40:33Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* BCI2000 Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Image:CCEP gif.gif|thumb|800px| An demo video of the CCEP Filter with VisualizeBCI2000. ]]&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Cortico-cortical evoked potentials (CCEPs) are generated as a response to stimulation within the cortical zone. To best view this response, the CCEP filter time locks the signal to the stimulation and allows the user to view the CCEPS from every recording electrode. There are many adaptable parameters to include flexibility for a variety of experiments.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
http://www.bci2000.org/svn/trunk/src/contrib/SignalProcessing/CCEPFilter&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
* Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 05/17/2023 - First working version&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 7199&lt;br /&gt;
*Tested under: 7303&lt;br /&gt;
*Known to compile under: 7364&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Python Visualizations#Installation|the Installation section on the Python Visualization page]] to see how to install the necessary packages and how to run demo files! Once that is all set up, you can return to this page to understand the specific parameters for the CCEPs.&lt;br /&gt;
&lt;br /&gt;
==Processing Details==&lt;br /&gt;
The CCEP filter has two parts - a C++ filter in the Signal Processing pipeline, and the Python filter outside of the BCI2000 chain. &lt;br /&gt;
# BCI2000 filter&lt;br /&gt;
#* The filter receives the raw data from the Source module, then time-locks the data based on the user-defined CCEP parameters.&lt;br /&gt;
#* When all the data is collected, the state CCEPTriggered will pulse to let the Python filter know data is ready to be visualized.&lt;br /&gt;
# Python filter&lt;br /&gt;
#* Data is received through the [[User Reference:SignalSharing|SignalSharing]] feature. Specifically, the parameter ShareCCEPFilter is set to a valid port to share the data.&lt;br /&gt;
#* When CCEPTriggered is true, the incoming data is further processed and plotted. The only processing this filter does is to calculate the area under the curve (AUC), then determine which channels have a significant response based on the threshold standard deviation set by the user. The raw values are given in the table, and the top most significant channels are visually shown.&lt;br /&gt;
#* If &#039;&#039;Sort Channels&#039;&#039; is enabled, all the significant channels will be at the top. They are then organized based on their original order, to maintain electrode grouping. If they were sorted purely on highest to lowest AUC, it would be very difficult to tell which general areas are responding.&lt;br /&gt;
&lt;br /&gt;
==Python Settings==&lt;br /&gt;
===Threshold (STD)===&lt;br /&gt;
This defines the threshold to determine a CCEP response. This value should be adjusted to maximize the number of significant channels shown, while not going over. If the value is too low, there will be more significant channels than visualized windows. This would only show you the electrodes which were originally at the top of the list, which might lead you to disregard the bottom electrodes.&lt;br /&gt;
===Max Windows===&lt;br /&gt;
The maximum amount of windows displayed. If you desire all the transmitted channels to be shown, set this max value to the number of channels or greater.&lt;br /&gt;
===x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;===&lt;br /&gt;
The minimum shown value of the x-axis for all windows, in milliseconds. You can set this to a negative value to show baseline data before the CCEP.&lt;br /&gt;
===Hold Plots===&lt;br /&gt;
The number of plots to keep on a window. Set to 0 to hold all plots, until manually cleared with &amp;quot;Clear Figures&amp;quot;.&lt;br /&gt;
===Average CCEPs===&lt;br /&gt;
Enable to display the average of the plots in addition to the single trials. &lt;br /&gt;
===Sort Channels===&lt;br /&gt;
Disable to keep the order of the channels unchanged. If there are more transmitted channels than windows shown, the shown windows will simply be the first in the list.&lt;br /&gt;
===Save figures on refresh===&lt;br /&gt;
&#039;&#039;Currently broken&#039;&#039;. Enable to make sure the visualizations are never lost, as every time the plots are cleared they would first be saved. This can get cumbersome with many saved files.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 Parameters==&lt;br /&gt;
===OnsetExpression===&lt;br /&gt;
Expression that defines the stimulus onset. Ideally, this should be a hardware trigger to have the most precise time-locking. This expression should be true when the stimulation is triggered. See the [[User Reference:Expression Syntax | Expression syntax page]] for more information. &lt;br /&gt;
&lt;br /&gt;
===Duration settings===&lt;br /&gt;
These parameters all should have units of time (e.g. milliseconds), or auto.&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;BaselineEpochLength&#039;&#039;====&lt;br /&gt;
The duration of desired baseline data. This baseline data is helpful for visualizing the data before the stimulation, and is also used to calculate the average signal value from which the threshold is calculated.&lt;br /&gt;
====&#039;&#039;CCEPEpochLength&#039;&#039;====&lt;br /&gt;
Duration of time after the baseline and latency. Essentially the amount of time that is needed to view the CCEP.&lt;br /&gt;
&lt;br /&gt;
===Trigger settings===&lt;br /&gt;
These settings are best used for stimulation trains, however they can be used to specify a software trigger for the stimulation onset as well. If this used for a train, PreStimLength and PostStimLength should specify the length of the train. If it is used for software trigger, they should be the same as the Baseline and CCEP EpochLength.&lt;br /&gt;
====&#039;&#039;SoftwareTrigger&#039;&#039;====&lt;br /&gt;
If enabled, the filter will use the PreStim and PostStim Length parameters to define the shape of the output. This is helpful if the provided trigger is an estimate of the stimulation onset, because then the filter and save all the needed data to the output, where the python visualization can auto-detect the precise stimulation onset.&lt;br /&gt;
====&#039;&#039;PreStimLength&#039;&#039;====&lt;br /&gt;
If SoftwareTrigger is enabled, this will be the length of the saved baseline data.&lt;br /&gt;
====&#039;&#039;PostStimLength&#039;&#039;====&lt;br /&gt;
If SoftwareTrigger is enabled, this will be the length of the post-baseline data. This should be the length of the train if you are visualizing a high frequency stimulation train.&lt;br /&gt;
&lt;br /&gt;
===Counting settings===&lt;br /&gt;
These parameters must be integers as they specify a quantity to count. &lt;br /&gt;
====&#039;&#039;TriggerPeriodEnd&#039;&#039;====&lt;br /&gt;
Enable this flag to pulse CCEPTriggered at the end of the period instead of the beginning. This can be used in combination with &#039;&#039;OnsetPeriod&#039;&#039;.&lt;br /&gt;
====&#039;&#039;EpochsToAverage&#039;&#039;====&lt;br /&gt;
Average this number of CCEPs before sending it to Python to visualize. This is helpful if the OnsetExpression is frequently true within a short period of time, to lower the load on Python updating. &lt;br /&gt;
====&#039;&#039;OnsetPeriod&#039;&#039;====&lt;br /&gt;
The period in which you expect the CCEPs to occur. This can be specified in time units or without units.&lt;br /&gt;
&lt;br /&gt;
# Time units: The minimum time between detection of CCEPs. For example, if this is 2s, OnsetExpression will not be true for 2s after a sample that is is triggered. After 2 seconds, it will start being evaluated again.&lt;br /&gt;
# Without units: Skip one less than this number of CCEPs. For example, for high-frequency stimulation, the OnsetExpression might be true 50 times in 1 second. Therefore, you would want to set this number to 50. If you are also averaging the plots, it will only average the signals specified by this period.&lt;br /&gt;
&lt;br /&gt;
This is helpful if you want to visualize a time range in which the OnsetExpression is met multiple times.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:SignalProcessing]], [[Python Visualizations]], [[Contributions:PAC]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12046</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12046"/>
		<updated>2025-07-16T21:23:03Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for intra-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cortec API Version History===&lt;br /&gt;
Cortec is continually updating their devices with new API versions. In BCI2000, we currently support versions 1.0.200, 1.0.230, and 1.0.238. Each Brain Interchange Communication unit (BIC) is only compatible with one API version. To find your compatible version, connect the USB drive that comes with your BIC. Look under:&lt;br /&gt;
# &#039;&#039;&#039;Software folder&#039;&#039;&#039;: Each executable has the API version. E.g., &amp;lt;code&amp;gt;Bicapi_setup_1.0.200-bicapi-setup-1.0.200-rev35926.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Manuals foder&#039;&#039;&#039;: &#039;&#039;Appendix1_BIC_Application_Software_Short_Manual.pdf&#039;&#039;. On page 3, in Table 1, the third row contains the compatible version.&lt;br /&gt;
&lt;br /&gt;
Here are some differences between the versions. As the device is always improving, the newest version will have the most features.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Features !! 1.0.200 !! 1.0.230 !! 1.0.238 !! 1.0.260&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
!Matlab API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!C/C++ API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Stimulation modes&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!ASIC Noise Detection Mode&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Monopolar stimulation (Ch → GND)&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Measure GND impedances&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Self-tests&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Low noise recording&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
# If you receive an error, and it states your API version is incorrect, you need to change it. Locate the &#039;&#039;CMakeLists.txt&#039;&#039; under &amp;lt;code&amp;gt;BCI2000/src/private/SignalSource/Cortec&amp;lt;/code&amp;gt;. You must change Line 12, where it states &amp;lt;code&amp;gt;set(BICAPI_VERSION 200)&amp;lt;/code&amp;gt;. Change 200 to 230 or 238, depending on your device (see [[#Cortec Version History | details above]]).&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12045</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12045"/>
		<updated>2025-07-16T21:21:33Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for intra-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cortec API Version History===&lt;br /&gt;
Cortec is continually updating their devices with new API versions. In BCI2000, we currently support versions 1.0.200, 1.0.230, and 1.0.238. Each Brain Interchange Communication unit (BIC) is only compatible with one API version. To find your compatible version, connect the USB drive that comes with your BIC. Look under:&lt;br /&gt;
# &#039;&#039;&#039;Software folder&#039;&#039;&#039;: Each executable has the API version. E.g., &amp;lt;code&amp;gt;Bicapi_setup_1.0.200-bicapi-setup-1.0.200-rev35926.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Manuals foder&#039;&#039;&#039;: &#039;&#039;Appendix1_BIC_Application_Software_Short_Manual.pdf&#039;&#039;. On page 3, in Table 1, the third row contains the compatible version.&lt;br /&gt;
&lt;br /&gt;
Here are some differences between the versions. As the device is always improving, the newest version will have the most features.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Features !! 1.0.200 !! 1.0.230 !! 1.0.238 !! 1.0.260&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
!Matlab API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!C/C++ API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Stimulation modes&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!ASIC Noise Detection Mode&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!GND stimulation without destination channel&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Measure GND impedances&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Self-tests&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Low noise recording&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
# If you receive an error, and it states your API version is incorrect, you need to change it. Locate the &#039;&#039;CMakeLists.txt&#039;&#039; under &amp;lt;code&amp;gt;BCI2000/src/private/SignalSource/Cortec&amp;lt;/code&amp;gt;. You must change Line 12, where it states &amp;lt;code&amp;gt;set(BICAPI_VERSION 200)&amp;lt;/code&amp;gt;. Change 200 to 230 or 238, depending on your device (see [[#Cortec Version History | details above]]).&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CereStim&amp;diff=12044</id>
		<title>Contributions:CereStim</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CereStim&amp;diff=12044"/>
		<updated>2025-07-15T21:56:44Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Cerestim.jpg|400px|thumb|right|Blackrock CereStim 96.]]&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Author===&lt;br /&gt;
Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 2021/07/21 - R6337 - Initial private release for internal testing.&lt;br /&gt;
* 2022/01/29 - R6515 - Implementation of stimulation train. &lt;br /&gt;
* 2022/05/25 - R6763 - New acquisition mode to measure impedance of electrodes. &lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6337&lt;br /&gt;
*Known to compile under: 6763&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Functional Description== &lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
==Integration into BCI2000==&lt;br /&gt;
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 &amp;lt;code&amp;gt;EXTENSIONS_CERESTIM=On&amp;lt;/code&amp;gt;). Then generate the BCI2000 Visual Studio solution in CMake (More details about this can be found on the [https://www.bci2000.org/mediawiki/index.php/Programming_Howto:Configure_BCI2000_for_Compilation Configuring BCI2000 for Compilation] page). Next, open the solution with Visual Studio and rebuild the &#039;&#039;BCI2000FrameworkAppModule.&#039;&#039; 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 &amp;lt;code&amp;gt;--EnableCereStim=1&amp;lt;/code&amp;gt; to the user application module start executable command in your batch file.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
The CereStim is configured in the &amp;quot;CereStim&amp;quot; tab. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=350px heights=550px&amp;gt;&lt;br /&gt;
File:CerestimParameters.JPG|Figure 1: CereStim parameters, as described below.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
The configurable parameters are:&lt;br /&gt;
&lt;br /&gt;
===ImpedanceMeasurement===&lt;br /&gt;
Enable to measure the impedance of the used electrodes in [[#StimulationTriggers|StimulationTriggers parameter]]. It starts measuring when you press &amp;quot;Set Config&amp;quot; in a separate window. &lt;br /&gt;
===DynamicConfiguration===&lt;br /&gt;
Enable to dynamically load stimulation configurations during the experiment. This allows you to have more than 15 configurations. This makes the Expression in [[#StimulationTriggers|StimulationTriggers parameter]] upload the desired configuration, and then [[#StartExpression|StartExpression]] trigger the uploaded configuration. If there is no expression in [[#StartExpression|StartExpression]], the stimulation will start immediately after being uploaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:Trigger Expression flowchart.jpg|Flowchart which shows the stimulation behavior under the specified modes&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===AppliedVoltage===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===AppliedCurrent===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===AppliedPhaseCharge===&lt;br /&gt;
This parameter sets the maximum applied phase charge, where &amp;lt;code&amp;gt;charge=amplitude*width&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
===AppliedFrequency===&lt;br /&gt;
This parameter sets the maximum frequency that stimulation pulses can have in Hz. If set to auto, this value defaults to the maximum.&lt;br /&gt;
&lt;br /&gt;
===StimulationConfigurations===&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:StimulationConfigurations.PNG|Figure 2: Stimulation pulse shape definition in BCI2000.&lt;br /&gt;
File:CerestimStimulation.png|Figure 3: Stimulation pulse shape and train shape definition. The stimulation pulses on the left would take place during the &amp;quot;Stimulation duration&amp;quot; phase on the right.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
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. 2. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Additional Notes:&#039;&#039;&#039;&lt;br /&gt;
* For each configuration, if the  &#039;&#039;Cathode first&#039;&#039; row is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, then the negative magnitude pulse precedes the positive pulse. If this row is &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, then the positive pulse precedes the negative 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 &#039;&#039;&#039;bipolar stimulation&#039;&#039;&#039; 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 &#039;&#039;Cathode first&#039;&#039; 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|StimulationTriggers]] parameter. Note that valid frequencies depend on the phase and interphase duration of the pulse.&lt;br /&gt;
* If a train still has more time in its desired duration, &#039;&#039;&#039;new expressions won&#039;t be triggered&#039;&#039;&#039;. This is a software constraint and can be changed with future implementation.&lt;br /&gt;
* If only one pulse is desired, &#039;&#039;Train Duration&#039;&#039; and &#039;&#039;Train Frequency&#039;&#039; don&#039;t have to be specified, or they can be &#039;&#039;&#039;set to 0&#039;&#039;&#039;.&lt;br /&gt;
* Hardware limitations:&lt;br /&gt;
** &#039;&#039;Maximum number of configurations&#039;&#039;: 15 (can be bypassed by using [[#DynamicConfiguration|DynamicConfiguration]] mode)&lt;br /&gt;
** &#039;&#039;Number of pulses&#039;&#039;: 1-255&lt;br /&gt;
** &#039;&#039;Amplitude&#039;&#039;: 1-215 uA (Micro), 100 uA-10 mA (Macro)&lt;br /&gt;
** &#039;&#039;Width&#039;&#039;: 1 - 65,535 us&lt;br /&gt;
** &#039;&#039;Frequency&#039;&#039;: 4 - 5000 Hz&lt;br /&gt;
** &#039;&#039;Interphase duration&#039;&#039;: 53 - 65,535 us&lt;br /&gt;
** &#039;&#039;Balanced Phase&#039;&#039;: Phase 1 * Width 1 &#039;&#039;&#039;must equal&#039;&#039;&#039; Phase 2 * Width 2&lt;br /&gt;
** &#039;&#039;Train Repetitions&#039;&#039;: 0 - 65,535 OR infinite (by setting Train Duration to 0 with a Train Frequency)&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=250px heights=450px&amp;gt;&lt;br /&gt;
File:CereStimStimulationTriggers.PNG|Figure 5: Stimulation triggers have an expression, a configuration ID, and list of electrodes.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
This parameter defines when electrodes are stimulated, with what configuration they are stimulated with, and what electrodes are stimulated. &lt;br /&gt;
* &#039;&#039;&#039;Expression:&#039;&#039;&#039; The &#039;&#039;Expression&#039;&#039; row is where a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression] should be defined. If not in DynamicConfiguration mode, when this expression is true, the associated configuration in the &#039;&#039;Configuration ID&#039;&#039; row will be delivered. Note that two columns can have the same &#039;&#039;Expression&#039;&#039;, which allows for concurrent stimulation between different electrode locations. If we are in DynamicConfiguration mode, then the expression uploads the associated configuration to the CereStim. If StartExpression is not defined, then stimulation will start immediately after. &lt;br /&gt;
* &#039;&#039;&#039;Configuration ID:&#039;&#039;&#039; The &#039;&#039;Configuration ID&#039;&#039; row defines the applied pulse shape and corresponds to the column number in the &#039;&#039;StimulationConfiguration&#039;&#039; parameter. When multiple IDs are specified, they will occur in sequential order, with the subsequent stimulation configuration starting right when the previous one ends. However, using multiple IDs has not been tested thoroughly, and is not recommended. &lt;br /&gt;
* &#039;&#039;&#039;Electrode(s):&#039;&#039;&#039; Lastly, the &#039;&#039;Electrode(s)&#039;&#039; 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). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Additional Notes:&#039;&#039;&#039; &lt;br /&gt;
* You can only stimulate up to &#039;&#039;&#039;15&#039;&#039;&#039; electrodes concurrently. &lt;br /&gt;
* Concurrent stimulation groups, as defined by their equivalent &#039;&#039;Expression&#039;&#039; expression, must have &#039;&#039;&#039;non-overlapping electrode lists&#039;&#039;&#039; and &#039;&#039;&#039;matching train frequency and train duration&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===StartExpression===&lt;br /&gt;
Only for use in [[#DynamicConfiguration|DynamicConfiguration]] mode. Expression to start stimulation using the uploaded configurations. Can be left empty to start stimulation immediately after uploading. &lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
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 &amp;lt;code&amp;gt;.dat&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
===CereStimStimulation===&lt;br /&gt;
This binary state is equal to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when stimulation is being applied. This is set by the CereStim hardware, and might not be accurate for quick stimulation pulses.&lt;br /&gt;
===CereStimStimulationSoftware===&lt;br /&gt;
Equal to 1 when stimulation is being applied, from BCI2000&#039;s point of view. This can better capture quick stimulation pulses.&lt;br /&gt;
===CereStimUploadStatus===&lt;br /&gt;
The configuration number that is currently uploaded, e.g., 1 is the first column in the StimulationConfigurations table. If multiple configurations are uploaded, the two ids are added together.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimmulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CerestimGUIimg.png|Figure 6: The CereStim GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Compliance Voltage==&lt;br /&gt;
The CereStim drives current, however it can only do so across a certain voltage difference. The maximum specified voltage for the CereStim is 9.5 V. Below shows a test conducted, where the delivered voltage was measured for known impedances. The first figure plots the measured current on one axis, contrasted with the specified current on the other axis over varying resistances. This can be helpful for determining if your desired current will be fully delivered. However, these are just examples, as the real constraint is the voltage. The next graph shows the desired voltages (which can be calculated from your specified current and the measured impedance), and the difference from what is actually delivered. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:CurrentMeasuredVSSpecified.png|Figure 7. Measured vs specified currents for example impedances. Where the line flat-lines is where the compliance voltage is met.  &lt;br /&gt;
File:CereStimComplianceVoltage.png|Figure 8. The difference in measured and desired voltage. It can be seen that the measured voltage starts dropping off around 6 V. The compliance voltage is officially listed at 9.5 V, however based on this testing, you are not getting 100% of the current at voltages after 6 V. &lt;br /&gt;
&amp;lt;/gallery&amp;gt; &lt;br /&gt;
&lt;br /&gt;
The purpose of these graphs is to show you to &#039;&#039;be aware&#039;&#039; of the voltage you are producing with your desired current and impedance. If it is close to the compliance voltage, then the full current won&#039;t be delivered. For example, if you were stimulating at 3 mA with an impedance of 2.8 kΩ, this would be a desired voltage of 8.4 V (Ohm&#039;s Law). According to our tests, the measured voltage is 7 V, which is a difference of 1.4 V. When converting this back to current, this is a difference of 0.5 mA (17% difference). Depending on the experiment, this could be a difference that needs to be noted. &lt;br /&gt;
&lt;br /&gt;
==Monopolar, True Bipolar, Pseudo Bipolar==&lt;br /&gt;
The CereStim sends current out to the specified electrode, then the current is returned to the grounding electrode. Because of this, both software and hardware changes are needed to specify which type of stimulation: monopolar, true bipolar or pseudo bipolar. For each stimulation type, there is an example stimulation configuration, hardware configuration, and explanation of the setup below. &lt;br /&gt;
===Monopolar===&lt;br /&gt;
Monopolar stimulation is when current goes from one contact to the ground. In this example, when StimulusCode is 1502, both Channels 1 and 2 will have monopolar stimulation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:CereStimMonopolar.jpg|Channels 1 and 2 are connected to the desired brain regions, and the ground is connected to a grounding pad on the patient. &lt;br /&gt;
File:Configuration1.png|Example Stimulation Configuration&lt;br /&gt;
File:CereStimMonopolarElectrodeList.png|Both channels are using the same stimulation configuration. &lt;br /&gt;
&amp;lt;/gallery&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Pseudo Bipolar===&lt;br /&gt;
Pseudo bipolar has the same hardware configuration as monopolar stimulation. The difference is when both are triggered, one has a positive voltage first while the other has a negative, thereby inducing bipolar stimulation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:CereStimMonopolar.jpg|Same setup as monopolar stimulation. &lt;br /&gt;
File:CereStimPseudoBipolarConfig.PNG|The only difference between the two configurations is the first column: &amp;quot;Cathode first&amp;quot;. Having zero as a value makes the anode as first. &lt;br /&gt;
File:CereStimPseudoBipolarTrigger.PNG|The two channels are triggered at the same time, yet use separate configurations. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===True Bipolar===&lt;br /&gt;
True bipolar requires a hardware change. The return contact must be connected to the ground, which makes the current return through the specified contact. If different return channels are desired, it must be physically changed every time. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=400px heights=400px&amp;gt;&lt;br /&gt;
File:CereStimBipolar.png|Channels 1 and 2 are connected to desired brain regions, current is returned through the Channel 2 contact. &lt;br /&gt;
File:Configuration1.png|Example Stimulation Configuration&lt;br /&gt;
File:CereStimTrueBipolarTrigger.PNG|Only Electrode 1 is being stimulated, because current is returning through the contact that Channel 2 used to be connected to. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Latency==&lt;br /&gt;
[[File:cerestim_stimulation_latency.png|400px|thumb|right|upright=2.5|Figure 6: Latency of stimulation is about 17.3ms on average.]]&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Contributions:Extensions]]&lt;br /&gt;
*[[Contributions:g.EstimSwitchingUnit]]&lt;br /&gt;
*[[Contributions:gEstimFilter]]&lt;br /&gt;
*[[CortecADC]]&lt;br /&gt;
*[[User Reference:NeuroStimulationParamsGUI]]&lt;br /&gt;
[[Category:Contributions]][[Category:Extension]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12043</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12043"/>
		<updated>2025-07-14T15:13:30Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Added Cortec versioning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for intra-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===BCI2000 Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cortec Version History===&lt;br /&gt;
Cortec is continually updating their devices with new API versions. In BCI2000, we currently support versions 1.0.200, 1.0.230, and 1.0.238. Each Brain Interchange Communication unit (BIC) is only compatible with one API version. To find your compatible version, connect the USB drive that comes with your BIC. Look under:&lt;br /&gt;
# &#039;&#039;&#039;Software folder&#039;&#039;&#039;: Each executable has the API version. E.g., &amp;lt;code&amp;gt;Bicapi_setup_1.0.200-bicapi-setup-1.0.200-rev35926.exe&amp;lt;/code&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;Manuals foder&#039;&#039;&#039;: &#039;&#039;Appendix1_BIC_Application_Software_Short_Manual.pdf&#039;&#039;. On page 3, in Table 1, the third row contains the compatible version.&lt;br /&gt;
&lt;br /&gt;
Here are some differences between the versions. As the device is always improving, the newest version will have the most features.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Features !! 1.0.200 !! 1.0.230 !! 1.0.238 !! 1.0.260&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
!Matlab API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!C/C++ API&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Stimulation modes&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!ASIC Noise Detection Mode&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!GND stimulation without destination channel&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Measure GND impedances&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Self-tests&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
!Low noise recording&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:red&amp;quot;|✘&lt;br /&gt;
|style=&amp;quot;color:green&amp;quot;|✔&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
# If you receive an error, and it states your API version is incorrect, you need to change it. Locate the &#039;&#039;CMakeLists.txt&#039;&#039; under &amp;lt;code&amp;gt;BCI2000/src/private/SignalSource/Cortec&amp;lt;/code&amp;gt;. You must change Line 12, where it states &amp;lt;code&amp;gt;set(BICAPI_VERSION 200)&amp;lt;/code&amp;gt;. Change 200 to 230 or 238, depending on your device (see [[#Cortec Version History | details above]]).&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12042</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12042"/>
		<updated>2025-07-10T20:49:30Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for intra-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
# If you receive an error, and it states your API version is incorrect, you need to change it. Locate the &#039;&#039;CMakeLists.txt&#039;&#039; under &amp;lt;code&amp;gt;BCI2000/src/private/SignalSource/Cortec&amp;lt;/code&amp;gt;. You must change Line 12, where it states &amp;lt;code&amp;gt;set(BICAPI_VERSION 200)&amp;lt;/code&amp;gt;. Change 200 to 230 or 238, depending on your device.&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12040</id>
		<title>Contributions:CCEPFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12040"/>
		<updated>2025-07-07T17:27:54Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Image:CCEP gif.gif|thumb|800px| An demo video of the CCEP Filter with VisualizeBCI2000. ]]&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Cortico-cortical evoked potentials (CCEPs) are generated as a response to stimulation within the cortical zone. To best view this response, the CCEP filter time locks the signal to the stimulation and allows the user to view the CCEPS from every recording electrode. There are many adaptable parameters to include flexibility for a variety of experiments.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
http://www.bci2000.org/svn/trunk/src/contrib/SignalProcessing/CCEPFilter&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
* Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 05/17/2023 - First working version&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 7199&lt;br /&gt;
*Tested under: 7303&lt;br /&gt;
*Known to compile under: 7364&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Python Visualizations#Installation|the Installation section on the Python Visualization page]] to see how to install the necessary packages and how to run demo files! Once that is all set up, you can return to this page to understand the specific parameters for the CCEPs.&lt;br /&gt;
&lt;br /&gt;
==Processing Details==&lt;br /&gt;
The CCEP filter has two parts - a C++ filter in the Signal Processing pipeline, and the Python filter outside of the BCI2000 chain. &lt;br /&gt;
# BCI2000 filter&lt;br /&gt;
#* The filter receives the raw data from the Source module, then time-locks the data based on the user-defined CCEP parameters.&lt;br /&gt;
#* When all the data is collected, the state CCEPTriggered will pulse to let the Python filter know data is ready to be visualized.&lt;br /&gt;
# Python filter&lt;br /&gt;
#* Data is received through the [[User Reference:SignalSharing|SignalSharing]] feature. Specifically, the parameter ShareCCEPFilter is set to a valid port to share the data.&lt;br /&gt;
#* When CCEPTriggered is true, the incoming data is further processed and plotted. The only processing this filter does is to calculate the area under the curve (AUC), then determine which channels have a significant response based on the threshold standard deviation set by the user. The raw values are given in the table, and the top most significant channels are visually shown.&lt;br /&gt;
#* If &#039;&#039;Sort Channels&#039;&#039; is enabled, all the significant channels will be at the top. They are then organized based on their original order, to maintain electrode grouping. If they were sorted purely on highest to lowest AUC, it would be very difficult to tell which general areas are responding.&lt;br /&gt;
&lt;br /&gt;
==Python Settings==&lt;br /&gt;
===Threshold (STD)===&lt;br /&gt;
This defines the threshold to determine a CCEP response. This value should be adjusted to maximize the number of significant channels shown, while not going over. If the value is too low, there will be more significant channels than visualized windows. This would only show you the electrodes which were originally at the top of the list, which might lead you to disregard the bottom electrodes.&lt;br /&gt;
===Max Windows===&lt;br /&gt;
The maximum amount of windows displayed. If you desire all the transmitted channels to be shown, set this max value to the number of channels or greater.&lt;br /&gt;
===x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;===&lt;br /&gt;
The minimum shown value of the x-axis for all windows, in milliseconds. You can set this to a negative value to show baseline data before the CCEP.&lt;br /&gt;
===Hold Plots===&lt;br /&gt;
The number of plots to keep on a window. Set to 0 to hold all plots, until manually cleared with &amp;quot;Clear Figures&amp;quot;.&lt;br /&gt;
===Average CCEPs===&lt;br /&gt;
Enable to display the average of the plots in addition to the single trials. &lt;br /&gt;
===Sort Channels===&lt;br /&gt;
Disable to keep the order of the channels unchanged. If there are more transmitted channels than windows shown, the shown windows will simply be the first in the list.&lt;br /&gt;
===Save figures on refresh===&lt;br /&gt;
&#039;&#039;Currently broken&#039;&#039;. Enable to make sure the visualizations are never lost, as every time the plots are cleared they would first be saved. This can get cumbersome with many saved files.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 Parameters==&lt;br /&gt;
===OnsetExpression===&lt;br /&gt;
Expression that defines the stimulus onset. Ideally, this should be a hardware trigger to have the most precise time-locking. This expression should be true when the stimulation is triggered. See the [[User Reference:Expression Syntax | Expression syntax page]] for more information. &lt;br /&gt;
&lt;br /&gt;
===Duration settings===&lt;br /&gt;
These parameters all should have units of time (e.g. milliseconds), or auto.&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;BaselineEpochLength&#039;&#039;====&lt;br /&gt;
The duration of desired baseline data. This baseline data is helpful for visualizing the data before the stimulation, and is also used to calculate the average signal value from which the threshold is calculated.&lt;br /&gt;
====&#039;&#039;CCEPEpochLength&#039;&#039;====&lt;br /&gt;
Duration of time after the baseline and latency. Essentially the amount of time that is needed to view the CCEP.&lt;br /&gt;
&lt;br /&gt;
===Counting settings===&lt;br /&gt;
These parameters must be integers as they specify a quantity to count. &lt;br /&gt;
====&#039;&#039;TriggerPeriodEnd&#039;&#039;====&lt;br /&gt;
Enable this flag to pulse CCEPTriggered at the end of the period instead of the beginning. This can be used in combination with &#039;&#039;OnsetPeriod&#039;&#039;.&lt;br /&gt;
====&#039;&#039;EpochsToAverage&#039;&#039;====&lt;br /&gt;
Average this number of CCEPs before sending it to Python to visualize. This is helpful if the OnsetExpression is frequently true within a short period of time, to lower the load on Python updating. &lt;br /&gt;
====&#039;&#039;OnsetPeriod&#039;&#039;====&lt;br /&gt;
The period in which you expect the CCEPs to occur. This can be specified in time units or without units.&lt;br /&gt;
&lt;br /&gt;
# Time units: The minimum time between detection of CCEPs. For example, if this is 2s, OnsetExpression will not be true for 2s after a sample that is is triggered. After 2 seconds, it will start being evaluated again.&lt;br /&gt;
# Without units: Skip one less than this number of CCEPs. For example, for high-frequency stimulation, the OnsetExpression might be true 50 times in 1 second. Therefore, you would want to set this number to 50. If you are also averaging the plots, it will only average the signals specified by this period.&lt;br /&gt;
&lt;br /&gt;
This is helpful if you want to visualize a time range in which the OnsetExpression is met multiple times. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:SignalProcessing]], [[Python Visualizations]], [[Contributions:PAC]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12038</id>
		<title>Contributions:CCEPFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=12038"/>
		<updated>2025-07-07T14:48:27Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Image:CCEP gif.gif|thumb|800px| An demo video of the CCEP Filter with VisualizeBCI2000. ]]&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Cortico-cortical evoked potentials (CCEPs) are generated as a response to stimulation within the cortical zone. To best view this response, the CCEP filter time locks the signal to the stimulation and allows the user to view the CCEPS from every recording electrode. There are many adaptable parameters to include flexibility for a variety of experiments.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
http://www.bci2000.org/svn/trunk/src/contrib/SignalProcessing/CCEPFilter&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
* Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 05/17/2023 - First working version&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 7199&lt;br /&gt;
*Tested under: 7303&lt;br /&gt;
*Known to compile under: 7364&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Python Visualizations#Installation|the Installation section on the Python Visualization page]] to see how to install the necessary packages and how to run demo files! Once that is all set up, you can return to this page to understand the specific parameters for the CCEPs.&lt;br /&gt;
&lt;br /&gt;
==Processing Details==&lt;br /&gt;
The CCEP filter has two parts - a C++ filter in the Signal Processing pipeline, and the Python filter outside of the BCI2000 chain. &lt;br /&gt;
# BCI2000 filter&lt;br /&gt;
#* The filter receives the raw data from the Source module, then time-locks the data based on the user-defined CCEP parameters.&lt;br /&gt;
#* When all the data is collected, the state CCEPTriggered will pulse to let the Python filter know data is ready to be visualized.&lt;br /&gt;
# Python filter&lt;br /&gt;
#* Data is received through the [[User Reference:SignalSharing|SignalSharing]] feature. Specifically, the parameter ShareCCEPFilter is set to a valid port to share the data.&lt;br /&gt;
#* When CCEPTriggered is true, the incoming data is further processed and plotted. The only processing this filter does is to calculate the area under the curve (AUC), then determine which channels have a significant response based on the threshold standard deviation set by the user. The raw values are given in the table, and the top most significant channels are visually shown.&lt;br /&gt;
#* If &#039;&#039;Sort Channels&#039;&#039; is enabled, all the significant channels will be at the top. They are then organized based on their original order, to maintain electrode grouping. If they were sorted purely on highest to lowest AUC, it would be very difficult to tell which general areas are responding.&lt;br /&gt;
&lt;br /&gt;
==Python Settings==&lt;br /&gt;
===Threshold (STD)===&lt;br /&gt;
This defines the threshold to determine a CCEP response. This value should be adjusted to maximize the number of significant channels shown, while not going over. If the value is too low, there will be more significant channels than visualized windows. This would only show you the electrodes which were originally at the top of the list, which might lead you to disregard the bottom electrodes.&lt;br /&gt;
===Max Windows===&lt;br /&gt;
The maximum amount of windows displayed. If you desire all the transmitted channels to be shown, set this max value to the number of channels or greater.&lt;br /&gt;
===x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;===&lt;br /&gt;
The minimum shown value of the x-axis for all windows, in milliseconds. You can set this to a negative value to show baseline data before the CCEP.&lt;br /&gt;
===Hold Plots===&lt;br /&gt;
The number of plots to keep on a window. Set to 0 to hold all plots, until manually cleared with &amp;quot;Clear Figures&amp;quot;.&lt;br /&gt;
===Average CCEPs===&lt;br /&gt;
Enable to display the average of the plots in addition to the single trials. &lt;br /&gt;
===Sort Channels===&lt;br /&gt;
Disable to keep the order of the channels unchanged. If there are more transmitted channels than windows shown, the shown windows will simply be the first in the list.&lt;br /&gt;
===Save figures on refresh===&lt;br /&gt;
&#039;&#039;Currently broken&#039;&#039;. Enable to make sure the visualizations are never lost, as every time the plots are cleared they would first be saved. This can get cumbersome with many saved files.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 Parameters==&lt;br /&gt;
===OnsetExpression===&lt;br /&gt;
Expression that defines the stimulus onset. Ideally, this should be a hardware trigger to have the most precise time-locking. This expression should be true when the stimulation is triggered. See the [[User Reference:Expression Syntax | Expression syntax page]] for more information. &lt;br /&gt;
&lt;br /&gt;
===Duration settings===&lt;br /&gt;
These parameters all should have units of time (e.g. milliseconds), or auto.&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;BaselineEpochLength&#039;&#039;====&lt;br /&gt;
The duration of desired baseline data. This baseline data is helpful for visualizing the data before the stimulation, and is also used to calculate the average signal value from which the threshold is calculated.&lt;br /&gt;
====&#039;&#039;CCEPEpochLength&#039;&#039;====&lt;br /&gt;
Duration of time after the baseline and latency. Essentially the amount of time that is needed to view the CCEP.&lt;br /&gt;
&lt;br /&gt;
===Counting settings===&lt;br /&gt;
These parameters must be integers as they specify a quantity to count. &lt;br /&gt;
====&#039;&#039;EpochsToAverage&#039;&#039;====&lt;br /&gt;
Average this number of CCEPs before sending it to Python to visualize. This is helpful if the OnsetExpression is frequently true within a short period of time, to lower the load on Python updating. &lt;br /&gt;
====&#039;&#039;OnsetPeriod&#039;&#039;====&lt;br /&gt;
The period in which you expect the CCEPs to occur. This can be specified in time units or without units.&lt;br /&gt;
&lt;br /&gt;
# Time units: The minimum time between detection of CCEPs. For example, if this is 2s, OnsetExpression will not be true for 2s after a sample that is is triggered. After 2 seconds, it will start being evaluated again.&lt;br /&gt;
# Without units: Skip one less than this number of CCEPs. For example, for high-frequency stimulation, the OnsetExpression might be true 50 times in 1 second. Therefore, you would want to set this number to 50. If you are also averaging the plots, it will only average the signals specified by this period.&lt;br /&gt;
&lt;br /&gt;
This is helpful if you want to visualize a time range in which the OnsetExpression is met multiple times. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:SignalProcessing]], [[Python Visualizations]], [[Contributions:PAC]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Technical_Reference:State_Definition&amp;diff=12030</id>
		<title>Technical Reference:State Definition</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Technical_Reference:State_Definition&amp;diff=12030"/>
		<updated>2025-07-03T20:19:27Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the concept of BCI2000 states, in conjunction with their textual representation as a &amp;quot;state line&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For information about how to access state values from code, please refer to [[Programming Reference:Environment Class]].&lt;br /&gt;
For information about individual states, please refer to [[User Reference:States]].&lt;br /&gt;
&lt;br /&gt;
==State Concept==&lt;br /&gt;
States are variables that represent the internal state of a BCI2000 system as it is evolving over time in response to:&lt;br /&gt;
*brain signal input&lt;br /&gt;
*user interaction through the operator interface&lt;br /&gt;
*trial sequencing by the application module.&lt;br /&gt;
&lt;br /&gt;
Typical quantities/qualities encoded by states are:&lt;br /&gt;
*whether the system is running or suspended&lt;br /&gt;
*the time when a block of data was recorded &lt;br /&gt;
*stimulus or task being presented&lt;br /&gt;
*the classification result&lt;br /&gt;
*the state of an external marker (trigger) to be saved for off-line analysis.&lt;br /&gt;
&lt;br /&gt;
Typically, state values change once per block of data, or once per trial, but are recorded per-sample in case better resolution is required.&lt;br /&gt;
In a [[Technical Reference:BCI2000 File Format|BCI2000 data file]], the full set of states is stored along with the data, allowing for reconstruction of on-line system state off-line.&lt;br /&gt;
&lt;br /&gt;
==Kinds of States==&lt;br /&gt;
Depending on subtle differences in behavior, states come in three different flavors, or kinds. All of them are recorded per-sample,&lt;br /&gt;
and all of them are available as &amp;quot;States&amp;quot; when reading a data file.&lt;br /&gt;
===Events===&lt;br /&gt;
These are only available in source modules. &#039;&#039;Events&#039;&#039; are states that can be written to asynchronously, using the [[Programming_Reference:Events|bcievent]] interface.&lt;br /&gt;
Event data are collected in a queue along with time stamps, and aligned to samples with a maximum resolution of 1ms immediately after&lt;br /&gt;
a new block of data has been recorded.&lt;br /&gt;
===Streams===&lt;br /&gt;
Similar to events, streams are only available in source modules. &#039;&#039;Streams&#039;&#039; are states that are intended to be used like additional &lt;br /&gt;
source channels, being recorded synchronously with incoming brain signals. For an example how to use streams in conjunction with &lt;br /&gt;
the &amp;lt;tt&amp;gt;BufferedADC&amp;lt;/tt&amp;gt; class in a BCI2000 source module, see [[Programming_Tutorial:Implementing_a_Source_Module|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
When the value of a stream is set for a particular sample position in the current data block, it does not affect further samples.&lt;br /&gt;
&lt;br /&gt;
===States===&lt;br /&gt;
The third kind of states is just called &#039;&#039;State&#039;&#039; and behaves specially in that setting a state at a particular sample position in the current data block will set it to that value for all future time points. To ensure proper behavior of states at block boundaries,&lt;br /&gt;
a special carryover value exists at the end of the state vector that does not correspond to any sample position but is used to initialize a state&#039;s values when a new block of brain signal data arrives.&lt;br /&gt;
&lt;br /&gt;
==State Vector==&lt;br /&gt;
In a BCI2000 system, a collection of states is maintained as a &#039;&#039;State List&#039;&#039;.&lt;br /&gt;
For each state present in that state list, its value is kept as a range of bits in a bit vector called &#039;&#039;State Vector&#039;&#039;.&lt;br /&gt;
BCI2000 modules and filters may read and write state values during processing.&lt;br /&gt;
The state vector&#039;s content is saved, in its binary form, into [[Technical Reference:BCI2000 File Format|BCI2000 data files]] per-block.&lt;br /&gt;
Using the ByteLocation, BitLocation, and Length fields from the state definitions present in a file, a state&#039;s value may be read from the data file.&lt;br /&gt;
&lt;br /&gt;
A state vector is a narrowly packed bit field in &#039;&#039;&#039;little endian&#039;&#039;&#039; ordering.&lt;br /&gt;
This implies that, for a state containing more than a single bit, &#039;&#039;&#039;more&#039;&#039;&#039; significant bits are placed at &#039;&#039;&#039;higher&#039;&#039;&#039; bit and byte locations.&lt;br /&gt;
&lt;br /&gt;
As an example, consider a state vector consisting of a 1-bit state &amp;quot;Running&amp;quot;, and a 16-bit state &amp;quot;SourceTime&amp;quot;. This will result in a three-byte state vector layout like this:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;1&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 0&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 1 &lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 2&lt;br /&gt;
|-&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
|-&lt;br /&gt;
!Running!!colspan=&amp;quot;16&amp;quot;|SourceTime!!colspan=&amp;quot;7&amp;quot;|unused&lt;br /&gt;
|-&lt;br /&gt;
!0&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7!!8!!9!!10!!11!!12!!13!!14!!15&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To make reading and writing of state values more efficient, &#039;&#039;padding&#039;&#039; states may be present in a state vector. They don&#039;t carry information but avoid states to extend across byte boundaries, and provide additional bytes required to access full 4-byte values.&lt;br /&gt;
To separate padding states from actual states, padding states&#039; names are formed from two underscores, the word &amp;quot;pad&amp;quot;, and a current number as in &amp;lt;tt&amp;gt;__pad0&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;__pad1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;__pad2&amp;lt;/tt&amp;gt;, and so on.&lt;br /&gt;
&lt;br /&gt;
==State Lines==&lt;br /&gt;
State lines are a human-readable format used to represent individual states in&lt;br /&gt;
*[[Technical Reference:BCI2000 File Format|BCI2000 data files]],&lt;br /&gt;
*[[Technical Reference:BCI2000 Messages|BCI2000 messages]] sent between modules.&lt;br /&gt;
Core modules and the operator module use this format to communicate in the system initialization phase, as well as during system performance and for system termination.&lt;br /&gt;
&lt;br /&gt;
The format of a state line is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Name Length Value ByteLocation BitLocation CRLF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; refers to the number of bits used to represent the state&#039;s value,&lt;br /&gt;
and &amp;lt;tt&amp;gt;ByteLocation&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; refer to its position in the State Vector, with &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; ranging from 0 to 7.&lt;br /&gt;
&lt;br /&gt;
Depending on the context of a state line, one or more of its fields will be redundant:&lt;br /&gt;
*In a State message sent from a core module to the operator module, ByteLocation will be ignored, and BitLocation will change its meaning, and transport information about the state kind (see below). &lt;br /&gt;
*In a State line contained in a data file, the Value field matches the state&#039;s value stored with the first block of data samples.&lt;br /&gt;
*If BitLocation is negative, it represents the state variable&#039;s &#039;&#039;kind&#039;&#039;. The following values are defined:&lt;br /&gt;
 &#039;&#039;-1&#039;&#039; Padding state, &#039;&#039;-2&#039;&#039; State kind, &#039;&#039;-3&#039;&#039; Event kind, &#039;&#039;-4&#039;&#039; Stream kind.&lt;br /&gt;
&lt;br /&gt;
Generally, the Value field specifies an &#039;&#039;initial value&#039;&#039; of a state. Actual values are stored in the State Vector data structure.&lt;br /&gt;
&lt;br /&gt;
State values are interpreted as unsigned integers, and limited to 32 bit in the current implementation (as defined by the &amp;lt;tt&amp;gt;State::ValueType&amp;lt;/tt&amp;gt; typedef in &amp;lt;tt&amp;gt;BCI2000/src/shared/types/State.h&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Alternate version of State Lines==&lt;br /&gt;
With the existence of different &#039;&#039;kinds&#039;&#039; of states, and the need to transfer those between modules, a new version of state lines was introduced. It is only used between core modules that support it, and the Operator module.&lt;br /&gt;
&lt;br /&gt;
Its format is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Name Kind Length Value Location CRLF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;Kind&amp;lt;/tt&amp;gt; may be one of&lt;br /&gt;
*&#039;&#039;0&#039;&#039;: Padding state,&lt;br /&gt;
*&#039;&#039;1&#039;&#039;: State kind,&lt;br /&gt;
*&#039;&#039;2&#039;&#039;: Event kind,&lt;br /&gt;
*&#039;&#039;3&#039;&#039;: Stream kind,&lt;br /&gt;
and &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; refers to the number of bits used to represent the state in the state vector.&lt;br /&gt;
As before, the &amp;lt;tt&amp;gt;Value&amp;lt;/tt&amp;gt; field specifies the state&#039;s &#039;&#039;initial value&#039;&#039;.&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;Location&amp;lt;/tt&amp;gt; field represents the same information as the &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ByteLocation&amp;lt;/tt&amp;gt; fields above, albeit in a single number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Location = ByteLocation * 8 + BitLocation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:States]], [[Technical Reference:Parameter Definition]], [[Programming Reference:Events]], [[Programming Reference:States]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Specification]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12007</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12007"/>
		<updated>2025-06-27T18:04:00Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for inter-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
# Install BCI2000&lt;br /&gt;
# Insert the Cortec USB drive that comes with the Brain Interchange (BIC) device. Under &#039;&#039;Software&#039;&#039;, run the &#039;&#039;Bicapi_setup...&#039;&#039; executable&lt;br /&gt;
# Run a batch file with CortecADC as your Signal Source!&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12006</id>
		<title>Contributions:CortecADC</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CortecADC&amp;diff=12006"/>
		<updated>2025-06-27T17:49:11Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Updated version history&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:CorTec_BrainInterchange.png|400px|thumb|right|CorTec Brain Interchange Implant]]&lt;br /&gt;
&lt;br /&gt;
CortecADC is a source module that allows for inter-cranial recording and stimulating over 32 channels via a fully implantable device. It is intended for long-term measurement of neural activity and electrical stimulation of brain tissue. See the [https://www.cortec-neuro.com/solutions/complete-system/ CorTec site] for more information.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[CortecExperience]] page for user tutorials and a broad overview!&#039;&#039;&#039; After viewing the [[CortecExperience]] page, refer to this page for detailed instructions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
* Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
* Markus Adamek (adamek@neurotechcenter.org)&lt;br /&gt;
* Christian Stolle (christian.stolle@cortec-neuro.com)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! Date !! Revision !! Note !! Contributor&lt;br /&gt;
|-&lt;br /&gt;
!11/29/2018&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R5829&lt;br /&gt;
|Initial untested version&lt;br /&gt;
|Adamek&lt;br /&gt;
|-&lt;br /&gt;
!04/19/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6271&lt;br /&gt;
|First working version&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!07/22/2021&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R6339&lt;br /&gt;
|Changed &#039;&#039;ImplantLostSample&#039;&#039; from a BCI2000 state to a stream, so it can record individual sample loss (instead of over the whole block)&lt;br /&gt;
|Belsten&lt;br /&gt;
|-&lt;br /&gt;
!01/01/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7133&lt;br /&gt;
|Updated API to version 1.0.200. &lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!03/08/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7251&lt;br /&gt;
|Stimulation functionality added&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!05/19/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7367&lt;br /&gt;
|Impedance measurement enabled&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!10/26/2023&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Stimulation latency vastly improved&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!02/20/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7847&lt;br /&gt;
|Version 1.0.230 added. Can change between versions in CMakeLists.txt file&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!08/09/2024&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8313&lt;br /&gt;
|Version 1.0.238 added&lt;br /&gt;
|Stolle&lt;br /&gt;
|-&lt;br /&gt;
!01/17/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R7679&lt;br /&gt;
|Interpolation filter added to interpolate lost samples&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
!06/25/2025&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|R8915&lt;br /&gt;
|All listener states were changed to events&lt;br /&gt;
|Engelhardt&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6266&lt;br /&gt;
*Tested under: 8709&lt;br /&gt;
*Known to compile under: 8915&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
===Known Issues===&lt;br /&gt;
* Lost samples - The &amp;lt;code&amp;gt;ImplantLostSamples&amp;lt;/code&amp;gt; state records what samples are lost, and their locations. Lost samples are replaced with the previous valid sample for all channels. In offline analysis, be sure to remove these samples and replace them with interpolates.&lt;br /&gt;
* The Brain Interchange Communication Unit has been seen to work with certain USB inputs, and not with others. If you are experiencing connection issues, try using a different USB port.&lt;br /&gt;
&lt;br /&gt;
==Source Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Source&amp;quot; tab of the BCI2000 config window.&lt;br /&gt;
[[File:CortecSourceParameters.jpg|600px|thumb|center|upright=2.5|Figure 1. The default source parameters for the CortecADC]]&lt;br /&gt;
===SourceCh===&lt;br /&gt;
The total number of digitized and stored channels. In the current implementation, this parameter cannot be edited, and will default to how many channels are available from the implant. &lt;br /&gt;
&lt;br /&gt;
===SampleBlockSize===&lt;br /&gt;
Samples per channel per digitized block. &lt;br /&gt;
Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.&lt;br /&gt;
&lt;br /&gt;
===SamplingRate===&lt;br /&gt;
The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant. &lt;br /&gt;
In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications), and increase Visualize-&amp;gt;VisualizeSourceDecimation. This parameter will decrease the number of samples per second that are actually drawn in the Source display.&lt;br /&gt;
&lt;br /&gt;
===SourceChOffset===&lt;br /&gt;
Offset for each channel.&lt;br /&gt;
&lt;br /&gt;
===SourceChGain===&lt;br /&gt;
Gain for each channel. &lt;br /&gt;
&lt;br /&gt;
===ChannelNames===&lt;br /&gt;
Names of each channel.&lt;br /&gt;
&lt;br /&gt;
===ReferenceCh===&lt;br /&gt;
This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the [https://www.bci2000.org/mediawiki/index.php/User_Reference:SpatialFilter spatial filter]. If this parameter is set to auto, no reference channels are used. It is strongly recommended to use at least one reference channel.&lt;br /&gt;
&lt;br /&gt;
===AmplificationFactor===&lt;br /&gt;
Amplification factor that is applied to the recorded data on the implant. The choices are 39.5, 45.5, 51.5, 57.5 db.&lt;br /&gt;
&lt;br /&gt;
===UseGround===&lt;br /&gt;
Enable to use the ground electrode while measuring. This setting can be overwritten during stimulation, depending if the ground electrode is being used or not. For example, if you have enabled this parameter but don&#039;t have &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; in your &amp;lt;code&amp;gt;Destination ch&amp;lt;/code&amp;gt; list in the StimulationTriggers parameter, when you are stimulating you will not be using the ground electrode. Once stimulation is done, this parameter&#039;s settings are used again.&lt;br /&gt;
&lt;br /&gt;
===SaveInfoFile===&lt;br /&gt;
Enable to save a text file, named the same as the data file run. It will contain the timestamp, amplification factor used in the run, and reference channels used. If the Impedance is measured, the impedance values will be saved to this file regardless of if this parameter is enabled.&lt;br /&gt;
&lt;br /&gt;
===LogPacketErrors===&lt;br /&gt;
Enable to save the packet loss errors to the System Log. Helpful for debugging, however can get overwhelming if there are a lot of lost samples. The System Log can be programmatically saved by appending &amp;lt;code&amp;gt;--SystemLogFile=SOME_FILE.TXT&amp;lt;/code&amp;gt; to the &amp;lt;code&amp;gt;Startup system localhost&amp;lt;/code&amp;gt; line in your batch file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Stimulation Parameters==&lt;br /&gt;
These parameters can be found in the &amp;quot;Stimulation&amp;quot; tab of the BCI2000 config window. &lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=300px heights=300px&amp;gt;&lt;br /&gt;
File:CortecADC_stimulation_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationpulses_parm.PNG&lt;br /&gt;
File:CortecADC_stimulationtriggers_parm1.PNG&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===EnableStimulation===&lt;br /&gt;
This parameter enables/disables stimulation. &lt;br /&gt;
&lt;br /&gt;
===StimulationMode===&lt;br /&gt;
The BIC has 3 stimulation modes. Each one has limitations. Here is a brief summary of how to use each one:&lt;br /&gt;
#Volatile Commands: The most flexible mode. The limitation is that the stimulation configuration is uploaded right before starting the stimulation, which increases the latency of the stimulation.&lt;br /&gt;
#Persistent Command: There can only be one stimulation configuration, which includes burst settings. There can still be multiple trigger expressions and electrodes. &lt;br /&gt;
#Persistent Functions: There cannot be any train settings (Train frequency and Train repetitions), so the StimulationTriggers must not have those rows.&lt;br /&gt;
&lt;br /&gt;
Persistent Command and Functions modes have a lower latency because the stimulation is pre-uploaded. All modes are available to give you the highest amount of flexiblity with the BIC. [[#Stimulation Latency|See below for more details on latency.]]&lt;br /&gt;
&lt;br /&gt;
===MeasureImpedance===&lt;br /&gt;
When enabled, the impedances of the used electrodes are printed when you set the configuration. All electrodes that are being recorded will conduct the impedance measurement. The impedances are shown to the user and also saved in the data directory.&lt;br /&gt;
&lt;br /&gt;
===StimulationPulses===&lt;br /&gt;
This parameter defines the shape of the charge balanced stimulation pulses, as described in Fig 1. The pulses are defined in one column of this parameter matrix, and it is possible to define an arbitrary number of pulses, each of which are associated with a user defined integer called a &#039;&#039;PulseID&#039;&#039;.  The rows are labeled and there are some limitations to the magnitudes and durations which are elaborated on in the subsequent section. &lt;br /&gt;
[[File:CortecADC_pulse_def.png|600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]&lt;br /&gt;
====PulseID====&lt;br /&gt;
This must be an integer greater than or equal to zero. This ID will be used in the &#039;&#039;StimulationTriggers&#039;&#039; parameter. &lt;br /&gt;
&lt;br /&gt;
====Pulse Amplitude====&lt;br /&gt;
The pulse amplitude defines the amplitude of the main pulse in units of µA. The counter pulse will have a negative amplitude that is one-quarter of the magnitude of the main pulse. &lt;br /&gt;
&lt;br /&gt;
The valid values of this parameter are in the range 0 to 6120 µA. The granularity changes for smaller amplitudes as follows:&lt;br /&gt;
* amplitude &amp;lt;=  3060 µA: step size of 12&lt;br /&gt;
* amplitude &amp;gt;  3060 µA: step size of 24&lt;br /&gt;
This leads to a set of acceptable values that looks like: [0, 12, ..., 3048, 3060, 3084, ... 6096, 6120]&lt;br /&gt;
You can define this parameter not to be one of the acceptable values in this range, but it will be rounded to the nearest valid value, and other parameters will be varied to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Pulse Duration====&lt;br /&gt;
The pulse duration defines the duration of the main pulse in µs. The counter pulse will have a duration that is four times longer than the main pulse duration. Pulse duration values are set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. Again, if the provided value is not a multiple of 10, it will be rounded to the nearest valid value, and other parameters will be modified to maintain charge balance. &lt;br /&gt;
&lt;br /&gt;
====Dead Zone 0====&lt;br /&gt;
Holds the duration of the pause between main and counter pulse in µs. Values can be set in steps of 10 µs. The acceptable range is between 10 and 2550 µs. The same duration dead zone will also occur after the counter pulse.&lt;br /&gt;
&lt;br /&gt;
====Dead Zone 1====&lt;br /&gt;
Holds the duration of the pause after the pulse was delivered. Values can be set in steps of 80 µs. The acceptable range goes from 10 to 20400 µs. Note that the steps are starting from 0 while the minimum value is 10 µs. This leads to a set of acceptable values that looks like: [10, 80, 160, 240, ... , 20400] µs.&lt;br /&gt;
&lt;br /&gt;
===StimulationTriggers===&lt;br /&gt;
This parameter defines when stimulation is applied, what pulse is used, how many pulses are applied, and the source and destination locations of the stimulation. These parameters are defined in the rows of this matrix with labels&lt;br /&gt;
====Trigger====&lt;br /&gt;
This must be a [https://www.bci2000.org/mediawiki/index.php/User_Reference:Expression_Syntax BCI2000 expression]. When this expression evaluates true during the run, the stimulation is applied. &lt;br /&gt;
====PulseID====&lt;br /&gt;
The second row should contain a valid PulseID that is to be used. &lt;br /&gt;
====Source Ch====&lt;br /&gt;
The third row is an embedded list that defines the source electrodes. &lt;br /&gt;
====Destination Ch====&lt;br /&gt;
The fourth row is also an embedded list that defines the destination electrodes. Specify &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; to include the ground electrode as the destination channel.&lt;br /&gt;
====Pulse Repetition====&lt;br /&gt;
The fifth row defines how many times that pulse is repeated. The max is 255. In between each repeated pulse there is a 10 µs delay.&lt;br /&gt;
====Train Frequency (optional)====&lt;br /&gt;
The sixth row defines the frequency of the train. This is implemented by determining the amount of downtime after the pulses are done, in a resolution of microseconds. So if your desired frequency produces a desired wait time with a resolution of less than a microsecond, this will be rounded to the nearest microsecond.&lt;br /&gt;
====Train Repetition (optional)====&lt;br /&gt;
The seventh row defines how many times the entire train is repeated, at the frequency set by the previous row.&lt;br /&gt;
[[File:Cotec Stimulation Train.png|1000px|thumb|center|upright=2.5|Figure 1. Stimulation train definition]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: If a train is not desired, you can either set Train Frequency and Repetition to 0, or delete those 2 rows.&lt;br /&gt;
&lt;br /&gt;
===Hardware limitations===&lt;br /&gt;
{|style=&amp;quot;text-align: center;&amp;quot;&lt;br /&gt;
! !! Minimum !! Maximum&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Amplitude (µA)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|6,120&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Duration (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 0 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|2,550&lt;br /&gt;
|-&lt;br /&gt;
!Dead Zone 1 (µs)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|10&lt;br /&gt;
|20,400&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|1&lt;br /&gt;
|255&lt;br /&gt;
|-&lt;br /&gt;
!Train Repetitions&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|0&lt;br /&gt;
|65,535&lt;br /&gt;
|-&lt;br /&gt;
!Pulse Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;|43.57&lt;br /&gt;
|200&lt;br /&gt;
|-&lt;br /&gt;
!Train Frequency (Hz)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| ~0.02&lt;br /&gt;
|Pulse Frequency&lt;br /&gt;
|-&lt;br /&gt;
!Compliance Voltage (V)&lt;br /&gt;
|style=&amp;quot;border-left: solid 1px grey; border-right: solid 1px grey;&amp;quot;| -11&lt;br /&gt;
|5 &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Device Parameters==&lt;br /&gt;
&lt;br /&gt;
===DeviceInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information returned from the device, such as device type, device ID, and the firmware version. &lt;br /&gt;
&lt;br /&gt;
===StateInfo===&lt;br /&gt;
This parameter cannot be edited and is automatically populated with information regarding state units and their multiplier. The device provides information such as humidity, temperature, control value, etc., which are recorded in BCI2000 states (see state information on this page for a complete enumeration of states). The device provides these values with floats, but BCI2000 states can only be integers. The multipliers defined in this parameter are used to increase the amount of precision in the state values. To approximately recover the original float values with the units defined in this parameter, divide each state by its corresponding multiplier.&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
The states encode auxiliary information returned from the Cortec implant. The device provides this data in floating point numbers, however BCI2000 can only record integers to it&#039;s states. To maintain some precision, these floats are multiplied by constants, then recorded to the states as integers. To approximately recover the original data, divide the state by its corresponding constant. Constants are shown in the following table. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:right;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;font-weight:bold;&amp;quot;&lt;br /&gt;
! State&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot; | Constant&lt;br /&gt;
|-&lt;br /&gt;
| ImplantVoltage&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantHumidity&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantControlValue&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|-&lt;br /&gt;
| ImplantPrimaryCoilCurrent&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 1000&lt;br /&gt;
|-&lt;br /&gt;
| ImplantTemperature&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; | 100&lt;br /&gt;
|}&lt;br /&gt;
===ImplantLostSample===&lt;br /&gt;
The communication protocol the device uses does not re-send lost data. This state annotates what samples were lost in the bio-signal data. Currently, lost samples are made up by duplicating the previous sample. &lt;br /&gt;
&lt;br /&gt;
===ImplantVoltage===&lt;br /&gt;
16 bit state that changes when new supply voltage value is received from the implant. After dividing the integer state value by the the voltage multiplier defined in the StateInfo parameter, the units are in volts.&lt;br /&gt;
&lt;br /&gt;
===ImplantHumidity===&lt;br /&gt;
16 bit state that changes when new humidity value is received from the implant. Units in %rh. &lt;br /&gt;
&lt;br /&gt;
===ImplantControlValue===&lt;br /&gt;
16 bit state that changes when new current control value is received from the external unit. The power of the implant is controlled by the external unit. The control value provides a measure of how good the coupling between the two coils is and how much more power can be provided if necessary.&lt;br /&gt;
The value is between 0.0 and 100.0 percent, where 0.0 translates to no power and 100.0 translates to maximum power applied.&lt;br /&gt;
&lt;br /&gt;
===ImplantPrimaryCoilCurrent===&lt;br /&gt;
16 bit state that change when new primary coil current value is received from the external unit. The primary coil refers to the coil inside the head piece of the external unit. Units are mA. &lt;br /&gt;
&lt;br /&gt;
===ImplantTemperature===&lt;br /&gt;
16 bit state that changes when new temperature value is received from the implant. Units are degrees Celsius. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulation===&lt;br /&gt;
Binary state that changes when the device reports that it is stimulating. &lt;br /&gt;
&lt;br /&gt;
===ImplantStimulationBursts===&lt;br /&gt;
Updates when the device reports that stimulation functions have finished. Should increment during a stimulation train.&lt;br /&gt;
&lt;br /&gt;
===ImplantRfQuality===&lt;br /&gt;
8 bit state that reports the antenna quality as reported from the rf-link in dBm. &#039;&#039;&#039;&#039;&#039;To obtain the original value, subtract by 128 (2^8)&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===RequestedStimulation===&lt;br /&gt;
Binary state that records when a stimulation trigger expression evaluates true. State remains true for the duration triggered stimulation. This is useful for determining the latency between when stimulation is requested and when it is actually applied. This is done by computing the difference in time between the rising edges of &#039;&#039;ImplantStimulation&#039;&#039; and &#039;&#039;RequestedStimulation&#039;&#039; states.&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|SCIT]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:CortecGUIimg.png|The Cortec GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stimulation Latency==&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:StimulationModesLatencyCortec.png|Stimulation Latencies for the specified Stimulation Modes. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Tests were conducted for 100 pulses, with an ISI of 10 seconds.&lt;br /&gt;
&lt;br /&gt;
Stimulation latency numbers:&lt;br /&gt;
*Persistent functions: &#039;&#039;&#039;13 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Persistent commands: &#039;&#039;&#039;11 ± 1 ms&#039;&#039;&#039;&lt;br /&gt;
*Volatile commands: &#039;&#039;&#039;60 ± 30 ms&#039;&#039;&#039;. Split into the 2 groups, the lower one is &#039;&#039;&#039;48 ± 3 ms&#039;&#039;&#039; and the higher one is &#039;&#039;&#039;174 ± 3 ms&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As explained above, volatile commands are uploaded right before stimulation, which leads to the increased latency and jitter.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:ADCs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:Data Acquisition]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:Rapid_Development&amp;diff=12005</id>
		<title>Programming Reference:Rapid Development</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:Rapid_Development&amp;diff=12005"/>
		<updated>2025-06-26T20:05:54Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes elements of BCI2000 intended to simplify a programmer&#039;s task when implementing a new BCI2000 filter, or application.&lt;br /&gt;
&lt;br /&gt;
==Templates==&lt;br /&gt;
*The [[Programming Reference:FeedbackDemo Application]] may serve as a starting point for a trial-based application.&lt;br /&gt;
*The [[Programming Reference:IIRFilterBase Class]] filter stub allows you to easily implement IIR filters.&lt;br /&gt;
&lt;br /&gt;
==Helper Classes==&lt;br /&gt;
*[[Programming Reference:WavePlayer Class]] plays back audio files.&lt;br /&gt;
*[[Programming Reference:TextToSpeech Class]] provides synthetic speech.&lt;br /&gt;
*[[Programming Reference:MidiPlayer Class]] plays back MIDI data.&lt;br /&gt;
*[[Programming Reference:TrialStatistics Class]] computes accuracies and bit rates.&lt;br /&gt;
*[[Programming Reference:LogFile Class]] transparently maintains a log file in the current data directory.&lt;br /&gt;
&lt;br /&gt;
==Matlab Integration==&lt;br /&gt;
*The [[Programming Reference:MatlabFilter]] lets Matlab code act upon BCI2000 data.&lt;br /&gt;
*There is also a [[Programming Tutorial:Implementing a Matlab-based Filter|tutorial on implementing a Matlab-based filter]] for temporal filtering, and [[Programming Tutorial:Implementing another Matlab-based Filter| another tutorial]] on implementing an adaptive spatial filter using beamforming.&lt;br /&gt;
&lt;br /&gt;
==Rebuild==&lt;br /&gt;
After changes are made, they must be rebuilt into BCI2000. [[Rebuild BCI2000|Follow these steps to efficiently prototype!]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contents]]&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=CortecExperience&amp;diff=12004</id>
		<title>CortecExperience</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=CortecExperience&amp;diff=12004"/>
		<updated>2025-06-26T16:45:52Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=Introduction Video of CorTec Brain Interchange with BCI2000=&lt;br /&gt;
&amp;lt;youtube alignment=&amp;quot;center&amp;quot; dimensions=&amp;quot;900&amp;quot;&amp;gt;https://youtu.be/TMZPQPhRnn8&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Getting Started with Cortec BIC in BCI2000=&lt;br /&gt;
&lt;br /&gt;
#[[Programming Howto:Building and Customizing BCI2000|Install BCI2000]]&lt;br /&gt;
#*Here you will learn how to configure and compile BCI2000 on your own computer.&lt;br /&gt;
&lt;br /&gt;
#[[CortecADC]]&lt;br /&gt;
#*This article steps you through all the available configuration options and information stored with using BCI2000 with the Brain Interchange.&lt;br /&gt;
&lt;br /&gt;
#[[Contributions:XsensMTwLogger]]&lt;br /&gt;
#*This article shows how to combine any BCI2000 source module the XsensMTw device to capture motion simultaneously with electrophysiological signals.&lt;br /&gt;
&lt;br /&gt;
=Canine Surgical Procedure=&lt;br /&gt;
This article presents a brief introduction to surgical protocols for the implantation of the CorTec Brain Interchange. The main objective is to introduce the essential surgical considerations for implanting this device in different animal models. &lt;br /&gt;
&lt;br /&gt;
Download the [https://bci2000.org/downloads/doc/Canine_Cortec_Surgical_Protocol.pdf surgical protocol here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Preliminary experience with the CorTec BrainInterchange device in a canine modele=&lt;br /&gt;
This article describes initial work toward an ecosystem for adaptive neuromodulation in humans by documenting the experience of implanting CorTec&#039;s BrainInterchange (BIC) device in a beagle canine and using the BCI2000 environment to interact with the BIC device. It begins with laying out the substantial opportunity presented by a useful, easy-to-use, and widely available hardware/software ecosystem in the current landscape of the field of adaptive neuromodulation, and then describes experience with implantation, software integration, and post-surgical validation of recording of brain signals and implant parameters. Initial experience suggests that the hardware capabilities of the BIC device are fully supported by BCI2000, and that the BIC/BCI2000 device can record and process brain signals during free behavior. With further development and validation, the BIC/BCI2000 ecosystem could become an important tool for research into new adaptive neuromodulation protocols in humans. &lt;br /&gt;
&lt;br /&gt;
Schalk G, Worrell S, Mivalt F, Belsten A, Kim I, Morris JM, Hermes D, Klassen BT, Staff NP, Messina S, Kaufmann T, Rickert J, Brunner P, Worrell GA, Miller KJ. Toward a fully implantable ecosystem for adaptive neuromodulation in humans: Preliminary experience with the CorTec BrainInterchange device in a canine model. Front Neurosci. 2022 Dec 19;16:932782. doi: 10.3389/fnins.2022.932782. PMID: 36601593; PMCID: PMC9806357.&lt;br /&gt;
&lt;br /&gt;
Download the [https://bci2000.org/downloads/doc/Preliminary_experience_with_the_CorTec_BrainInterchange_device_in_a_canine_model.pdf article here].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Data Sharing=&lt;br /&gt;
This data recorded is freely available on DANDI and OpenNeuro.&lt;br /&gt;
&lt;br /&gt;
Download the [https://dandiarchive.org/dandiset/000571?pos=1 canine data from DANDI].&lt;br /&gt;
&lt;br /&gt;
Download the [https://openneuro.org/datasets/ds004624/versions/1.0.1 canine data from OpenNeuro].&lt;br /&gt;
&lt;br /&gt;
=Closed-loop Stimulation=&lt;br /&gt;
With BCI2000, it is possible to stimulate with the Brain Interchange based on processed signals from Brain Interchange recordings! BCI2000&#039;s infrastructure was created for closed-loop control, as it processes the recorded activity and can directly use the results to affect the task or stimulation. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See the [[Closed-Loop Stimulation]] page for more information!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;youtube alignment=&amp;quot;center&amp;quot; dimensions=&amp;quot;900&amp;quot;&amp;gt;https://youtu.be/YIM_YmoHRR8&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start out, we can review how to conduct a closed-loop brain-computer interface task. This has a very similar pipeline to closed-loop stimulation so it is a good place to start. Review the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]] for in-depth instructions on how to set it up. &lt;br /&gt;
&lt;br /&gt;
Now that we have the closed-loop task control reviewed, we can move on to closed-loop stimulation. Since CortecADC is a source module, stimulation is conducted in the source module (review the [[User Reference:Filters|Filters]] page for BCI2000 overview). This means we have to carry-over the results from the past signal processing pipeline to the next block. This can be done with States, which stream through all the modules of BCI2000 in a closed-loop fashion. Since Cortec stimulation is controlled with Expressions, a State that was changed due to the processed signal will trigger stimulation. For example, you can use EarlyOffsetExpression available in the [[User Tutorial:StimulusPresentation|StimulusPresentation]] Application module to change stimuli due to a processed signal. You would set up the stimulation to be triggered once the new stimulus is reached, due to EarlyOffsetExpression becoming true.&lt;br /&gt;
&lt;br /&gt;
=Synchronize Inertial Measurement Units with the CorTec Brain Interchange=&lt;br /&gt;
&amp;lt;youtube alignment=&amp;quot;center&amp;quot; dimensions=&amp;quot;900&amp;quot;&amp;gt;https://youtu.be/-SOUX5J1vJE&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Video]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=12003</id>
		<title>Closed-Loop Stimulation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=12003"/>
		<updated>2025-06-26T16:43:09Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we do closed-loop stimulation in BCI2000? This page will provide a foundation to help you on your closed-loop journey. Since BCI2000 is designed to be closed-loop, implementing stimulation is relatively simple. There are only a few adjustments needed to change a closed-loop task, like the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]], to a closed-loop stimulation task.&lt;br /&gt;
&lt;br /&gt;
==Stimulator Types==&lt;br /&gt;
There are two types of stimulators in BCI2000 which are treated distinctly for closed-loop stimulation. The main distinction is where they are in the [[BCI2000_Glossary#Modules|BCI2000 pipeline]].&lt;br /&gt;
&lt;br /&gt;
#Stimulation devices: Located in the &#039;&#039;Application&#039;&#039; module, as extensions. E.g., [[Contributions:gEstimFilter|g.tec gEstim PRO]], [[Contributions:CereStim|Blackrock CereStim]]&lt;br /&gt;
#Amplifiers: A &#039;&#039;Signal Source&#039;&#039; module that acquires data and delivers stimulation. E.g., [[CortecExperience|Cortec Brain Interchange]], [[Contributions:NeuroOmegaADC|AlphaOmega neuromodulation system]]&lt;br /&gt;
&lt;br /&gt;
Stimulators in the &#039;&#039;Application&#039;&#039; module can handle closed-loop stimulation seamlessly. After this is covered, we will document how we can approach the stimulators that are also amplifiers as a &#039;&#039;Signal Source&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
==1) Stimulation devices==&lt;br /&gt;
All the stimulators have a parameter that triggers the stimulation based on a [[User Reference:Expression Syntax|BCI2000 Expression]]. This can use the incoming signal or state. Since the stimulator is in the Application module, which is after the Signal Processing, the incoming signal can be processed appropriately to trigger stimulation however you like.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to stimulate using the standard [[User Reference:SpectralEstimator|SpectralSignalProcessing]], you can format the output to be a single channel corresponding to the average power of a frequency band. Therefore, this output signal, also called the control signal, can be used in a BCI2000 Expression to trigger stimulation with a simple threshold: Signal(1,1)&amp;gt;100.&lt;br /&gt;
&lt;br /&gt;
Similarly, a [[Technical Reference:State Definition|BCI2000 State]] can be used in the Expression to trigger the stimulation. &lt;br /&gt;
&lt;br /&gt;
==2) Amplifiers with stimulation==&lt;br /&gt;
Please read #1 first, as all the information is relevant. The only difference is that we can&#039;t directly use the control signal (the signal from the Signal Processing pipeline), as the stimulation is located as a SignalSource. See the sidebar image for reference.&lt;br /&gt;
&lt;br /&gt;
[[File:ModulesSigStParam.png|thumb|The Source module accesses past States, not past Signals]]&lt;br /&gt;
&lt;br /&gt;
Therefore, we need an adaptable way to transfer the Signal to States. This is done with the [[User Reference:ControlStateFilter|ControlStateFilter]]. The parameter ControlExpression replaces the Trigger Expression of the stimulator, where if the Expression is true, the new state ControlState is 1, and when it is false, the ControlState is 0. Then in your Trigger Expression of the stimulator, ControlState can simply be used.&lt;br /&gt;
&lt;br /&gt;
To improve flexibility, the ControlStateFilter also has a RefractoryPeriod parameter, which defines the minimum time needed between true occurrences of the ControlState. With these two parameters, any SignalProcessing pipeline can be used before it, and the results can be passed to the stimulator in the Signal Source.&lt;br /&gt;
&lt;br /&gt;
==Tutorial Video (with Cortec BIC)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;youtube alignment=&amp;quot;center&amp;quot; dimensions=&amp;quot;900&amp;quot;&amp;gt;https://youtu.be/YIM_YmoHRR8&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since CortecADC is a source module, stimulation is conducted in the source module. This example uses an alternate method to the ControlStateFilter by harnessing the power of the EarlyOffsetExpression available in the StimulusPresentation Application module. This allows you to change stimuli once the processed signal meets a certain condition. You would set up the stimulation to be triggered once the new stimulus is reached, due to EarlyOffsetExpression becoming true.&lt;br /&gt;
&lt;br /&gt;
[[Category:Howto]][[Category:Tutorial]][[Category:Stimulation]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=11998</id>
		<title>Closed-Loop Stimulation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=11998"/>
		<updated>2025-06-24T20:26:06Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we do closed-loop stimulation in BCI2000? This page will provide a foundation to help you on your closed-loop journey. Since BCI2000 is designed to be closed-loop, implementing stimulation is relatively simple. There are only a few adjustments needed to change a closed-loop task, like the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]], to a closed-loop stimulation task.&lt;br /&gt;
&lt;br /&gt;
==Stimulator Types==&lt;br /&gt;
There are two types of stimulators in BCI2000 which are treated distinctly for closed-loop stimulation. The main distinction is where they are in the [[BCI2000_Glossary#Modules|BCI2000 pipeline]].&lt;br /&gt;
&lt;br /&gt;
#Stimulation devices: Located in the &#039;&#039;Application&#039;&#039; module, as extensions. E.g., [[Contributions:gEstimFilter|g.tec gEstim PRO]], [[Contributions:CereStim|Blackrock CereStim]]&lt;br /&gt;
#Amplifiers: A &#039;&#039;Signal Source&#039;&#039; module that acquires data and delivers stimulation. E.g., [[CortecExperience|Cortec Brain Interchange]], [[Contributions:NeuroOmegaADC|AlphaOmega neuromodulation system]]&lt;br /&gt;
&lt;br /&gt;
Stimulators in the &#039;&#039;Application&#039;&#039; module can handle closed-loop stimulation seamlessly. After this is covered, we will document how we can approach the stimulators that are also amplifiers as a &#039;&#039;Signal Source&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
==1) Stimulation devices==&lt;br /&gt;
All the stimulators have a parameter that triggers the stimulation based on a [[User Reference:Expression Syntax|BCI2000 Expression]]. This can use the incoming signal or state. Since the stimulator is in the Application module, which is after the Signal Processing, the incoming signal can be processed appropriately to trigger stimulation however you like.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to stimulate using the standard [[User Reference:SpectralEstimator|SpectralSignalProcessing]], you can format the output to be a single channel corresponding to the average power of a frequency band. Therefore, this output signal, also called the control signal, can be used in a BCI2000 Expression to trigger stimulation with a simple threshold: Signal(1,1)&amp;gt;100.&lt;br /&gt;
&lt;br /&gt;
Similarly, a [[Technical Reference:State Definition|BCI2000 State]] can be used in the Expression to trigger the stimulation. &lt;br /&gt;
&lt;br /&gt;
==2) Amplifiers with stimulation==&lt;br /&gt;
Please read #1 first, as all the information is relevant. The only difference is that we can&#039;t directly use the control signal (the signal from the Signal Processing pipeline), as the stimulation is located as a SignalSource. See the sidebar image for reference.&lt;br /&gt;
&lt;br /&gt;
[[File:ModulesSigStParam.png|thumb|The Source module accesses past States, not past Signals]]&lt;br /&gt;
&lt;br /&gt;
Therefore, we need an adaptable way to transfer the Signal to States. This is done with the [[User Reference:ControlStateFilter|ControlStateFilter]]. The parameter ControlExpression replaces the Trigger Expression of the stimulator, where if the Expression is true, the new state ControlState is 1, and when it is false, the ControlState is 0. Then in your Trigger Expression of the stimulator, ControlState can simply be used.&lt;br /&gt;
&lt;br /&gt;
To improve flexibility, the ControlStateFilter also has a RefractoryPeriod parameter, which defines the minimum time needed between true occurrences of the ControlState. With these two parameters, any SignalProcessing pipeline can be used before it, and the results can be passed to the stimulator in the Signal Source.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=User_Reference:ControlStateFilter&amp;diff=11997</id>
		<title>User Reference:ControlStateFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=User_Reference:ControlStateFilter&amp;diff=11997"/>
		<updated>2025-06-24T19:56:25Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Function==&lt;br /&gt;
The ControlStateFilter enables sending the control signal (output of the signal processing pipeline) to a state: ControlState. Any [[User Reference:Expression Syntax|BCI2000 Expression]] can be used to control the ControlState, however using the signal will be the most useful. &lt;br /&gt;
&lt;br /&gt;
This filter was created for closed-loop stimulation control. Please see the [[Closed-Loop Stimulation]] reference page for detailed information.&lt;br /&gt;
&lt;br /&gt;
==Author==&lt;br /&gt;
Will Engelhardt - engelhardt@neurotechcenter.org&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
===ControlExpression===&lt;br /&gt;
This expression is evaluated at a sample-by-sample basis. Every sample is evaluated, and the result (true or false) is copied to the state ControlState.&lt;br /&gt;
&lt;br /&gt;
===RefractoryPeriod===&lt;br /&gt;
This is the necessary time to wait after the ControlState is triggered for it to be able to be triggered again. This can be specified in time units or sample units. For example, if this parameter is 2s, once ControlExpression is evaluated true and ControlState is triggered, ControlState will not be triggered for at least another 2 seconds. After this delay of 2 seconds, ControlExpression will be evaluated at a sample basis again. This delay has the resolution of the sampling rate&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
===ControlState===&lt;br /&gt;
This state is a binary true or false state, controlled by the Control Expression. It can change on a sample-by-sample basis. This is useful when the signal source wants to use the output of the signal processing pipeline, because the evaluation can be copied into this state.&lt;br /&gt;
&lt;br /&gt;
==Integration==&lt;br /&gt;
This filter is currently used for the ClosedLoopStim module, found in &amp;lt;code&amp;gt;src/contrib/SignalProcessing&amp;lt;/code&amp;gt;. However, if desired for other modules, it could easily be moved to the shared folder to maximize flexibility.&lt;br /&gt;
&lt;br /&gt;
[[Category:Filters]][[Category:Signal Processing]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=11996</id>
		<title>Closed-Loop Stimulation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Closed-Loop_Stimulation&amp;diff=11996"/>
		<updated>2025-06-24T17:51:38Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Created page with &amp;quot;How do we do closed-loop stimulation in BCI2000? This page will provide a foundation to help you on your closed-loop journey. Since BCI2000 is designed to be closed-loop, implementing stimulation is relatively simple. There are only a few adjustments needed to change a closed-loop task, like the Mu Rhythm tutorial, to a closed-loop stimulation task.  ==Stimulator Types== There are two types of stimulators in BCI2000 which are trea...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;How do we do closed-loop stimulation in BCI2000? This page will provide a foundation to help you on your closed-loop journey. Since BCI2000 is designed to be closed-loop, implementing stimulation is relatively simple. There are only a few adjustments needed to change a closed-loop task, like the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]], to a closed-loop stimulation task.&lt;br /&gt;
&lt;br /&gt;
==Stimulator Types==&lt;br /&gt;
There are two types of stimulators in BCI2000 which are treated distinctly for closed-loop stimulation. The main distinction is where they are in the [[BCI2000_Glossary#Modules|BCI2000 pipeline]].&lt;br /&gt;
&lt;br /&gt;
#Stimulation devices: Located in the &#039;&#039;Application&#039;&#039; module, as extensions. E.g., [[Contributions:gEstimFilter|g.tec gEstim PRO]], [[Contributions:CereStim|Blackrock CereStim]]&lt;br /&gt;
#Amplifiers: A &#039;&#039;Signal Source&#039;&#039; module that acquires data and delivers stimulation. E.g., [[CortecExperience|Cortec Brain Interchange]], [[Contributions:NeuroOmegaADC|AlphaOmega neuromodulation system]]&lt;br /&gt;
&lt;br /&gt;
Stimulators in the &#039;&#039;Application&#039;&#039; module can handle closed-loop stimulation seamlessly. After this is covered, we will document how we can approach the stimulators that are also amplifiers as a &#039;&#039;Signal Source&#039;&#039; module.&lt;br /&gt;
&lt;br /&gt;
==1) Stimulation devices==&lt;br /&gt;
All the stimulators have a parameter that triggers the stimulation based on a [[User Reference:Expression Syntax|BCI2000 Expression]]. This can use the incoming signal or state. Since the stimulator is in the Application module, which is after the Signal Processing, the incoming signal can be processed appropriately to trigger stimulation however you like.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to stimulate using the standard [[User Reference:SpectralEstimator|SpectralSignalProcessing]], you can format the output to be a single channel corresponding to the average power of a frequency band. Therefore, this output signal, also called the control signal, can be used in a BCI2000 Expression to trigger stimulation with a simple threshold: Signal(1,1)&amp;gt;100.&lt;br /&gt;
&lt;br /&gt;
Similarly, a [[Technical Reference:State Definition|BCI2000 State]] can be used in the Expression to trigger the stimulation. &lt;br /&gt;
&lt;br /&gt;
==2) Amplifiers with stimulation==&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Stimulation&amp;diff=11995</id>
		<title>Stimulation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Stimulation&amp;diff=11995"/>
		<updated>2025-06-24T16:46:30Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Stimulation is easier than ever with BCI2000 - including closed-loop stimulation! Because of BCI2000&#039;s closed-loop nature, stimulation can be performed based on any trigger, ranging from a simple visual stimulus to the output of a complicated signal processing computation in real time. The stimulation format is standardized in BCI2000, with some differences due to device variations. This page will list all the stimulators implemented with BCI2000, and include basic information that applies to all stimulators. For device-specific information, refer to the device&#039;s wiki page.&lt;br /&gt;
&lt;br /&gt;
Contact engelhardt@neurotechcenter.org if you wish to use another stimulator with BCI2000!&lt;br /&gt;
&lt;br /&gt;
==Stimulators==&lt;br /&gt;
Some of the stimulators also include data acquisition capabilities. We will group the stimulators by this capability, as well as if they are standardized or not. If standardized, they will follow the same format and SCIT (see below) can be used. If not standardized, they will follow a variation of formats and you must see each stimulator&#039;s page for instructions.&lt;br /&gt;
&lt;br /&gt;
===Amplifier and Stimulator===&lt;br /&gt;
&#039;&#039;Standardized&#039;&#039;&lt;br /&gt;
*[[CortecExperience|Cortec Brain Interchange]]&lt;br /&gt;
*[[Contributions:NeuroOmegaADC|AlphaOmega neuromodulation system]]&lt;br /&gt;
&#039;&#039;Non-standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:AmpServerProADC|Magstim EGI GTEN neuromodulation system]]&lt;br /&gt;
*[[Contributions:MicroLeadsADC]]&lt;br /&gt;
===Stimulator===&lt;br /&gt;
&#039;&#039;Standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:gEstimFilter|g.tec gEstim PRO]]&lt;br /&gt;
*[[Contributions:CereStim|Blackrock CereStim]]&lt;br /&gt;
&#039;&#039;Non-standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:gSTIMbox]]&lt;br /&gt;
*[[Contributions:TBSIStimulator]]&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Configuring Stimulation Parameters]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
[[Image:CerestimGUIimg.png|frame|center|An example stimulation configuration for the CereStim]]&lt;br /&gt;
&lt;br /&gt;
For use with &#039;&#039;&#039;Cortec BIC, NeuroOmega, gEstim, and CereStim&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==[[Contributions:CCEPFilter|Real-time Stimulation Visualization]]==&lt;br /&gt;
[[Image:CCEP gif.gif|960px|center|thumb| An example video showing one channel of the CCEP filter.]]&lt;br /&gt;
&lt;br /&gt;
==Closed-loop Stimulation==&lt;br /&gt;
An example of how to perform closed-loop stimulation based on the processed neural activity would be the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]]. This tutorial steps you through the whole pipeline of set-up to post-experiment analysis. The main idea is to make a ball move on the screen due to a difference in the power of a certain frequency band. The goal is to move the ball to a target. Once the ball reaches the target, a BCI2000 State is changed.&lt;br /&gt;
&lt;br /&gt;
All the stimulators use a [[User Reference:Expression Syntax|BCI2000 Expression]] to trigger stimulation, which can include a State. Therefore, it can be easy to set-up stimulation based on when the ball hits the target. You can also cut-out the middle man, and directly use a thresholded signal to trigger stimulation as well.&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]] [[Category: Tutorial]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Stimulation&amp;diff=11994</id>
		<title>Stimulation</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Stimulation&amp;diff=11994"/>
		<updated>2025-06-24T16:41:08Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Stimulation is easier than ever with BCI2000 - including closed-loop stimulation! Because of BCI2000&#039;s closed-loop nature, stimulation can be performed based on any trigger, ranging from a simple visual stimulus to the output of a complicated signal processing computation in real time. The stimulation format is standardized in BCI2000, with some differences due to device variations. This page will list all the stimulators implemented with BCI2000, and include basic information that applies to all stimulators. For device-specific information, refer to the device&#039;s wiki page.&lt;br /&gt;
&lt;br /&gt;
Contact engelhardt@neurotechcenter.org if you wish to use another stimulator with BCI2000!&lt;br /&gt;
&lt;br /&gt;
==Stimulators==&lt;br /&gt;
Some of the stimulators also include data acquisition capabilities. We will group the stimulators by this capability.&lt;br /&gt;
===Amplifier and Stimulator===&lt;br /&gt;
&#039;&#039;Standardized&#039;&#039;&lt;br /&gt;
*[[CortecExperience|Cortec Brain Interchange]]&lt;br /&gt;
*[[Contributions:NeuroOmegaADC|AlphaOmega neuromodulation system]]&lt;br /&gt;
&#039;&#039;Non-standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:AmpServerProADC|Magstim EGI GTEN neuromodulation system]]&lt;br /&gt;
*[[Contributions:MicroLeadsADC]]&lt;br /&gt;
===Stimulator===&lt;br /&gt;
&#039;&#039;Standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:gEstimFilter|g.tec gEstim PRO]]&lt;br /&gt;
*[[Contributions:CereStim|Blackrock CereStim]]&lt;br /&gt;
&#039;&#039;Non-standardized&#039;&#039;&lt;br /&gt;
*[[Contributions:gSTIMbox]]&lt;br /&gt;
*[[Contributions:TBSIStimulator]]&lt;br /&gt;
&lt;br /&gt;
==[[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Configuring Stimulation Parameters]]==&lt;br /&gt;
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 [[User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
[[Image:CerestimGUIimg.png|frame|center|An example stimulation configuration for the CereStim]]&lt;br /&gt;
&lt;br /&gt;
==[[Contributions:CCEPFilter|Real-time Stimulation Visualization]]==&lt;br /&gt;
[[Image:CCEP gif.gif|960px|center|thumb| An example video showing one channel of the CCEP filter.]]&lt;br /&gt;
&lt;br /&gt;
==Closed-loop Stimulation==&lt;br /&gt;
An example of how to perform closed-loop stimulation based on the processed neural activity would be the [[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm tutorial]]. This tutorial steps you through the whole pipeline of set-up to post-experiment analysis. The main idea is to make a ball move on the screen due to a difference in the power of a certain frequency band. The goal is to move the ball to a target. Once the ball reaches the target, a BCI2000 State is changed.&lt;br /&gt;
&lt;br /&gt;
All the stimulators use a [[User Reference:Expression Syntax|BCI2000 Expression]] to trigger stimulation, which can include a State. Therefore, it can be easy to set-up stimulation based on when the ball hits the target. You can also cut-out the middle man, and directly use a thresholded signal to trigger stimulation as well.&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]] [[Category: Tutorial]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11993</id>
		<title>VisualizeBCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11993"/>
		<updated>2025-06-24T16:39:06Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Image:CCEP gif.gif|thumb|960px|An example video showing the CCEP filter with VisualizeBCI2000.]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;clear: both&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
=Introduction=&lt;br /&gt;
A Python toolkit to powerfully visualize BCI2000 data in real-time. The incoming data can be pre-processed in BCI2000&#039;s pipeline, or not, then sent to python through BCI2000&#039;s [[User Reference:SignalSharing|SignalSharing]] feature. The data can also be visualized in 3D if combined with a [https://github.com/neurotechcenter/VERA VERA structure (electrode localization tool)]. It is designed based on BCI2000&#039;s standard of modularity, therefore any of these components can be swapped out without changing the rest of the pipeline.&lt;br /&gt;
=Installation=&lt;br /&gt;
&#039;&#039;&#039;[https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000 can be downloaded from GitHub here]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Python 3.8+ needs to be installed. [https://www.python.org/downloads/| You can download the lastest version here].&lt;br /&gt;
#A couple additional packages are used in this visualization. Run the following segments using &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; in the command line.&lt;br /&gt;
#*Numpy: &amp;lt;code&amp;gt;pip install numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQt5: &amp;lt;code&amp;gt;pip install PyQt5&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQtGraph 0.13.3+: &amp;lt;code&amp;gt;pip install pyqtgraph&amp;lt;/code&amp;gt;&lt;br /&gt;
#*SciPy: &amp;lt;code&amp;gt;pip install scipy&amp;lt;/code&amp;gt; (only the stats package is required)&lt;br /&gt;
#*PyOpenGL: &amp;lt;code&amp;gt;pip install PyOpenGL PyOpenGL_accelerate&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Set-up=&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
# Once [https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000] is downloaded and unzipped from Github, run &#039;&#039;main.py&#039;&#039; with Python. This will bring you to the main page, shown below.&lt;br /&gt;
# Next, choose your BCI2000 location, under &#039;&#039;File&#039;&#039;, then &#039;&#039;Choose BCI2000 Location...&#039;&#039;&lt;br /&gt;
# Choose the filter to visualize, under &#039;&#039;Filters&#039;&#039;&lt;br /&gt;
# Run a batch file with the chosen filter in the pipeline. For example, if CCEPFilter was chosen, you should run a batch file that uses [[Contributions:CCEPFilter|CCEPFilter]] as its Signal Processing module. &lt;br /&gt;
# Set config, then start. Then the filter should be visualized!&lt;br /&gt;
&lt;br /&gt;
See the gallery below for images to follow each step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot; widths=400&amp;gt;&lt;br /&gt;
File:VisualizeBCI2000DefaultWorkspace.png|1. The initial view when main.py is run&lt;br /&gt;
File:VisualizeBCI2000OperatorLocation.png|2. The view after the BCI2000 location is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosen.png|3. View after the desired filter is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosenRearranged.png|Optional rearrangement of the windows&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
These Settings are available to configure in the toolbar&lt;br /&gt;
* &#039;&#039;&#039;Choose BCI2000 Location&#039;&#039;&#039;: Choose the directory in which your BCI2000 resides. The folder chosen should be the main, root folder. This is mainly used to access the BCI2000Remote files, which are assumed to be located in the &#039;&#039;prog&#039;&#039; folder of the root directory.&lt;br /&gt;
* &#039;&#039;&#039;Filters&#039;&#039;&#039;: The BCI2000 Signal Processing filter which sends the incoming data. Each filter requires a custom Python implementation. Currently, the only 2 filters that are available are:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:CCEPFilter|CCEPFilter]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:PAC|Phase-amplitude coupling (PACFilter)]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;DataIOFilter&#039;&#039;&#039;&#039;&#039;: This streams the raw data from BCI2000 and continually updates a grid of plots. This is less of a useful visualization, and more of an example for a basic visualization.&lt;br /&gt;
* &#039;&#039;&#039;Data Streams&#039;&#039;&#039;: Defaults to BCI2000. If other data streams are desired, these must be implemented.&lt;br /&gt;
&lt;br /&gt;
=3D Visualization=&lt;br /&gt;
To enable the 3D visualization, you must input a VERA structure. VERA is an electrode localization application made to simplify electrode localization. The output of the VERA pipeline is a .mat (Matlab) structure, which is the input to be loaded into VisualizeBCI2000. In order to match the electrode names with the BCI2000 channel names, there must be a field called &#039;&#039;electrodeNamesKey&#039;&#039;, with columns &#039;&#039;VERANames&#039;&#039; and &#039;&#039;EEGNames&#039;&#039;. This table provides a necessary key between the two names.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=User:Wengelhardt&amp;diff=11992</id>
		<title>User:Wengelhardt</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=User:Wengelhardt&amp;diff=11992"/>
		<updated>2025-06-24T16:18:18Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Who am I?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.linkedin.com/in/will-engelhardt-261948196/ Will Engelhardt] has been developing BCI2000 since 2021. He focuses on stimulation, feedback and visualization, and improving the experience of BCI2000 overall. Please reach out with any questions.&lt;br /&gt;
&lt;br /&gt;
Email: [mailto:engelhardt@neurotechcenter.org engelhardt@neurotechcenter.org]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Technical_Reference:State_Definition&amp;diff=11991</id>
		<title>Technical Reference:State Definition</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Technical_Reference:State_Definition&amp;diff=11991"/>
		<updated>2025-06-23T16:25:19Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* Streams */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the concept of BCI2000 states, in conjunction with their textual representation as a &amp;quot;state line&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
For information about how to access state values from code, please refer to [[Programming Reference:Environment Class]].&lt;br /&gt;
For information about individual states, please refer to [[User Reference:States]].&lt;br /&gt;
&lt;br /&gt;
==State Concept==&lt;br /&gt;
States are variables that represent the internal state of a BCI2000 system as it is evolving over time in response to:&lt;br /&gt;
*brain signal input&lt;br /&gt;
*user interaction through the operator interface&lt;br /&gt;
*trial sequencing by the application module.&lt;br /&gt;
&lt;br /&gt;
Typical quantities/qualities encoded by states are:&lt;br /&gt;
*whether the system is running or suspended&lt;br /&gt;
*the time when a block of data was recorded &lt;br /&gt;
*stimulus or task being presented&lt;br /&gt;
*the classification result&lt;br /&gt;
*the state of an external marker (trigger) to be saved for off-line analysis.&lt;br /&gt;
&lt;br /&gt;
Typically, state values change once per block of data, or once per trial, but are recorded per-sample in case better resolution is required.&lt;br /&gt;
In a [[Technical Reference:BCI2000 File Format|BCI2000 data file]], the full set of states is stored along with the data, allowing for reconstruction of on-line system state off-line.&lt;br /&gt;
&lt;br /&gt;
==Kinds of States==&lt;br /&gt;
Depending on subtle differences in behavior, states come in three different flavors, or kinds. All of them are recorded per-sample,&lt;br /&gt;
and all of them are available as &amp;quot;States&amp;quot; when reading a data file.&lt;br /&gt;
===Events===&lt;br /&gt;
These are only available in source modules. &#039;&#039;Events&#039;&#039; are states that can be written to asynchronously, using the [[https://www.bci2000.org/mediawiki/index.php/Programming_Reference:Events|bcievent]] interface.&lt;br /&gt;
Event data are collected in a queue along with time stamps, and aligned to samples with a maximum resolution of 1ms immediately after&lt;br /&gt;
a new block of data has been recorded.&lt;br /&gt;
===Streams===&lt;br /&gt;
Similar to events, streams are only available in source modules. &#039;&#039;Streams&#039;&#039; are states that are intended to be used like additional &lt;br /&gt;
source channels, being recorded synchronously with incoming brain signals. For an example how to use streams in conjunction with &lt;br /&gt;
the &amp;lt;tt&amp;gt;BufferedADC&amp;lt;/tt&amp;gt; class in a BCI2000 source module, see [[Programming_Tutorial:Implementing_a_Source_Module|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
When the value of a stream is set for a particular sample position in the current data block, it does not affect further samples.&lt;br /&gt;
&lt;br /&gt;
===States===&lt;br /&gt;
The third kind of states is just called &#039;&#039;State&#039;&#039; and behaves specially in that setting a state at a particular sample position in the current data block will set it to that value for all future time points. To ensure proper behavior of states at block boundaries,&lt;br /&gt;
a special carryover value exists at the end of the state vector that does not correspond to any sample position but is used to initialize a state&#039;s values when a new block of brain signal data arrives.&lt;br /&gt;
&lt;br /&gt;
==State Vector==&lt;br /&gt;
In a BCI2000 system, a collection of states is maintained as a &#039;&#039;State List&#039;&#039;.&lt;br /&gt;
For each state present in that state list, its value is kept as a range of bits in a bit vector called &#039;&#039;State Vector&#039;&#039;.&lt;br /&gt;
BCI2000 modules and filters may read and write state values during processing.&lt;br /&gt;
The state vector&#039;s content is saved, in its binary form, into [[Technical Reference:BCI2000 File Format|BCI2000 data files]] per-block.&lt;br /&gt;
Using the ByteLocation, BitLocation, and Length fields from the state definitions present in a file, a state&#039;s value may be read from the data file.&lt;br /&gt;
&lt;br /&gt;
A state vector is a narrowly packed bit field in &#039;&#039;&#039;little endian&#039;&#039;&#039; ordering.&lt;br /&gt;
This implies that, for a state containing more than a single bit, &#039;&#039;&#039;more&#039;&#039;&#039; significant bits are placed at &#039;&#039;&#039;higher&#039;&#039;&#039; bit and byte locations.&lt;br /&gt;
&lt;br /&gt;
As an example, consider a state vector consisting of a 1-bit state &amp;quot;Running&amp;quot;, and a 16-bit state &amp;quot;SourceTime&amp;quot;. This will result in a three-byte state vector layout like this:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;1&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 0&lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 1 &lt;br /&gt;
!colspan=&amp;quot;8&amp;quot;|State Vector Byte 2&lt;br /&gt;
|-&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7&lt;br /&gt;
|-&lt;br /&gt;
!Running!!colspan=&amp;quot;16&amp;quot;|SourceTime!!colspan=&amp;quot;7&amp;quot;|unused&lt;br /&gt;
|-&lt;br /&gt;
!0&lt;br /&gt;
!0!!1!!2!!3!!4!!5!!6!!7!!8!!9!!10!!11!!12!!13!!14!!15&lt;br /&gt;
!colspan=&amp;quot;7&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To make reading and writing of state values more efficient, &#039;&#039;padding&#039;&#039; states may be present in a state vector. They don&#039;t carry information but avoid states to extend across byte boundaries, and provide additional bytes required to access full 4-byte values.&lt;br /&gt;
To separate padding states from actual states, padding states&#039; names are formed from two underscores, the word &amp;quot;pad&amp;quot;, and a current number as in &amp;lt;tt&amp;gt;__pad0&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;__pad1&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;__pad2&amp;lt;/tt&amp;gt;, and so on.&lt;br /&gt;
&lt;br /&gt;
==State Lines==&lt;br /&gt;
State lines are a human-readable format used to represent individual states in&lt;br /&gt;
*[[Technical Reference:BCI2000 File Format|BCI2000 data files]],&lt;br /&gt;
*[[Technical Reference:BCI2000 Messages|BCI2000 messages]] sent between modules.&lt;br /&gt;
Core modules and the operator module use this format to communicate in the system initialization phase, as well as during system performance and for system termination.&lt;br /&gt;
&lt;br /&gt;
The format of a state line is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Name Length Value ByteLocation BitLocation CRLF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; refers to the number of bits used to represent the state&#039;s value,&lt;br /&gt;
and &amp;lt;tt&amp;gt;ByteLocation&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; refer to its position in the State Vector, with &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; ranging from 0 to 7.&lt;br /&gt;
&lt;br /&gt;
Depending on the context of a state line, one or more of its fields will be redundant:&lt;br /&gt;
*In a State message sent from a core module to the operator module, ByteLocation will be ignored, and BitLocation will change its meaning, and transport information about the state kind (see below). &lt;br /&gt;
*In a State line contained in a data file, the Value field matches the state&#039;s value stored with the first block of data samples.&lt;br /&gt;
*If BitLocation is negative, it represents the state variable&#039;s &#039;&#039;kind&#039;&#039;. The following values are defined:&lt;br /&gt;
 &#039;&#039;-1&#039;&#039; Padding state, &#039;&#039;-2&#039;&#039; State kind, &#039;&#039;-3&#039;&#039; Event kind, &#039;&#039;-4&#039;&#039; Stream kind.&lt;br /&gt;
&lt;br /&gt;
Generally, the Value field specifies an &#039;&#039;initial value&#039;&#039; of a state. Actual values are stored in the State Vector data structure.&lt;br /&gt;
&lt;br /&gt;
State values are interpreted as unsigned integers, and limited to 32 bit in the current implementation (as defined by the &amp;lt;tt&amp;gt;State::ValueType&amp;lt;/tt&amp;gt; typedef in &amp;lt;tt&amp;gt;BCI2000/src/shared/types/State.h&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Alternate version of State Lines==&lt;br /&gt;
With the existence of different &#039;&#039;kinds&#039;&#039; of states, and the need to transfer those between modules, a new version of state lines was introduced. It is only used between core modules that support it, and the Operator module.&lt;br /&gt;
&lt;br /&gt;
Its format is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Name Kind Length Value Location CRLF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;Kind&amp;lt;/tt&amp;gt; may be one of&lt;br /&gt;
*&#039;&#039;0&#039;&#039;: Padding state,&lt;br /&gt;
*&#039;&#039;1&#039;&#039;: State kind,&lt;br /&gt;
*&#039;&#039;2&#039;&#039;: Event kind,&lt;br /&gt;
*&#039;&#039;3&#039;&#039;: Stream kind,&lt;br /&gt;
and &amp;lt;tt&amp;gt;Length&amp;lt;/tt&amp;gt; refers to the number of bits used to represent the state in the state vector.&lt;br /&gt;
As before, the &amp;lt;tt&amp;gt;Value&amp;lt;/tt&amp;gt; field specifies the state&#039;s &#039;&#039;initial value&#039;&#039;.&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;Location&amp;lt;/tt&amp;gt; field represents the same information as the &amp;lt;tt&amp;gt;BitLocation&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ByteLocation&amp;lt;/tt&amp;gt; fields above, albeit in a single number:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Location = ByteLocation * 8 + BitLocation&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:States]], [[Technical Reference:Parameter Definition]], [[Programming Reference:Events]], [[Programming Reference:States]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Specification]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=User_Reference:ConnectorFilters&amp;diff=11964</id>
		<title>User Reference:ConnectorFilters</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=User_Reference:ConnectorFilters&amp;diff=11964"/>
		<updated>2025-06-19T17:19:25Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==NOTE==&lt;br /&gt;
The &#039;&#039;&#039;ConnectorFilters&#039;&#039;&#039; interface has been &#039;&#039;&#039;superseded&#039;&#039;&#039; by a variety of BCI2000 scripting and remote control options. It is being kept for backward compatibility. See the [[Technical Reference:App Connector|App Connector page]] for details on the superseded implementations.&lt;br /&gt;
&lt;br /&gt;
==Function==&lt;br /&gt;
The &#039;&#039;&#039;ConnectorFilters&#039;&#039;&#039; provide an implementation of the BCI2000 [[Technical Reference:App Connector|App Connector]] protocol.&lt;br /&gt;
&lt;br /&gt;
===Filter Placement===&lt;br /&gt;
Typically, the [[User Reference:ConnectorInput|ConnectorInput]] filter is the first filter in the [[Technical Reference:Core Modules|Application Module]], which allows external changes to BCI2000 state to affect the application module&#039;s behavior immediately. &lt;br /&gt;
Similarly, the [[User Reference:ConnectorOutput|ConnectorOutput]] filter is placed last in the application module, such that state information read over the protocol will immediately reflect the application module&#039;s state changes.&lt;br /&gt;
&lt;br /&gt;
===Detailed Description===&lt;br /&gt;
A description of the connector protocol, along with client example code, and configuration examples, is provided on a separate [[Technical Reference:App Connector|App Connector]] page.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
===ConnectorInputAddress===&lt;br /&gt;
An address:port combination that specifies a local UDP socket. Addresses may be host names, or numerical IP addresses. &lt;br /&gt;
Incoming data is read from this socket.&lt;br /&gt;
&lt;br /&gt;
===ConnectorInputFilter===&lt;br /&gt;
For incoming values, messages are filtered by state name using a list of allowed names present in this parameter. To allow signal messages, allowed signal elements must be specified including their indices. To allow all names, enter an asterisk (*) as the only list entry.&lt;br /&gt;
 &lt;br /&gt;
===ConnectorOutputAddress===&lt;br /&gt;
Ad address:port combination that specifies a local or remote UDP socket. Addresses may be host names, or numerical IP addresses. For each data block, values of all state variables and the control signal are written out to this socket, using the [[Technical Reference:App Connector|App Connector Protocol]].&lt;br /&gt;
&lt;br /&gt;
==States==&lt;br /&gt;
All states present in the system are transmitted over the App Connector protocol.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[Technical Reference:App Connector]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Filters]][[Category:User Application]][[Category:External Interfaces]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=11961</id>
		<title>Contributions:CCEPFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:CCEPFilter&amp;diff=11961"/>
		<updated>2025-06-17T17:59:14Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Image:CCEP gif.gif|thumb|800px| An demo video of the CCEP Filter with VisualizeBCI2000. ]]&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
Cortico-cortical evoked potentials (CCEPs) are generated as a response to stimulation within the cortical zone. To best view this response, the CCEP filter time locks the signal to the stimulation and allows the user to view the CCEPS from every recording electrode. There are many adaptable parameters to include flexibility for a variety of experiments.&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
http://www.bci2000.org/svn/trunk/src/contrib/SignalProcessing/CCEPFilter&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
* Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 05/17/2023 - First working version&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 7199&lt;br /&gt;
*Tested under: 7303&lt;br /&gt;
*Known to compile under: 7364&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Python Visualizations#Installation|the Installation section on the Python Visualization page]] to see how to install the necessary packages and how to run demo files! Once that is all set up, you can return to this page to understand the specific parameters for the CCEPs.&lt;br /&gt;
&lt;br /&gt;
==Processing Details==&lt;br /&gt;
The CCEP filter has two parts - a C++ filter in the Signal Processing pipeline, and the Python filter outside of the BCI2000 chain. &lt;br /&gt;
# BCI2000 filter&lt;br /&gt;
#* The filter receives the raw data from the Source module, then time-locks the data based on the user-defined CCEP parameters.&lt;br /&gt;
#* When all the data is collected, the state CCEPTriggered will pulse to let the Python filter know data is ready to be visualized.&lt;br /&gt;
# Python filter&lt;br /&gt;
#* Data is received through the [[User Reference:SignalSharing|SignalSharing]] feature. Specifically, the parameter ShareCCEPFilter is set to a valid port to share the data.&lt;br /&gt;
#* When CCEPTriggered is true, the incoming data is further processed and plotted. The only processing this filter does is to calculate the area under the curve (AUC), then determine which channels have a significant response based on the threshold standard deviation set by the user. The raw values are given in the table, and the top most significant channels are visually shown.&lt;br /&gt;
#* If &#039;&#039;Sort Channels&#039;&#039; is enabled, all the significant channels will be at the top. They are then organized based on their original order, to maintain electrode grouping. If they were sorted purely on highest to lowest AUC, it would be very difficult to tell which general areas are responding.&lt;br /&gt;
&lt;br /&gt;
==Python Settings==&lt;br /&gt;
===Threshold (STD)===&lt;br /&gt;
This defines the threshold to determine a CCEP response. This value should be adjusted to maximize the number of significant channels shown, while not going over. If the value is too low, there will be more significant channels than visualized windows. This would only show you the electrodes which were originally at the top of the list, which might lead you to disregard the bottom electrodes.&lt;br /&gt;
===Max Windows===&lt;br /&gt;
The maximum amount of windows displayed. If you desire all the transmitted channels to be shown, set this max value to the number of channels or greater.&lt;br /&gt;
===x&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;===&lt;br /&gt;
The minimum shown value of the x-axis for all windows, in milliseconds. You can set this to a negative value to show baseline data before the CCEP.&lt;br /&gt;
===Hold Plots===&lt;br /&gt;
The number of plots to keep on a window. Set to 0 to hold all plots, until manually cleared with &amp;quot;Clear Figures&amp;quot;.&lt;br /&gt;
===Average CCEPs===&lt;br /&gt;
Enable to display the average of the plots in addition to the single trials. &lt;br /&gt;
===Sort Channels===&lt;br /&gt;
Disable to keep the order of the channels unchanged. If there are more transmitted channels than windows shown, the shown windows will simply be the first in the list.&lt;br /&gt;
===Save figures on refresh===&lt;br /&gt;
&#039;&#039;Currently broken&#039;&#039;. Enable to make sure the visualizations are never lost, as every time the plots are cleared they would first be saved. This can get cumbersome with many saved files.&lt;br /&gt;
&lt;br /&gt;
==BCI2000 Parameters==&lt;br /&gt;
===OnsetExpression===&lt;br /&gt;
Expression that defines the stimulus onset. Ideally, this should be a hardware trigger to have the most precise time-locking. This expression should be true when the stimulation is triggered. See the [[User Reference:Expression Syntax | Expression syntax page]] for more information. &lt;br /&gt;
&lt;br /&gt;
===Duration settings===&lt;br /&gt;
These parameters all should have units of time (e.g. milliseconds), or auto.&lt;br /&gt;
&lt;br /&gt;
====&#039;&#039;BaselineEpochLength&#039;&#039;====&lt;br /&gt;
The duration of desired baseline data. This baseline data is helpful for visualizing the data before the stimulation, and is also used to calculate the average signal value from which the threshold is calculated.&lt;br /&gt;
====&#039;&#039;CCEPEpochLength&#039;&#039;====&lt;br /&gt;
Duration of time after the baseline and latency. Essentially the amount of time that is needed to view the CCEP.&lt;br /&gt;
&lt;br /&gt;
===Counting settings===&lt;br /&gt;
These parameters must be integers as they specify a quantity to count. &lt;br /&gt;
====&#039;&#039;EpochsToAverage&#039;&#039;====&lt;br /&gt;
Average this number of CCEPs before sending it to Python to visualize. This is helpful if the OnsetExpression is frequently true within a short period of time, to lower the load on Python updating. &lt;br /&gt;
====&#039;&#039;OnsetPeriod&#039;&#039;====&lt;br /&gt;
Skip one less than this number of CCEPs. This is helpful if you want to visualize a time range in which the OnsetExpression is met multiple times. For example, for high-frequency stimulation, the OnsetExpression might be true 50 times in 1 second. Therefore, you would want to set this number to 50. If you are also averaging the plots, it will only average the signals specified by this period.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[User Reference:Filters]], [[Contributions:SignalProcessing]], [[Python Visualizations]], [[Contributions:PAC]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:BCI2000SimulinkConnector&amp;diff=11960</id>
		<title>Contributions:BCI2000SimulinkConnector</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:BCI2000SimulinkConnector&amp;diff=11960"/>
		<updated>2025-06-17T15:58:07Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The BCI2000 Simulink connector allows data to be sent to Simulink in real-time, allowing data to be processed in your own custom Simulink model. Both BCI2000 signal and states can be received with Simulink!&lt;br /&gt;
&lt;br /&gt;
[[File:Simulink_Library.PNG|200px|thumb|right|BCI2000 Simulink Component]]&lt;br /&gt;
&lt;br /&gt;
==Video Overview==&lt;br /&gt;
&amp;lt;youtube &amp;gt;https://youtu.be/Geo3YhIOjX4&amp;lt;/youtube&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
http://{{SERVERNAME}}/svn/trunk/src/contrib/ExternalLinks/Simulink&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Author===&lt;br /&gt;
mellinger@neurotechcenter.org&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 7669&lt;br /&gt;
*Tested under: 7669&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
The BCI2000 Simulink connector is a means to send signal data from BCI2000 into a Simulink model. It consists of a BCI2000 filter that listens for connections on a TCP port, and a Simulink S-function that connects to that port and reads data from it.&lt;br /&gt;
As an optimization in case of a machine-local TCP connection, signal data is transmitted through a shared memory block instead of the TCP connection.&lt;br /&gt;
Still, the TCP connection is necessary to synchronize arrival of new data on the BCI2000 side with consumption on the Simulink side.&lt;br /&gt;
&lt;br /&gt;
==Building the Simulink Connector==&lt;br /&gt;
The BCI2000 Simulink connector consists of two projects: A BCI2000 SignalProcessing module, called SimulinkConnectorSignalProcessing, and a Simullink S-function mex file, called BCI2000OnlineLink.&lt;br /&gt;
&lt;br /&gt;
Building the S-function mex file relies on a Matlab installtion being present, and thus requires&lt;br /&gt;
enabling through a CMake switch.&lt;br /&gt;
&lt;br /&gt;
In your BCI2000 build folder, execute &amp;lt;tt&amp;gt;Configure.sh.bat&amp;lt;/tt&amp;gt;. Then, navigate to &amp;lt;tt&amp;gt;BUILD_CONTRIB&amp;lt;/tt&amp;gt; and make sure it is checked. Likewise, navigate to &amp;lt;tt&amp;gt;BUILD_SIMULINK_MEX_FILES&amp;lt;/tt&amp;gt;, and make sure it is checked.&lt;br /&gt;
Then, click &amp;quot;Generate&amp;quot; in the CMake GUI to re-generate the BCI2000 project files (Makefile or Solution file).&lt;br /&gt;
&lt;br /&gt;
In case you have multiple versions of Matlab installed, CMake will pick a random one. To control which Matlab version is used, set the &amp;lt;tt&amp;gt;Matlab_ROOT&amp;lt;/tt&amp;gt; variable to the root directory of the desired version (i.e., the directory that has &amp;quot;Matlab R…&amp;quot; in its name).&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have the Matlab Compiler Runtime (MCR) installed, CMake may pick it but will fail to&lt;br /&gt;
identify the Simulink include directory, which is not present in the MCR installation.&lt;br /&gt;
If this happens, set the &amp;lt;tt&amp;gt;Matlab_ROOT&amp;lt;/tt&amp;gt; variable to the root directory of a full Matlab installation, and re-generate project files.&lt;br /&gt;
&lt;br /&gt;
Once built, Simulink related files are located in BCI2000/prog/Simulink, and the BCI2000/batch directory contains a batch file called SimulinkConnector.bat.&lt;br /&gt;
&lt;br /&gt;
==Using the Minimal Example==&lt;br /&gt;
BCI2000 comes with a minimal example Simulink model, containing just the BCI2000OnlineLink block with its two output ports, a muxer block, and a &amp;quot;to file&amp;quot; block that saves the output to a file.&lt;br /&gt;
&lt;br /&gt;
To try the BCI2000 Simulink Connector, navigate to the BCI2000/prog/Simulink directory using the Matlab file explorer. Then, double-click the MinimalExample.slx Simulink model file. The test consists of the following steps:&lt;br /&gt;
* Double-click BCI2000/batch/SimulinkConnector.bat in your OSes file explorer. BCI2000 will start and display status information in the system log.&lt;br /&gt;
* In the MinimalExample window, click the arrow in the green circle to run the model. It will run indefinitely, reading data from BCI2000, and recording it into a Matlab data file.&lt;br /&gt;
* To end the run, click the the black square (&amp;quot;stop symbol&amp;quot;) right to the green circle.&lt;br /&gt;
* You may now inspect the contents of the recorded data file by typing &amp;lt;tt&amp;gt;data=load(&#039;bci2000.mat&#039;);&amp;lt;/tt&amp;gt; into the Matlab prompt. The &amp;lt;tt&amp;gt;data.ans&amp;lt;/tt&amp;gt; field consists of the following rows:&lt;br /&gt;
** 1: Time in seconds (one row),&lt;br /&gt;
** 2: BCI2000 signal data, upsampled to the original sampling rate if necessary (one row per BCI2000 channel),&lt;br /&gt;
** 3: BCI2000 state data in the order specified in the &#039;&#039;SimulinkConnectorStates&#039;&#039; parameter on the BCI2000 side (one row per BCI2000 state).&lt;br /&gt;
&lt;br /&gt;
[[File:Simulink_MinimalExample.PNG]]&lt;br /&gt;
&lt;br /&gt;
For states to be sent to Simulink, they must be specified as a parameter &#039;&#039;SimulinkConnectorStates&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
==Adding BCI2000 your own model==&lt;br /&gt;
To add the BCI2000 block to your own model, open the BCI2000.mdl library in Matlab, and drag-and-drop the BCI2000 block into your model window. Then, connect its output signals as you see fit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If the target model is located in a different directory than BCI2000/prog/Simulink, you need to add BCI2000/prog/Simulink to the Matlab path in order to use the BCI2000 block.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulink_Library.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Changing the IP:Port setting==&lt;br /&gt;
To change the port or the IP address for connecting to BCI2000, double-click the BCI2000 block in Simulink. Under &amp;quot;S-function parameters&amp;quot;, you see a single entry, which&lt;br /&gt;
is by default &#039;localhost:1905&#039; (take care of the single quotes—without them, Simulink will try to find a variable with name &amp;quot;localhost&amp;quot;). Modify as desired, and close the window.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulink_BCI2000BlockParameters.PNG]]&lt;br /&gt;
&lt;br /&gt;
On the BCI2000 side, the equivalent setting is stored in the &amp;quot;SimulinkConnectorAddress&amp;quot; parameter on the &amp;quot;Connector&amp;quot; tab:&lt;br /&gt;
&lt;br /&gt;
[[File:Simulink_BCI2000Parameter.PNG]]&lt;br /&gt;
&lt;br /&gt;
Note that connections between different machines are supported but data transport through TCP will be much less efficient than local transport, which takes place through shared memory.&lt;br /&gt;
&lt;br /&gt;
Addresses will always be identical on both ends. When switching to a non-local connection, “localhost” will have to be replaced with the IP address of the machine running BCI2000 (e.g., &#039;&#039;192.168.1.15:1905&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==Sending States==&lt;br /&gt;
State/Event information may be transferred by specifying State/Event names in the &#039;&#039;SimulinkConnectorStates&#039;&#039; parameter (see image above). States listed there will be transferred to the BCI2000 block&#039;s &amp;quot;State data&amp;quot; output port.&lt;br /&gt;
&lt;br /&gt;
Depending on where the &#039;&#039;SimulinkConnector&#039;&#039; is located in the filter chain, its input signal may have more or fewer elements (samples) than the State Vector (which has as many samples as the source signal). In that case, the two output ports of the BCI2000 block will have different sampling rates. As in the &amp;quot;minimal example&amp;quot; above, you may use a muxer block to combine the two signals into a single one prior to further processing.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[Contributions:BCI2000PresentationLink]], [[Programming Reference:SignalSharingDemo Signal Processing]],&lt;br /&gt;
[[Programming Reference:MatlabFilter]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributions]][[Category:External Interfaces]][[Category:Video]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)&amp;diff=11898</id>
		<title>User Reference:StimulationConfigurationIntegrativeTool (SCIT)</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=User_Reference:StimulationConfigurationIntegrativeTool_(SCIT)&amp;diff=11898"/>
		<updated>2025-05-27T17:09:49Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Matlab tool helps create parameter files for the Blackrock CereStim, the Neuro Omega from Alpha Omega, the g.Estim from g.Tec, and the Cortec Brain Interchange. It also can load parameter files and visualize the configurations. If this tool is desired for another stimulation device, follow this tutorial page: [[Programming Reference:Implementing Stimulator in SCIT]]. &lt;br /&gt;
&lt;br /&gt;
[[Image:CerestimGUIimg.png|500px|right|thumb|frame|An example configuration for the CereStim. ]]&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
* William Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Version History===&lt;br /&gt;
* 2022/05/10: Initial working release R6736. &lt;br /&gt;
* 2022/06/08: Can load existing parameter files and visualize multiple graphs. &lt;br /&gt;
* 2023/03/29: Added gEstim device.&lt;br /&gt;
* 2023/09/26: Major redesign, added Cortec device.&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: 6736&lt;br /&gt;
*Known to compile under: 6785&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Assuming you have already installed BCI2000, navigate to &amp;quot;tools&amp;quot;, then &amp;quot;StimulationConfigurationIntegrativeTool&amp;quot;. This folder will contain the installation file for the Matlab application. Double-clicking this will automatically open Matlab, and install the app in your apps. You can find it under the header &amp;quot;APPS&amp;quot;. Open this app, and you are set.&lt;br /&gt;
&lt;br /&gt;
==General Overview==&lt;br /&gt;
===Loading parameter files===&lt;br /&gt;
Go to the header bar, click on &amp;lt;code&amp;gt;Files&amp;lt;/code&amp;gt;, then &amp;lt;code&amp;gt;Load Parameter File&amp;lt;/code&amp;gt;. This will load the parameters into the tables on the right, allowing you to visualize them.&lt;br /&gt;
===Creating your own parameter files===&lt;br /&gt;
Build your configuration in the left panel and the graphs will update as you go. Once you have the configuration you like, click the &amp;lt;code&amp;gt;Save Configuration to Tables&amp;lt;/code&amp;gt; button to store the configuration in the tables in the right panel. You can do this as many times as you like, until you have all the configurations stored in the tables. Review the configurations by switching your &amp;quot;Experiment Condition&amp;quot; in the top middle box. Finally, click on the &amp;lt;code&amp;gt;Export to parameter file&amp;lt;/code&amp;gt; button on the bottom right. This saved parameter file can directly be imported into BCI2000.&lt;br /&gt;
&lt;br /&gt;
===Visualizing configurations===&lt;br /&gt;
The middle panel contains three graphs, each with a different time scale. The top left, labeled &#039;&#039;Single Pulse&#039;&#039;, shows one single pulse. The top right graph shows the full time range of the stimulation pulses, called a burst. The bottom shows the full stimulation train, which is mainly defined by the parameters &amp;lt;code&amp;gt;Train Duration&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Train Frequency&amp;lt;/code&amp;gt;. You can think of it as increasing the time scale as you go clockwise from the &#039;&#039;Single Pulse&#039;&#039; graph. &lt;br /&gt;
&lt;br /&gt;
These graphs are updated automatically as you change the values in either the Left Panel or the tables. To choose which to visualize, this can be specified in the button group on the top labeled &#039;&#039;Experiment Conditions&#039;&#039;. The name &amp;quot;BUILD CONFIG&amp;quot; correspond to the values in the Left Panel. The legends for the &#039;&#039;Burst of Pulses&#039;&#039; and the &#039;&#039;Complete stimulation train&#039;&#039; specify the number of pulses visualized in the graph. &lt;br /&gt;
===Viewing your parameters===&lt;br /&gt;
The right panel is where you can look at the parameters as they would be in BCI2000. They are split up into two tables: Configurations and Triggers. The Configuration table specifies the shape and duration of the stimulation. The Triggers table correlates to when each configuration is triggered, and to which electrode(s) the configuration goes to. &lt;br /&gt;
&lt;br /&gt;
The parameters are visualized by &amp;quot;Experiment Conditions&amp;quot; to best mimic what will happen in an experiment. If they have the same triggers, the configurations will be visualized together, as they will also be happening at the same time in the experiment.&lt;br /&gt;
&lt;br /&gt;
===Channel Visualization===&lt;br /&gt;
In the bottom middle there is a visualization of the available channels for stimulation. They are color coded to convey the certain configuration that will be stimulated for that channel. If the channel is a square, it means it is a return channel (only for NeuroOmega and Cortec). &lt;br /&gt;
&lt;br /&gt;
The channels can also be interacted with! When visualizing a certain Experiment Condition, click on a channel to add it to that trigger. If there are multiple configurations for that condition, then clicking on it multiple times will cycle through the available options. If it is possible to choose a return channel, these will also be cycled through. If building your configuration, clicking on a certain channel will change the drop-down value that is selected.&lt;br /&gt;
&lt;br /&gt;
===Preferences===&lt;br /&gt;
*&#039;&#039;Auto-increment Trigger Expression&#039;&#039;: If checked, when you add a trigger to the table it auto-increments the number of the expression. This is helpful for quickly adding new columns. If you want the trigger expression to stay constant, uncheck this option. &lt;br /&gt;
*&#039;&#039;Increase font size&#039;&#039;&lt;br /&gt;
*&#039;&#039;Decrease font size&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CereStim==&lt;br /&gt;
[[File:CerestimGUIimg.png|frameless|center|upright=4|Figure 1: An example configuration for the CereStim.]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;Figure 1: An example configuration for the CereStim.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Contributions:CereStim|CereStim Wiki page]] to see the description and limits on each parameter. &lt;br /&gt;
&lt;br /&gt;
==NeuroOmega==&lt;br /&gt;
[[File:NeuroOmegaGUIimg1.png|frameless|center|upright=4|Figure 2: An example configuration for the NeuroOmega.]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;Figure 2: An example configuration for the NeuroOmega.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Contributions:NeuroOmegaADC|Neuro Omega Wiki page]] to see the description and limits on each parameter.&lt;br /&gt;
* The &amp;quot;Recording Channels&amp;quot; section changes the channels listed in the &amp;quot;Channel&amp;quot; dropdown. If you want to use a channel that is not in any of the options, you can manually change it in the table.&lt;br /&gt;
&lt;br /&gt;
==gEstim==&lt;br /&gt;
[[File:gEstimGUIimg.png|frameless|center|upright=4|Figure 3: An example configuration for the gEstim.]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;Figure 3: An example configuration for the gEstim.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[Contributions:gEstimFilter|gEstim Wiki page]] to see the description and limits on each parameter.&lt;br /&gt;
&lt;br /&gt;
==Cortec==&lt;br /&gt;
[[File:CortecGUIimg.png|frameless|center|upright=4|Figure 4: An example configuration for the Cortec Brain Interchange.]]&lt;br /&gt;
&amp;lt;div class=&amp;quot;center&amp;quot;&amp;gt;Figure 4: An example configuration for the Cortec Brain Interchange.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Refer to the [[CortecADC|Cortec Wiki page]] to see the description and limits on each parameter.&lt;br /&gt;
&lt;br /&gt;
==Custom Stimulator==&lt;br /&gt;
&#039;&#039;&#039;See [[Programming Reference:Implementing Stimulator in SCIT]] page to learn how to implement your own stimulator!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[Contributions:NeuroOmegaADC]], [[Contributions:CereStim]], [[Contributions:gEstimFilter]]&lt;br /&gt;
&lt;br /&gt;
[[Category:User Interface]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:Implementing_Stimulator_in_SCIT&amp;diff=11897</id>
		<title>Programming Reference:Implementing Stimulator in SCIT</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Programming_Reference:Implementing_Stimulator_in_SCIT&amp;diff=11897"/>
		<updated>2025-05-27T17:07:04Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Created page with &amp;quot;To implement a new stimulator in SCIT, follow the steps below. To first learn what SCIT is, and how it is used, see the SCIT User Reference page.  Template.m provides boilerplate code to start with =Design= SCIT has adopted an object-oriented implementation, where each stimulator is its own class. These classes all inherit from the AbstractStimulator, which defines all...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To implement a new stimulator in SCIT, follow the steps below. To first learn what SCIT is, and how it is used, see the [[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|SCIT User Reference page]].&lt;br /&gt;
&lt;br /&gt;
[[File:TemplateSCIT.png|right|frame|Template.m provides boilerplate code to start with]]&lt;br /&gt;
=Design=&lt;br /&gt;
SCIT has adopted an object-oriented implementation, where each stimulator is its own class. These classes all inherit from the AbstractStimulator, which defines all the components needed to implement a new stimulator. To create a new stimulator, you will need to create your own file. &amp;lt;code&amp;gt;Template.m&amp;lt;/code&amp;gt; provides the boilerplate code needed for a new stimulator, with comments defining what each function and property does.&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
Below are the steps to create a new stimulator in SCIT. &#039;&#039;Each step must be followed for it to work&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
# Create a new file, named for the stimulator. The easiest is to copy and paste the &amp;lt;code&amp;gt;Template.m&amp;lt;/code&amp;gt; file and rename it (e.g. new name as MyRipple.m). &lt;br /&gt;
# Implement all the required functions and properties. Comments are provided as a starting point, and the other stimulators are great references as examples.&lt;br /&gt;
# Add the file in the &amp;lt;code&amp;gt;SCIT_app.mlapp&amp;lt;/code&amp;gt; in the required spots. This is a bit more tedious, but there are only 4 spots that need to be changed.&lt;br /&gt;
## In the &#039;&#039;Design View&#039;&#039;, select the Neurostimulator Drop Down, go to &#039;&#039;Items&#039;&#039; in the &#039;&#039;Component Browser&#039;&#039;, and add a new option (the name of your stimulator, e.g. Ripple). Everything else will be in the &#039;&#039;Code View&#039;&#039;.&lt;br /&gt;
## In the properties section (line 106), define a variable as the name you just added (e.g., ripple = &amp;quot;Ripple&amp;quot;)&lt;br /&gt;
## In the &amp;lt;code&amp;gt;initializeStimulator&amp;lt;/code&amp;gt; function (line 434), add a new option in the if/else options to define &#039;&#039;app.Stim&#039;&#039;. (e.g. &amp;lt;code&amp;gt;elseif strcmp(value, app.ripple) app.Stim = MyRipple;&amp;lt;/code&amp;gt;).&lt;br /&gt;
## In the &amp;lt;code&amp;gt;LoadParameterFileMenuSelected&amp;lt;/code&amp;gt; function (line 1111), add a new option which defines how we know if the loaded parameter file is this stimulator. (e.g. &amp;lt;code&amp;gt;elseif contains(lineArr(1), &amp;quot;Ripple&amp;quot;) app.NeurostimulatorDropDown.Value = app.ripple; app.Stim = MyRipple;&amp;lt;/code&amp;gt;) &lt;br /&gt;
&lt;br /&gt;
And just like that, the new stimulator is implemented!&lt;br /&gt;
&lt;br /&gt;
=Custom Functionality=&lt;br /&gt;
Some stimulators require custom functions. For example, the NeuroOmega device has different groups of channels, each with their own numbering and number of channels. This requires a custom function to be used, called setNeuroOmegaChannels(app). This is kind of a hack, but AbstractStimulator uses this function, then defines it as empty. This function is then re-defined in the NeuroOmega class. This can simply enable custom functionality for each stimulator. &lt;br /&gt;
&lt;br /&gt;
The property that is harnessed here is &#039;&#039;Inheritance&#039;&#039;. This makes the function handle abstracted from the actual implementation. Make sure you are familiar with this concept when implementing a new stimulator, as it can help you overcome any barriers.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:TemplateSCIT.png&amp;diff=11896</id>
		<title>File:TemplateSCIT.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:TemplateSCIT.png&amp;diff=11896"/>
		<updated>2025-05-27T17:05:22Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Main_Page&amp;diff=11894</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Main_Page&amp;diff=11894"/>
		<updated>2025-05-13T20:23:24Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;10&amp;quot; class=&amp;quot;noprint&amp;quot; style=&amp;quot;float:right; margin-top:-2em;margin-bottom:-2.4em; text-align:right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;border-radius: 4px; background-color:#efefef;padding: 0.4em 1em 0.4em 1em;word-spacing:1em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;form&amp;quot; name=&amp;quot;sitesearch&amp;quot; action=&amp;quot;https://www.google.com/search&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;input&amp;quot; name=&amp;quot;q&amp;quot; type=&amp;quot;text&amp;quot; size=&amp;quot;40&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;input&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;Google site search of bci2000.org&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;input&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;sitesearch&amp;quot; value=&amp;quot;bci2000.org&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;input&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;ie&amp;quot; value=&amp;quot;utf-8&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;htmltag tagname=&amp;quot;input&amp;quot; type=&amp;quot;hidden&amp;quot; name=&amp;quot;oe&amp;quot; value=&amp;quot;utf-8&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/htmltag&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;10&amp;quot; style=&amp;quot;width:100%;margin-top:-10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:-10px; margin-right:10px; background-color:#ededed; padding:0 1em 1em 1em; align:right; border-radius: 10px; vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
=&amp;lt;b&amp;gt;Download BCI2000&amp;lt;/b&amp;gt;=&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:130%&amp;quot;&amp;gt;1. [https://www.bci2000.org/useradmin/ Create a free user account!] (Required to download BCI2000)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;font-size:130%&amp;quot;&amp;gt;2. Download the [https://bci2000.org/downloads/bin/BCI2000Setup.exe latest release], [[BCI2000 Binaries|previous versions]], or the source code ([[Programming Howto:Building and Customizing BCI2000 |Windows]], [[Programming Howto:Non:Building and Customizing BCI2000 on Non-Windows Platforms |Non-windows]])&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt; &lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;10&amp;quot; style=&amp;quot;width:100%;margin-top:-10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt; &amp;lt;td style=&amp;quot;margin:0; margin-right:10px; border-radius: 10px; border:0.5px solid #a2a2a2; padding:0 1em 1em 1em; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
=&amp;lt;b&amp;gt;What is BCI2000?&amp;lt;/b&amp;gt;=&lt;br /&gt;
BCI2000 is an open-source, general-purpose software system for brain-computer interface (BCI) research that is free for non-commercial use.&lt;br /&gt;
BCI2000 includes software tools that can acquire and process data, present stimuli and feedback, and manage interaction with outside devices such as robotic arms. BCI2000 is a real-time system that can synchronize EEG and other signals with a wide variety of biosignals and input devices such as mice or eye-trackers. It has several modules to manage data importing and exporting in common file formats. BCI2000 operates on most Windows systems, and the source code can be compiled on most Windows machines. &lt;br /&gt;
&lt;br /&gt;
[[File:BCI2000 New Schematic Extra Large.gif|center|800px|BCI2000 Schematic]]&lt;br /&gt;
&lt;br /&gt;
Above shows the main framework of BCI2000, with examples for each section. Navigate to the [[User Reference:Filters|Filters page]] to learn more about the framework, or view links below for tutorials and more reference pages.&lt;br /&gt;
&amp;lt;/td&amp;gt; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;10&amp;quot; style=&amp;quot;width:100%;margin-top:-10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px; padding:0 1em 1em 1em; background-color:#fff8dc; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==BCI2000 for Users==&lt;br /&gt;
&lt;br /&gt;
* [//{{SERVERNAME}}/useradmin Create or modify a User Account]&lt;br /&gt;
* [[DownloadBCI2000|Download BCI2000]]&lt;br /&gt;
* [https://bci2000.org/externals/mex/mexfiles.zip Download BCI2000 Matlab MEX files]&lt;br /&gt;
&lt;br /&gt;
* Take the introductory [[User Tutorial:BCI2000 Tour|BCI2000 Tour]]&lt;br /&gt;
* Learn more through an &amp;lt;br /&amp;gt; [[Introduction_to_Adaptive_Neurotechnologies|Introduction to Adaptive Neurotechnologies]]&lt;br /&gt;
* Review the terminology in the [[BCI2000 Glossary]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px; padding:0 1em 1em 1em; background-color:#e3f5fc; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==BCI2000 for Developers==&lt;br /&gt;
* [//{{SERVERNAME}}/useradmin Create or modify a User Account]&lt;br /&gt;
*  Download source code ([[Programming Howto:Building and Customizing BCI2000 |Windows]], [[Programming Howto:Non:Building and Customizing BCI2000 on Non-Windows Platforms |Non-windows]])&lt;br /&gt;
* [[Programming Reference:Patches|Create a patch]] to add your code to the BCI2000 svn!&lt;br /&gt;
* [[APIs|BCI2000 API Documentation]]&lt;br /&gt;
* [[Rebuild BCI2000]] - instructions for rapid prototyping!&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px;  background-color:#e3f5fc; padding:0 1em 1em 1em; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==BCI2000 References==&lt;br /&gt;
===BCI2000 Overview and Tools===&lt;br /&gt;
* The [[User Reference:Contents|User Reference Manual]] describes all details&amp;lt;br /&amp;gt;of system configuration and usage&lt;br /&gt;
===Technical References===&lt;br /&gt;
* The [[Technical Reference:Contents|Technical Reference Manual]] contains a discussion of its &amp;lt;br /&amp;gt;basic concepts, and a detailed specification of the BCI2000 standard.&lt;br /&gt;
===Programming References===&lt;br /&gt;
* The [[Programming Reference:Contents|Programming Reference]] provides background information &amp;lt;br /&amp;gt;which you need in order to understand, modify, or create code that &amp;lt;br /&amp;gt;depends on the BCI2000 framework.&lt;br /&gt;
===Contributions===&lt;br /&gt;
* [[Contributions:Contents|User-Contributed BCI2000 Components and Patches]]&lt;br /&gt;
===Categories===&lt;br /&gt;
*[[:Category:Data Acquisition | Data Acquisition]]&lt;br /&gt;
*[[:Category:Signal Processing | Signal Processing]]&lt;br /&gt;
*[[Contributions:Extensions | Extensions]]&lt;br /&gt;
*[[:Category:User Application | User Application]]&lt;br /&gt;
*[[:Category:External Interfaces | External Interfaces]]&lt;br /&gt;
*[[:Category:User Interface | User Interface]]&lt;br /&gt;
*[[:Category:Video | Video Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px; background-color:#fff8dc; padding:0 1em 1em 1em; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==BCI2000 Tutorials==&lt;br /&gt;
===Setup Tutorials===&lt;br /&gt;
*[[Programming Howto:Install Prerequisites|Install Prerequisites]]&lt;br /&gt;
*[[Programming Howto:Register with BCI2000 Project|Register with the BCI2000 Project]]&lt;br /&gt;
*[[Programming Howto:Download the BCI2000 Sourcecode|Download the BCI2000 Sourcecode]]&lt;br /&gt;
*[[Programming Howto:Configure BCI2000 for Compilation|Configure BCI2000 for Compilation]]&lt;br /&gt;
*[[Programming Howto:Compile BCI2000|Compile BCI2000]]&lt;br /&gt;
===Experimental Tutorials===&lt;br /&gt;
*[[User Tutorial:Mu Rhythm BCI Tutorial|Mu Rhythm BCI Tutorial]]&lt;br /&gt;
*[[User Tutorial:P300 BCI Tutorial|P300 BCI Tutorial]]&lt;br /&gt;
===Programming Tutorials===&lt;br /&gt;
*[[Programming Tutorial:Implementing a Source Module|Implementing a Source Module]]&lt;br /&gt;
*[[Programming Howto:Create a custom Signal Processing Module|Implementing a Signal Processing Module]]&lt;br /&gt;
*[[Programming Tutorial:Implementing a Matlab-based Filter|Implementing a Matlab-based Filter]]&lt;br /&gt;
*[[Programming Tutorial:Implementing an Input Logger|Implementing an Input Logger]]&lt;br /&gt;
===Data Analysis Tutorials===&lt;br /&gt;
*[[User Tutorial:Data Analysis|Data Analysis with BCI2000]]&lt;br /&gt;
* Converting and Analyzing BCI2000 Data with  [[User Reference:Matlab MEX Files|Matlab MEX Files]]&lt;br /&gt;
* Analyze BCI2000 Data in Python with [https://github.com/neurotechcenter/BCI2kReader BCI2k Reader]&lt;br /&gt;
===All Tutorials: See a complete list of [[User Tutorial|BCI2000 tutorials]] here===&lt;br /&gt;
* &lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-right:10px; border-radius: 10px; padding:0 1em 1em 1em; background-color:#fff8dc; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==Supported Frameworks==&lt;br /&gt;
===BCI2000 Core Frameworks===&lt;br /&gt;
* [[User Reference:P3SpellerTask|P3 Speller]]&lt;br /&gt;
* [[User Reference:StimulusPresentationTask|Stimulus Presentation]] &lt;br /&gt;
* [[User Reference:CursorTask|Cursor Task]]&lt;br /&gt;
===[[Supported Frameworks|External Frameworks]]===&lt;br /&gt;
* [[User Tutorial:BCI2000Remote|BCI2000 Remote]] - includes Matlab, C++, and Python &lt;br /&gt;
* [[PsychoPy]]&lt;br /&gt;
* [[BCPy2000]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px; padding:0 1em 1em 1em; background-color:#e3f5fc; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Additional Information==&lt;br /&gt;
* [[System Features|Features supported by BCI2000]]&lt;br /&gt;
* [https://github.com/neurotechcenter NCAN Github]&lt;br /&gt;
* [//{{SERVERNAME}}/phpbb BCI2000 Community Forum]&lt;br /&gt;
* [//{{SERVERNAME}}/tracproj/newticket Submit a Bug Report]  (make sure you log in)&lt;br /&gt;
* [[User FAQ|BCI2000 Frequently Asked Questions]]&lt;br /&gt;
* [[BCI2000 Glossary]]&amp;lt;br /&amp;gt;of terms specific to BCI2000&lt;br /&gt;
* [[BCI2000 Licensing|Licensing Information]]&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellspacing=&amp;quot;10&amp;quot; style=&amp;quot;width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td style=&amp;quot;margin:0; margin-top:10px; margin-right:10px; border-radius: 10px; border:0.5px solid #a2a2a2; padding:0 1em 1em 1em; background-color:white; align:right;vertical-align:top;&amp;quot;&amp;gt;&lt;br /&gt;
==BCI2000 Publications==&lt;br /&gt;
* [https://{{SERVERNAME}}/downloads/doc/paper.pdf G. Schalk, D.J. McFarland, T. Hinterberger, N. Birbaumer, and J.R. Wolpaw: &#039;&#039;BCI2000: A General-Purpose Brain-Computer Interface (BCI) System&#039;&#039;, IEEE Trans Biomed Eng, 51(6), June 2004.]&lt;br /&gt;
* J. Mellinger, G. Schalk: &#039;&#039;BCI2000: A General-Purpose Software Platform for BCI Research,&#039;&#039; In: G. Dornhege, J. del R. Millán, T. Hinterberger, D.J. McFarland, K.-R. Müller (eds.), &#039;&#039;Toward Brain-Computer Interfacing,&#039;&#039; MIT Press, 2007.&lt;br /&gt;
* [http://www.amazon.com/Practical-Guide-BrainComputer-Interfacing-BCI2000/dp/1849960917/ G. Schalk, J. Mellinger: &amp;quot;A Practical Guide to Brain-Computer Interfacing with BCI2000&amp;quot;, Springer, 2010.]&lt;br /&gt;
* J. Mellinger, G. Schalk: &amp;quot;Using BCI2000 in BCI Research,&amp;quot; In: B. Graimann, B. Allison, G. Pfurtscheller (eds.), &amp;quot;Brain-Computer Interfaces: Revolutionizing Human-Computer Interaction&amp;quot;, Springer, 2010.&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11893</id>
		<title>Rebuild BCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11893"/>
		<updated>2025-05-13T20:13:48Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for developers who have [[Programming Howto:Building and Customizing BCI2000|downloaded the prerequisites and have the source code]]. If the follow the previous steps, you will have the full, default version of BCI2000 on your local computer. This maximizes the ease-of-use and flexibility for any custom uses.&lt;br /&gt;
&lt;br /&gt;
However, if you want to include any changes in the BCI2000 infrastructure, &#039;&#039;&#039;you will need to rebuild the appropriate modules in BCI2000&#039;&#039;&#039;. This page will first detail &#039;&#039;how&#039;&#039; to choose what needs to be rebuilt, and then &#039;&#039;what&#039;&#039; steps are needed to rebuild BCI2000 with your changes.&lt;br /&gt;
&lt;br /&gt;
=What needs to be rebuilt?=&lt;br /&gt;
[[File:Modules.png|thumb|BCI2000 design. Each module is an executable.]]&lt;br /&gt;
BCI2000 always runs 4 modules (executables, .exe), as shown here. To run BCI2000, all 4 executables are run. Therefore, to update BCI2000, these executables need to be updated. In fact, only the executable that includes custom changes need to be updated. Therefore, in most cases (e.g., adding a custom filter, module, or extension), &#039;&#039;&#039;only one executable needs to be updated&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
We will first go over the steps to completely rebuild BCI2000, then detail how this process can be streamlined for specific cases.&lt;br /&gt;
&lt;br /&gt;
=Full rebuild=&lt;br /&gt;
Completing a full rebuild is helpful when there have been large changes in the codebase that affect the underlying architecture. However, doing a [[#Specific rebuild|Specific rebuild]] will usually be sufficient.&lt;br /&gt;
#Run &#039;&#039;Configure.sh.cmd&#039;&#039; in the BCI2000 &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory [[File:Use cmake 1.PNG|thumb|Step 1 - Run &#039;&#039;Configure.sh.cmd&#039;&#039;]]&lt;br /&gt;
#Press &amp;lt;code&amp;gt;Generate&amp;lt;/code&amp;gt; (this automatically runs &amp;lt;code&amp;gt;Configure&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;Generate&amp;lt;/code&amp;gt;). This runs CMake to reconfigure the BCI2000 solution. Essentially, it draws all the paths between the files and makes everything ready to compile. [[File:Use cmake 9.PNG|thumb|Step 3 - CMake is reconfigured and generated]]&lt;br /&gt;
#Press the &amp;lt;code&amp;gt;Open Project&amp;lt;/code&amp;gt; button or open &amp;lt;code&amp;gt;BCI2000.sln&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; folder to open it in Visual Studio.&lt;br /&gt;
#In Visual Studio, go to &amp;lt;code&amp;gt;Build → Build Solution&amp;lt;/code&amp;gt;, or right-click &#039;&#039;Solution &#039;BCI2000&#039;&#039;&#039; in the &#039;&#039;Solution Explorer&#039;&#039;. [[File:Use vs2017 3.png|thumb|Step 4 - Build full solution]]&lt;br /&gt;
&#039;&#039;Final Result&#039;&#039;: Every executable in the &amp;lt;code&amp;gt;prog&amp;lt;/code&amp;gt; folder has been updated!&lt;br /&gt;
&lt;br /&gt;
=Specific rebuild=&lt;br /&gt;
Depending on what changes are made, we can limit the previous steps to the essentials. &lt;br /&gt;
# &#039;&#039;&#039;Editing a module&#039;&#039;&#039;: Simply find the existing module in the &#039;&#039;Solution Explorer&#039;&#039; in Visual Studio, right-click on it and press &amp;lt;code&amp;gt;Build&amp;lt;/code&amp;gt;.&lt;br /&gt;
#&#039;&#039;&#039;Creating a module&#039;&#039;&#039;: Reconfigure CMake (Step 1 of previous list), then build the new module (Step 1 of this list)&lt;br /&gt;
#&#039;&#039;&#039;Editing an extension&#039;&#039;&#039;&lt;br /&gt;
## Determine what type of extension it is. The possible options are Source, Processing, or Application.&lt;br /&gt;
## Build the module of the appropriate type used in your batch file (Step 1 of this list)&lt;br /&gt;
#* Example: I have modified the [[Contributions:XsensMTwLogger|XsensMTwLogger]]. Since it is acquiring data, it is a Source Extension, also called a Logger. I am testing out my implementation, so I want to use SignalGenerator for dummy signals. I will build SignalGenerator (under &amp;lt;code&amp;gt;Core → SignalSource&amp;lt;/code&amp;gt;), and my modified extension will be included when I run my &amp;lt;code&amp;gt;CursorTask_SignalGenerator.bat&amp;lt;/code&amp;gt; batch file. When I want to record data from an amplifier, I will need to build that Source Module to update it with my modified extension.&lt;br /&gt;
# &#039;&#039;&#039;Creating an extension&#039;&#039;&#039;&lt;br /&gt;
## Open CMake (&amp;lt;code&amp;gt;Configure.sh.cmd&amp;lt;/code&amp;gt;) and press &amp;lt;code&amp;gt;Configure&amp;lt;/code&amp;gt;.&lt;br /&gt;
## You will see a new option to enable your extension. Check the box to enable.&lt;br /&gt;
## Generate CMake (Step 2 of previous list), then build the appropriate module (Step 3 of this list)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Final Result&#039;&#039;: Only &#039;&#039;&#039;one&#039;&#039;&#039; executable in the &amp;lt;code&amp;gt;prog&amp;lt;/code&amp;gt; folder has been updated!&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11892</id>
		<title>Rebuild BCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11892"/>
		<updated>2025-05-13T18:59:18Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for developers who have [[Programming Howto:Building and Customizing BCI2000|downloaded the prerequisites and have the source code]]. If the follow the previous steps, you will have the full, default version of BCI2000 on your local computer. This maximizes the ease-of-use and flexibility for any custom uses.&lt;br /&gt;
&lt;br /&gt;
However, if you want to include any changes in the BCI2000 infrastructure, &#039;&#039;&#039;you will need to rebuild the appropriate modules in BCI2000&#039;&#039;&#039;. This page will first detail &#039;&#039;how&#039;&#039; to choose what needs to be rebuilt, and then &#039;&#039;what&#039;&#039; steps are needed to rebuild BCI2000 with your changes.&lt;br /&gt;
&lt;br /&gt;
=What needs to be rebuilt?=&lt;br /&gt;
[[File:Modules.png|thumb|BCI2000 design. Each module is an executable.]]&lt;br /&gt;
BCI2000 always runs 4 modules (executables, .exe), as shown here. To run BCI2000, all 4 executables are run. Therefore, to update BCI2000, these executables need to be updated. In fact, only the executable that includes custom changes need to be updated. Therefore, in most cases (e.g., adding a custom filter, module, or extension), &#039;&#039;&#039;only one executable needs to be updated&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
We will first go over the steps to completely rebuild BCI2000, then detail how this process can be streamlined for specific cases.&lt;br /&gt;
&lt;br /&gt;
=Full rebuild=&lt;br /&gt;
#Run &#039;&#039;Configure.sh.cmd&#039;&#039; in the BCI2000 &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory [[File:Use cmake 1.PNG|thumb|Step 1 - Run &#039;&#039;Configure.sh.cmd&#039;&#039;]]&lt;br /&gt;
#Press &amp;lt;code&amp;gt;Generate&amp;lt;/code&amp;gt; (this automatically runs &amp;lt;code&amp;gt;Configure&amp;lt;/code&amp;gt; then &amp;lt;code&amp;gt;Generate&amp;lt;/code&amp;gt;). This runs CMake to reconfigure the BCI2000 solution. Essentially, it draws all the paths between the files and makes everything ready to compile. [[File:Use cmake 9.PNG|thumb|Step 3 - CMake is reconfigured and generated]]&lt;br /&gt;
#Press the &amp;lt;code&amp;gt;Open Project&amp;lt;/code&amp;gt; button or open &amp;lt;code&amp;gt;BCI2000.sln&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; folder to open it in Visual Studio.&lt;br /&gt;
#In Visual Studio, go to &amp;lt;code&amp;gt;Build → Build Solution&amp;lt;/code&amp;gt;, or right-click &#039;&#039;Solution &#039;BCI2000&#039;&#039;&#039; in the &#039;&#039;Solution Explorer&#039;&#039;. [[File:Use vs2017 3.png|thumb|Step 4 - Build full solution]]&lt;br /&gt;
&#039;&#039;Final Result&#039;&#039;: Every executable in the &amp;lt;code&amp;gt;prog&amp;lt;/code&amp;gt; folder has been updated!&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11891</id>
		<title>Rebuild BCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Rebuild_BCI2000&amp;diff=11891"/>
		<updated>2025-05-13T16:46:32Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Created page with &amp;quot;This tutorial is for developers who have downloaded the prerequisites and have the source code. If the follow the previous steps, you will have the full, default version of BCI2000 on your local computer. This maximizes the ease-of-use and flexibility for any custom uses.  However, if you want to include any changes in the BCI2000 infrastructure, &amp;#039;&amp;#039;&amp;#039;you will need to rebuild the appropriate modules in BCI2000&amp;#039;&amp;#039;&amp;#039;. This...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial is for developers who have [[Programming Howto:Building and Customizing BCI2000|downloaded the prerequisites and have the source code]]. If the follow the previous steps, you will have the full, default version of BCI2000 on your local computer. This maximizes the ease-of-use and flexibility for any custom uses.&lt;br /&gt;
&lt;br /&gt;
However, if you want to include any changes in the BCI2000 infrastructure, &#039;&#039;&#039;you will need to rebuild the appropriate modules in BCI2000&#039;&#039;&#039;. This page will first detail &#039;&#039;how&#039;&#039; to choose what needs to be rebuilt, and then &#039;&#039;what&#039;&#039; steps are needed to rebuild BCI2000 with your changes.&lt;br /&gt;
&lt;br /&gt;
=What needs to be rebuilt?=&lt;br /&gt;
[[File:Modules.png|thumb|BCI2000 design. Each module is an executable.]]&lt;br /&gt;
BCI2000 always runs 4 modules (executables, .exe), as shown here. To run BCI2000, all 4 executables are run. Therefore, to update BCI2000, these executables need to be updated. In fact, only the executable that includes custom changes need to be updated. Therefore, in most cases (e.g., adding a custom filter, module, or extension), &#039;&#039;&#039;only one executable needs to be updated&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
We will first go over the steps to completely rebuild BCI2000, then detail how this process can be streamlined for specific cases.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:GEstimGUIimg.png&amp;diff=11861</id>
		<title>File:GEstimGUIimg.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:GEstimGUIimg.png&amp;diff=11861"/>
		<updated>2025-05-08T13:56:59Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Wengelhardt uploaded a new version of File:GEstimGUIimg.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11860</id>
		<title>Contributions:gEstimFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11860"/>
		<updated>2025-05-07T23:36:44Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:gEstim_PRO.jpg|400px|thumb|right|g.tec g.Estim PRO cortical stimulator]]&lt;br /&gt;
This filter allows for cortical stimulation with the g.tec gEstim PRO. This extension resides in the Application module and allows for electrical stimulation.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
Kristopher Kaleb Goering (kaleb.goering@gmail.com)&lt;br /&gt;
&lt;br /&gt;
Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: --&lt;br /&gt;
*Tested under: 6191&lt;br /&gt;
*Known to compile under: 6191&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Installation / Versions==&lt;br /&gt;
The gEstimPro drivers must be installed. Contact gTec to obtain access.&lt;br /&gt;
&lt;br /&gt;
The gEstim has 2 modes that can be used in BCI2000: basic and advanced. These are set by the parameter [[#DeviceMode|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.&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;text-align: left;&amp;quot;&lt;br /&gt;
! Feature !! Minimum Firmware&lt;br /&gt;
|-&lt;br /&gt;
|Supermode&lt;br /&gt;
|1.23&lt;br /&gt;
|-&lt;br /&gt;
|Asymmetric (Lilly) pulses&lt;br /&gt;
|1.7&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;Sentinel HASP Key&#039;&#039;&#039; should appear under Universal Serial Bus controllers.&lt;br /&gt;
&lt;br /&gt;
==Integration into BCI2000==&lt;br /&gt;
This extension resides in the private directory of BCI2000. It must be enabled in CMake by selecting &amp;lt;code&amp;gt;BUILD_GESTIMFILTER&amp;lt;/code&amp;gt;. Then recompile the &amp;lt;code&amp;gt;BCI2000FrameworkAppModule&amp;lt;/code&amp;gt;, and the application module you are using. Lastly, append the enable flag to your batch file (ex: &amp;lt;code&amp;gt;Start executable StimulusPresentation --local --ActivateEstim=1&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
The gEstim device is configured in the gEstim tab.  The configurable parameters are:&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Set-up Preferences&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:GEstimCheckmarkOptions.png|frame|right|upright=3|The on/off or enumeration options for gEstim]]&lt;br /&gt;
&lt;br /&gt;
====ActivateEstim====&lt;br /&gt;
Enables/disables device.&lt;br /&gt;
&lt;br /&gt;
====UseStimulusPresentation====&lt;br /&gt;
[[File:Estim_with_StimulusPresentation.png|600px|thumb|center|upright=2.5|Figure 1: Adding an additional row labeled &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; to stimuli to trigger stimulation]]&lt;br /&gt;
This 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&#039;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 &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt;. Now, stimulation will be triggered on all stimuli defined in this matrix has its &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Stimulation will not occur on stimuli that have this row set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====DeviceMode====&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
====UseMultipleConfigurations====&lt;br /&gt;
Enables the use of StimulationConfigurations table. This allows for multiple stimulation configurations during a run. Whenever stimulation is triggered through the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row or through &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt;, it will trigger the most recently uploaded configuration.&lt;br /&gt;
&lt;br /&gt;
Only some gEstim devices, with an updated firmware, can quickly change stimulation configurations with the use of SUPERMODE. If you enabled &#039;&#039;UseMultipleConfigurations&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
[[File:Dynamic_gEstim.png|frame|An example of using DynamicStimulation, where the States will specify the stimulation settings.]]&lt;br /&gt;
====DynamicStimulation====&lt;br /&gt;
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&#039;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.&lt;br /&gt;
&lt;br /&gt;
====DoSelfTest====&lt;br /&gt;
Enables user to disable the Self-test. g.Tec recommends performing the self-test before every use in case the device is faulty.&lt;br /&gt;
&lt;br /&gt;
====QuietStimulation====&lt;br /&gt;
Enable to silent the stimulation. &lt;br /&gt;
&lt;br /&gt;
====EnableExternalTrigger====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Stimulation Parameters&amp;lt;/u&amp;gt;===&lt;br /&gt;
====StimulationConfigurations====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; heights=400&amp;gt;&lt;br /&gt;
File:GEstimConfigTable.png|Option 1: a default StimulationConfigurations table&lt;br /&gt;
File:GEstimConfigTableLillyPulses.png|Option 2: to use asymmetric pulses, have this configuration&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Table that allows for multiple configurations. The parameters in the table are the same as below. The first row, &amp;lt;code&amp;gt;Expression&amp;lt;/code&amp;gt;, can either correlate to uploading the stimulation or uploading &#039;&#039;and&#039;&#039; starting the stimulation. &#039;&#039;&#039;To start immediately after upload, leave &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; empty and turn &amp;lt;code&amp;gt;UseStimulusPresentation&amp;lt;/code&amp;gt; off&#039;&#039;&#039;. Otherwise, &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row will start the stimulation that was uploaded. The &amp;lt;code&amp;gt;AbortExpression&amp;lt;/code&amp;gt; will still abort any active stimulation.&lt;br /&gt;
&lt;br /&gt;
====StimulationExpression====&lt;br /&gt;
Expression to start g.Estim stimulation. See the [[User_Reference:Expression_Syntax|expression]] page for more details on how to define an expression. &lt;br /&gt;
====AbortExpression====&lt;br /&gt;
Expression to abort g.Estim stimulation.&lt;br /&gt;
====Modularity====&lt;br /&gt;
[[File:gEstim_pulse_parameters.png|600px|thumb|right|upright=2.5|Configurable parameters of stimulation profile]]&lt;br /&gt;
Modularity of pulses; Biphasic or Monophasic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be biphasic when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====Polarity====&lt;br /&gt;
Polarity of pulses; Alternating or Steady&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be steady when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====PhaseDuration====&lt;br /&gt;
Duration of time of each +/- phase.&lt;br /&gt;
====InterphaseDuration====&lt;br /&gt;
Duration of time with no stimulation between each pulse&#039;s phases.&lt;br /&gt;
====Magnitude====&lt;br /&gt;
Magnitude of the pulse in milliamps. This quantity is peak-to-zero. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Both magnitudes must be greater than 0&#039;&#039; when specifying asymmetric pulses. The 2nd pulse will automatically be negative.&lt;br /&gt;
====NumberOfPulses====&lt;br /&gt;
Number of pulses per train.&lt;br /&gt;
====PulseFrequency====&lt;br /&gt;
Frequency of each pulse in a train. Note that the &#039;&#039;PhaseDuration&#039;&#039; and &#039;&#039;InterphaseDuration&#039;&#039; impose a limit on the &#039;&#039;PulseFrequency&#039;&#039;. Make sure this parameter adheres to this limitation. &lt;br /&gt;
====NumberOfTrains====&lt;br /&gt;
Number of trains.&lt;br /&gt;
====FrequencyOfTrains====&lt;br /&gt;
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 &#039;&#039;FrequencyOfTrains&#039;&#039; adheres to this restriction. &lt;br /&gt;
====Jitter====&lt;br /&gt;
Jitter of trains between 0 and 100% in increments of 1%&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Electrode Settings&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
[[File:GEstimElectrodeParameters.png|frame|Parameters for electrode type]]&lt;br /&gt;
====ElectrodeType====&lt;br /&gt;
Type of electrode being used: 1 Circle, 2 Depth, 3 Other.&lt;br /&gt;
====CircleDiameter====&lt;br /&gt;
For circle electrode type. Exposed diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactDiameter====&lt;br /&gt;
For depth electrode type. Contact diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactLength====&lt;br /&gt;
For depth electrode type. Contact length of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ExposedSurfaceArea====&lt;br /&gt;
For other electrode type. Exposed surface area of electrode in square micrometers between in increments of 1&amp;amp;mu;m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
===EstimStimulus===&lt;br /&gt;
This binary state is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when a stimulation train is running and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; otherwise.s&lt;br /&gt;
&lt;br /&gt;
===EstimCurrent===&lt;br /&gt;
Applied current in µA, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimVoltage===&lt;br /&gt;
Applied voltage in mV, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimImpedance===&lt;br /&gt;
Impedance of tissue in Ω in 16 bit state. Calculated using &amp;lt;code&amp;gt;EstimCurrent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EstimVoltage&amp;lt;/code&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|SCIT]]==&lt;br /&gt;
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 [[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:gEstimGUIimg.png|Figure 3: The gEstim GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tool currently does not have the new &amp;lt;code&amp;gt;StimulationConfigurations&amp;lt;/code&amp;gt; parameter, so it only allows for one configuration to be exported.&lt;br /&gt;
&lt;br /&gt;
==Latency==&lt;br /&gt;
[[File:gEstim_latency.png|400px|thumb|center|upright=2.5|Latency of stimulation]]&lt;br /&gt;
The above figure details the latency between positive evaluation of the &#039;&#039;StimulationExpression&#039;&#039; and pulse delivery.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:GEstimConfigTableLillyPulses.png&amp;diff=11859</id>
		<title>File:GEstimConfigTableLillyPulses.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:GEstimConfigTableLillyPulses.png&amp;diff=11859"/>
		<updated>2025-05-06T21:26:04Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Wengelhardt uploaded a new version of File:GEstimConfigTableLillyPulses.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11858</id>
		<title>Contributions:gEstimFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11858"/>
		<updated>2025-05-06T21:23:50Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:gEstim_PRO.jpg|400px|thumb|right|g.tec g.Estim PRO cortical stimulator]]&lt;br /&gt;
This filter allows for cortical stimulation with the g.tec gEstim PRO.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
Kristopher Kaleb Goering (kaleb.goering@gmail.com)&lt;br /&gt;
&lt;br /&gt;
Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: --&lt;br /&gt;
*Tested under: 6191&lt;br /&gt;
*Known to compile under: 6191&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
This extension resides in the Application module and allows for electrical stimulation.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
The gEstimPro drivers must be installed. Contact gTec to obtain access.&lt;br /&gt;
&lt;br /&gt;
==Integration into BCI2000==&lt;br /&gt;
This extension resides in the private directory of BCI2000. It must be enabled in CMake by selecting &amp;lt;code&amp;gt;BUILD_GESTIMFILTER&amp;lt;/code&amp;gt;. Then recompile the &amp;lt;code&amp;gt;BCI2000FrameworkAppModule&amp;lt;/code&amp;gt;, and the application module you are using. Lastly, append the enable flag to your batch file (ex: &amp;lt;code&amp;gt;Start executable StimulusPresentation --local --ActivateEstim=1&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
The gEstim device is configured in the gEstim tab.  The configurable parameters are:&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Set-up Preferences&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:GEstimCheckmarkOptions.png|frame|right|upright=3|The on/off or enumeration options for gEstim]]&lt;br /&gt;
&lt;br /&gt;
====ActivateEstim====&lt;br /&gt;
Enables/disables device.&lt;br /&gt;
&lt;br /&gt;
====UseStimulusPresentation====&lt;br /&gt;
[[File:Estim_with_StimulusPresentation.png|600px|thumb|center|upright=2.5|Figure 1: Adding an additional row labeled &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; to stimuli to trigger stimulation]]&lt;br /&gt;
This 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&#039;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 &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt;. Now, stimulation will be triggered on all stimuli defined in this matrix has its &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Stimulation will not occur on stimuli that have this row set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====DeviceMode====&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
====UseMultipleConfigurations====&lt;br /&gt;
Enables the use of StimulationConfigurations table. This allows for multiple stimulation configurations during a run. Whenever stimulation is triggered through the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row or through &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt;, it will trigger the most recently uploaded configuration.&lt;br /&gt;
&lt;br /&gt;
Only some gEstim devices, with an updated firmware, can quickly change stimulation configurations with the use of SUPERMODE. If you enabled &#039;&#039;UseMultipleConfigurations&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
[[File:Dynamic_gEstim.png|frame|An example of using DynamicStimulation, where the States will specify the stimulation settings.]]&lt;br /&gt;
====DynamicStimulation====&lt;br /&gt;
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&#039;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.&lt;br /&gt;
&lt;br /&gt;
====DoSelfTest====&lt;br /&gt;
Enables user to disable the Self-test. g.Tec recommends performing the self-test before every use in case the device is faulty.&lt;br /&gt;
&lt;br /&gt;
====QuietStimulation====&lt;br /&gt;
Enable to silent the stimulation. &lt;br /&gt;
&lt;br /&gt;
====EnableExternalTrigger====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Stimulation Parameters&amp;lt;/u&amp;gt;===&lt;br /&gt;
====StimulationConfigurations====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; heights=400&amp;gt;&lt;br /&gt;
File:GEstimConfigTable.png|Option 1: a default StimulationConfigurations table&lt;br /&gt;
File:GEstimConfigTableLillyPulses.png|Option 2: to use asymmetric pulses, have this configuration&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Table that allows for multiple configurations. The parameters in the table are the same as below. The first row, &amp;lt;code&amp;gt;Expression&amp;lt;/code&amp;gt;, can either correlate to uploading the stimulation or uploading &#039;&#039;and&#039;&#039; starting the stimulation. &#039;&#039;&#039;To start immediately after upload, leave &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; empty and turn &amp;lt;code&amp;gt;UseStimulusPresentation&amp;lt;/code&amp;gt; off&#039;&#039;&#039;. Otherwise, &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row will start the stimulation that was uploaded. The &amp;lt;code&amp;gt;AbortExpression&amp;lt;/code&amp;gt; will still abort any active stimulation.&lt;br /&gt;
&lt;br /&gt;
====StimulationExpression====&lt;br /&gt;
Expression to start g.Estim stimulation. See the [[User_Reference:Expression_Syntax|expression]] page for more details on how to define an expression. &lt;br /&gt;
====AbortExpression====&lt;br /&gt;
Expression to abort g.Estim stimulation.&lt;br /&gt;
====Modularity====&lt;br /&gt;
[[File:gEstim_pulse_parameters.png|600px|thumb|right|upright=2.5|Configurable parameters of stimulation profile]]&lt;br /&gt;
Modularity of pulses; Biphasic or Monophasic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be biphasic when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====Polarity====&lt;br /&gt;
Polarity of pulses; Alternating or Steady&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be steady when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====PhaseDuration====&lt;br /&gt;
Duration of time of each +/- phase.&lt;br /&gt;
====InterphaseDuration====&lt;br /&gt;
Duration of time with no stimulation between each pulse&#039;s phases.&lt;br /&gt;
====Magnitude====&lt;br /&gt;
Magnitude of the pulse in milliamps. This quantity is peak-to-zero. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Both magnitudes must be greater than 0&#039;&#039; when specifying asymmetric pulses. The 2nd pulse will automatically be negative.&lt;br /&gt;
====NumberOfPulses====&lt;br /&gt;
Number of pulses per train.&lt;br /&gt;
====PulseFrequency====&lt;br /&gt;
Frequency of each pulse in a train. Note that the &#039;&#039;PhaseDuration&#039;&#039; and &#039;&#039;InterphaseDuration&#039;&#039; impose a limit on the &#039;&#039;PulseFrequency&#039;&#039;. Make sure this parameter adheres to this limitation. &lt;br /&gt;
====NumberOfTrains====&lt;br /&gt;
Number of trains.&lt;br /&gt;
====FrequencyOfTrains====&lt;br /&gt;
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 &#039;&#039;FrequencyOfTrains&#039;&#039; adheres to this restriction. &lt;br /&gt;
====Jitter====&lt;br /&gt;
Jitter of trains between 0 and 100% in increments of 1%&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Electrode Settings&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
[[File:GEstimElectrodeParameters.png|frame|Parameters for electrode type]]&lt;br /&gt;
====ElectrodeType====&lt;br /&gt;
Type of electrode being used: 1 Circle, 2 Depth, 3 Other.&lt;br /&gt;
====CircleDiameter====&lt;br /&gt;
For circle electrode type. Exposed diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactDiameter====&lt;br /&gt;
For depth electrode type. Contact diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactLength====&lt;br /&gt;
For depth electrode type. Contact length of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ExposedSurfaceArea====&lt;br /&gt;
For other electrode type. Exposed surface area of electrode in square micrometers between in increments of 1&amp;amp;mu;m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
===EstimStimulus===&lt;br /&gt;
This binary state is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when a stimulation train is running and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; otherwise.s&lt;br /&gt;
&lt;br /&gt;
===EstimCurrent===&lt;br /&gt;
Applied current in µA, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimVoltage===&lt;br /&gt;
Applied voltage in mV, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimImpedance===&lt;br /&gt;
Impedance of tissue in Ω in 16 bit state. Calculated using &amp;lt;code&amp;gt;EstimCurrent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EstimVoltage&amp;lt;/code&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|SCIT]]==&lt;br /&gt;
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 [[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:gEstimGUIimg.png|Figure 3: The gEstim GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tool currently does not have the new &amp;lt;code&amp;gt;StimulationConfigurations&amp;lt;/code&amp;gt; parameter, so it only allows for one configuration to be exported.&lt;br /&gt;
&lt;br /&gt;
==Latency==&lt;br /&gt;
[[File:gEstim_latency.png|400px|thumb|center|upright=2.5|Latency of stimulation]]&lt;br /&gt;
The above figure details the latency between positive evaluation of the &#039;&#039;StimulationExpression&#039;&#039; and pulse delivery.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11857</id>
		<title>Contributions:gEstimFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11857"/>
		<updated>2025-05-06T21:07:34Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:gEstim_PRO.jpg|400px|thumb|right|g.tec g.Estim PRO cortical stimulator]]&lt;br /&gt;
This filter allows for cortical stimulation with the g.tec gEstim PRO.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
Kristopher Kaleb Goering (kaleb.goering@gmail.com)&lt;br /&gt;
&lt;br /&gt;
Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
Will Engelhardt (engelhardt@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: --&lt;br /&gt;
*Tested under: 6191&lt;br /&gt;
*Known to compile under: 6191&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
This extension resides in the Application module and allows for electrical stimulation.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
The gEstimPro drivers must be installed. Contact gTec to obtain access.&lt;br /&gt;
&lt;br /&gt;
==Integration into BCI2000==&lt;br /&gt;
This extension resides in the private directory of BCI2000. It must be enabled in CMake by selecting &amp;lt;code&amp;gt;BUILD_GESTIMFILTER&amp;lt;/code&amp;gt;. Then recompile the &amp;lt;code&amp;gt;BCI2000FrameworkAppModule&amp;lt;/code&amp;gt;, and the application module you are using. Lastly, append the enable flag to your batch file (ex: &amp;lt;code&amp;gt;Start executable StimulusPresentation --local --ActivateEstim=1&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
The gEstim device is configured in the gEstim tab.  The configurable parameters are:&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Set-up Preferences&amp;lt;/u&amp;gt;===&lt;br /&gt;
[[File:GEstimCheckmarkOptions.png|frame|right|upright=3|The on/off or enumeration options for gEstim]]&lt;br /&gt;
&lt;br /&gt;
====ActivateEstim====&lt;br /&gt;
Enables/disables device.&lt;br /&gt;
&lt;br /&gt;
====UseStimulusPresentation====&lt;br /&gt;
[[File:Estim_with_StimulusPresentation.png|600px|thumb|center|upright=2.5|Figure 1: Adding an additional row labeled &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; to stimuli to trigger stimulation]]&lt;br /&gt;
This 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&#039;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 &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt;. Now, stimulation will be triggered on all stimuli defined in this matrix has its &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Stimulation will not occur on stimuli that have this row set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====DeviceMode====&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
====UseMultipleConfigurations====&lt;br /&gt;
Enables the use of StimulationConfigurations table. This allows for multiple stimulation configurations during a run. Whenever stimulation is triggered through the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row or through &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt;, it will trigger the most recently uploaded configuration.&lt;br /&gt;
&lt;br /&gt;
Only some gEstim devices, with an updated firmware, can quickly change stimulation configurations with the use of SUPERMODE. If you enabled &#039;&#039;UseMultipleConfigurations&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
[[File:Dynamic_gEstim.png|frame]]&lt;br /&gt;
====DynamicStimulation====&lt;br /&gt;
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&#039;t be known until the moment of stimulation. Use with caution.&lt;br /&gt;
&lt;br /&gt;
====DoSelfTest====&lt;br /&gt;
Enables user to disable the Self-test. g.Tec recommends performing the self-test before every use in case the device is faulty.&lt;br /&gt;
&lt;br /&gt;
====QuietStimulation====&lt;br /&gt;
Enable to silent the stimulation. &lt;br /&gt;
&lt;br /&gt;
====EnableExternalTrigger====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Stimulation Parameters&amp;lt;/u&amp;gt;===&lt;br /&gt;
====StimulationConfigurations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; heights=400&amp;gt;&lt;br /&gt;
File:GEstimConfigTable.png|Option 1: a default StimulationConfigurations table&lt;br /&gt;
File:GEstimConfigTableLillyPulses.png|Option 2: to use asymmetric pulses, have this configuration&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Table that allows for multiple configurations. The parameters in the table are the same as below. The first row, &amp;lt;code&amp;gt;Expression&amp;lt;/code&amp;gt;, can either correlate to uploading the stimulation or uploading &#039;&#039;and&#039;&#039; starting the stimulation. &#039;&#039;&#039;To start immediately after upload, leave &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; empty and turn &amp;lt;code&amp;gt;UseStimulusPresentation&amp;lt;/code&amp;gt; off&#039;&#039;&#039;. Otherwise, &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row will start the stimulation that was uploaded. The &amp;lt;code&amp;gt;AbortExpression&amp;lt;/code&amp;gt; will still abort any active stimulation.&lt;br /&gt;
&lt;br /&gt;
====StimulationExpression====&lt;br /&gt;
Expression to start g.Estim stimulation. See the [[User_Reference:Expression_Syntax|expression]] page for more details on how to define an expression. &lt;br /&gt;
====AbortExpression====&lt;br /&gt;
Expression to abort g.Estim stimulation.&lt;br /&gt;
====Modularity====&lt;br /&gt;
[[File:gEstim_pulse_parameters.png|600px|thumb|right|upright=2.5|Configurable parameters of stimulation profile]]&lt;br /&gt;
Modularity of pulses; Biphasic or Monophasic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be biphasic when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====Polarity====&lt;br /&gt;
Polarity of pulses; Alternating or Steady&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Must be steady when specifying asymmetric pulses.&#039;&#039;&lt;br /&gt;
====PhaseDuration====&lt;br /&gt;
Duration of time of each +/- phase.&lt;br /&gt;
====InterphaseDuration====&lt;br /&gt;
Duration of time with no stimulation between each pulse&#039;s phases.&lt;br /&gt;
====Magnitude====&lt;br /&gt;
Magnitude of the pulse in milliamps. This quantity is peak-to-zero. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Both magnitudes must be greater than 0&#039;&#039; when specifying asymmetric pulses. The 2nd pulse will automatically be negative.&lt;br /&gt;
====NumberOfPulses====&lt;br /&gt;
Number of pulses per train.&lt;br /&gt;
====PulseFrequency====&lt;br /&gt;
Frequency of each pulse in a train. Note that the &#039;&#039;PhaseDuration&#039;&#039; and &#039;&#039;InterphaseDuration&#039;&#039; impose a limit on the &#039;&#039;PulseFrequency&#039;&#039;. Make sure this parameter adheres to this limitation. &lt;br /&gt;
====NumberOfTrains====&lt;br /&gt;
Number of trains.&lt;br /&gt;
====FrequencyOfTrains====&lt;br /&gt;
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 &#039;&#039;FrequencyOfTrains&#039;&#039; adheres to this restriction. &lt;br /&gt;
====Jitter====&lt;br /&gt;
Jitter of trains between 0 and 100% in increments of 1%&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Electrode Settings&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
[[File:GEstimElectrodeParameters.png|frame|Parameters for electrode type]]&lt;br /&gt;
====ElectrodeType====&lt;br /&gt;
Type of electrode being used: 1 Circle, 2 Depth, 3 Other.&lt;br /&gt;
====CircleDiameter====&lt;br /&gt;
For circle electrode type. Exposed diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactDiameter====&lt;br /&gt;
For depth electrode type. Contact diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactLength====&lt;br /&gt;
For depth electrode type. Contact length of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ExposedSurfaceArea====&lt;br /&gt;
For other electrode type. Exposed surface area of electrode in square micrometers between in increments of 1&amp;amp;mu;m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
===EstimStimulus===&lt;br /&gt;
This binary state is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when a stimulation train is running and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; otherwise.s&lt;br /&gt;
&lt;br /&gt;
===EstimCurrent===&lt;br /&gt;
Applied current in µA, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimVoltage===&lt;br /&gt;
Applied voltage in mV, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimImpedance===&lt;br /&gt;
Impedance of tissue in Ω in 16 bit state. Calculated using &amp;lt;code&amp;gt;EstimCurrent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EstimVoltage&amp;lt;/code&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|SCIT]]==&lt;br /&gt;
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 [[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:gEstimGUIimg.png|Figure 3: The gEstim GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tool currently does not have the new &amp;lt;code&amp;gt;StimulationConfigurations&amp;lt;/code&amp;gt; parameter, so it only allows for one configuration to be exported.&lt;br /&gt;
&lt;br /&gt;
==Latency==&lt;br /&gt;
[[File:gEstim_latency.png|400px|thumb|center|upright=2.5|Latency of stimulation]]&lt;br /&gt;
The above figure details the latency between positive evaluation of the &#039;&#039;StimulationExpression&#039;&#039; and pulse delivery.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:Dynamic_gEstim.png&amp;diff=11856</id>
		<title>File:Dynamic gEstim.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:Dynamic_gEstim.png&amp;diff=11856"/>
		<updated>2025-05-06T20:51:21Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:GEstimConfigTableLillyPulses.png&amp;diff=11851</id>
		<title>File:GEstimConfigTableLillyPulses.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:GEstimConfigTableLillyPulses.png&amp;diff=11851"/>
		<updated>2025-05-06T20:26:03Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Wengelhardt uploaded a new version of File:GEstimConfigTableLillyPulses.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:GEstimCheckmarkOptions.png&amp;diff=11850</id>
		<title>File:GEstimCheckmarkOptions.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:GEstimCheckmarkOptions.png&amp;diff=11850"/>
		<updated>2025-05-06T19:55:28Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Wengelhardt uploaded a new version of File:GEstimCheckmarkOptions.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11848</id>
		<title>VisualizeBCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11848"/>
		<updated>2025-04-29T18:45:05Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:CCEP gif.gif |900px|right|thumb|frame| An example video showing the CCEP filter with VisualizeBCI2000.]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
A Python toolkit to powerfully visualize BCI2000 data in real-time. The incoming data can be pre-processed in BCI2000&#039;s pipeline, or not, then sent to python through BCI2000&#039;s [[User Reference:SignalSharing|SignalSharing]] feature. The data can also be visualized in 3D if combined with a [https://github.com/neurotechcenter/VERA VERA structure (electrode localization tool)]. It is designed based on BCI2000&#039;s standard of modularity, therefore any of these components can be swapped out without changing the rest of the pipeline.&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&#039;&#039;&#039;[https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000 can be downloaded from GitHub here]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Python 3.8+ needs to be installed. [https://www.python.org/downloads/| You can download the lastest version here].&lt;br /&gt;
#A couple additional packages are used in this visualization. Run the following segments using &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; in the command line.&lt;br /&gt;
#*Numpy: &amp;lt;code&amp;gt;pip install numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQt5: &amp;lt;code&amp;gt;pip install PyQt5&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQtGraph 0.13.3+: &amp;lt;code&amp;gt;pip install pyqtgraph&amp;lt;/code&amp;gt;&lt;br /&gt;
#*SciPy: &amp;lt;code&amp;gt;pip install scipy&amp;lt;/code&amp;gt; (only the stats package is required)&lt;br /&gt;
#*PyOpenGL: &amp;lt;code&amp;gt;pip install PyOpenGL PyOpenGL_accelerate&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Set-up=&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
# Once [https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000] is downloaded and unzipped from Github, run &#039;&#039;main.py&#039;&#039; with Python. This will bring you to the main page, shown below.&lt;br /&gt;
# Next, choose your BCI2000 location, under &#039;&#039;File&#039;&#039;, then &#039;&#039;Choose BCI2000 Location...&#039;&#039;&lt;br /&gt;
# Choose the filter to visualize, under &#039;&#039;Filters&#039;&#039;&lt;br /&gt;
# Run a batch file with the chosen filter in the pipeline. For example, if CCEPFilter was chosen, you should run a batch file that uses [[Contributions:CCEPFilter|CCEPFilter]] as its Signal Processing module. &lt;br /&gt;
# Set config, then start. Then the filter should be visualized!&lt;br /&gt;
&lt;br /&gt;
See the gallery below for images to follow each step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot; widths=400&amp;gt;&lt;br /&gt;
File:VisualizeBCI2000DefaultWorkspace.png|1. The initial view when main.py is run&lt;br /&gt;
File:VisualizeBCI2000OperatorLocation.png|2. The view after the BCI2000 location is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosen.png|3. View after the desired filter is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosenRearranged.png|Optional rearrangement of the windows&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
These Settings are available to configure in the toolbar&lt;br /&gt;
* &#039;&#039;&#039;Choose BCI2000 Location&#039;&#039;&#039;: Choose the directory in which your BCI2000 resides. The folder chosen should be the main, root folder. This is mainly used to access the BCI2000Remote files, which are assumed to be located in the &#039;&#039;prog&#039;&#039; folder of the root directory.&lt;br /&gt;
* &#039;&#039;&#039;Filters&#039;&#039;&#039;: The BCI2000 Signal Processing filter which sends the incoming data. Each filter requires a custom Python implementation. Currently, the only 2 filters that are available are:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:CCEPFilter|CCEPFilter]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:PAC|Phase-amplitude coupling (PACFilter)]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;DataIOFilter&#039;&#039;&#039;&#039;&#039;: This streams the raw data from BCI2000 and continually updates a grid of plots. This is less of a useful visualization, and more of an example for a basic visualization.&lt;br /&gt;
* &#039;&#039;&#039;Data Streams&#039;&#039;&#039;: Defaults to BCI2000. If other data streams are desired, these must be implemented.&lt;br /&gt;
&lt;br /&gt;
=3D Visualization=&lt;br /&gt;
To enable the 3D visualization, you must input a VERA structure. VERA is an electrode localization application made to simplify electrode localization. The output of the VERA pipeline is a .mat (Matlab) structure, which is the input to be loaded into VisualizeBCI2000. In order to match the electrode names with the BCI2000 channel names, there must be a field called &#039;&#039;electrodeNamesKey&#039;&#039;, with columns &#039;&#039;VERANames&#039;&#039; and &#039;&#039;EEGNames&#039;&#039;. This table provides a necessary key between the two names.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11847</id>
		<title>VisualizeBCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11847"/>
		<updated>2025-04-29T17:23:00Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:CCEP gif.gif |900px|right|thumb|frame| An example video showing the CCEP filter with VisualizeBCI2000.]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
A Python toolkit to powerfully visualize BCI2000 data in real-time. The incoming data can be pre-processed in BCI2000&#039;s pipeline, or not, then sent to python through BCI2000&#039;s [[User Reference:SignalSharing|SignalSharing]] feature. The data can also be visualized in 3D if combined with a [https://github.com/neurotechcenter/VERA VERA structure (electrode localization tool)]. It is designed based on BCI2000&#039;s standard of modularity, therefore any of these components can be swapped out without changing the rest of the pipeline.&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&#039;&#039;&#039;[https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000 can be downloaded from GitHub here]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Python 3.8+ needs to be installed. [https://www.python.org/downloads/| You can download the lastest version here].&lt;br /&gt;
#A couple additional packages are used in this visualization. Run the following segments using &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; in the command line.&lt;br /&gt;
#*Numpy: &amp;lt;code&amp;gt;pip install numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQt5: &amp;lt;code&amp;gt;pip install PyQt5&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQtGraph 0.13.3+: &amp;lt;code&amp;gt;pip install pyqtgraph&amp;lt;/code&amp;gt;&lt;br /&gt;
#*SciPy: &amp;lt;code&amp;gt;pip install scipy&amp;lt;/code&amp;gt; (only the stats package is required)&lt;br /&gt;
&lt;br /&gt;
=Set-up=&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
# Once [https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000] is downloaded and unzipped from Github, run &#039;&#039;main.py&#039;&#039; with Python. This will bring you to the main page, shown below.&lt;br /&gt;
# Next, choose your BCI2000 location, under &#039;&#039;File&#039;&#039;, then &#039;&#039;Choose BCI2000 Location...&#039;&#039;&lt;br /&gt;
# Choose the filter to visualize, under &#039;&#039;Filters&#039;&#039;&lt;br /&gt;
# Run a batch file with the chosen filter in the pipeline. For example, if CCEPFilter was chosen, you should run a batch file that uses [[Contributions:CCEPFilter|CCEPFilter]] as its Signal Processing module. &lt;br /&gt;
# Set config, then start. Then the filter should be visualized!&lt;br /&gt;
&lt;br /&gt;
See the gallery below for images to follow each step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot; widths=400&amp;gt;&lt;br /&gt;
File:VisualizeBCI2000DefaultWorkspace.png|1. The initial view when main.py is run&lt;br /&gt;
File:VisualizeBCI2000OperatorLocation.png|2. The view after the BCI2000 location is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosen.png|3. View after the desired filter is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosenRearranged.png|Optional rearrangement of the windows&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
These Settings are available to configure in the toolbar&lt;br /&gt;
* &#039;&#039;&#039;Choose BCI2000 Location&#039;&#039;&#039;: Choose the directory in which your BCI2000 resides. The folder chosen should be the main, root folder. This is mainly used to access the BCI2000Remote files, which are assumed to be located in the &#039;&#039;prog&#039;&#039; folder of the root directory.&lt;br /&gt;
* &#039;&#039;&#039;Filters&#039;&#039;&#039;: The BCI2000 Signal Processing filter which sends the incoming data. Each filter requires a custom Python implementation. Currently, the only 2 filters that are available are:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:CCEPFilter|CCEPFilter]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:PAC|Phase-amplitude coupling (PACFilter)]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;DataIOFilter&#039;&#039;&#039;&#039;&#039;: This streams the raw data from BCI2000 and continually updates a grid of plots. This is less of a useful visualization, and more of an example for a basic visualization.&lt;br /&gt;
* &#039;&#039;&#039;Data Streams&#039;&#039;&#039;: Defaults to BCI2000. If other data streams are desired, these must be implemented.&lt;br /&gt;
&lt;br /&gt;
=3D Visualization=&lt;br /&gt;
To enable the 3D visualization, you must input a VERA structure. VERA is an electrode localization application made to simplify electrode localization. The output of the VERA pipeline is a .mat (Matlab) structure, which is the input to be loaded into VisualizeBCI2000. In order to match the electrode names with the BCI2000 channel names, there must be a field called &#039;&#039;electrodeNamesKey&#039;&#039;, with columns &#039;&#039;VERANames&#039;&#039; and &#039;&#039;EEGNames&#039;&#039;. This table provides a necessary key between the two names.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11846</id>
		<title>VisualizeBCI2000</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=VisualizeBCI2000&amp;diff=11846"/>
		<updated>2025-04-29T17:19:46Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:CCEP gif.gif |900px|right|thumb|frame| An example video showing the CCEP filter with VisualizeBCI2000.]]&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
A Python toolkit to powerfully visualize BCI2000 data in real-time. The incoming data can be pre-processed in BCI2000&#039;s pipeline, or not, then sent to python through BCI2000&#039;s [[User Reference:SignalSharing|SignalSharing]] feature. The data can also be visualized in 3D if combined with a [https://github.com/neurotechcenter/VERA VERA structure (electrode localization tool)]. It is designed based on BCI2000&#039;s standard of modularity, therefore any of these components can be swapped out without changing the rest of the pipeline.&lt;br /&gt;
&lt;br /&gt;
=Installation=&lt;br /&gt;
&#039;&#039;&#039;[https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000 can be downloaded from GitHub here]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Python 3.8+ needs to be installed. [https://www.python.org/downloads/| You can download the lastest version here].&lt;br /&gt;
#A couple additional packages are used in this visualization. Run the following segments using &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; in the command line.&lt;br /&gt;
#*Numpy: &amp;lt;code&amp;gt;pip install numpy&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQt5: &amp;lt;code&amp;gt;pip install PyQt5&amp;lt;/code&amp;gt;&lt;br /&gt;
#*PyQtGraph 0.13.3+: &amp;lt;code&amp;gt;pip install pyqtgraph&amp;lt;/code&amp;gt;&lt;br /&gt;
#*SciPy: &amp;lt;code&amp;gt;pip install scipy&amp;lt;/code&amp;gt; (only the stats package is required)&lt;br /&gt;
&lt;br /&gt;
=Set-up=&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
# Once [https://github.com/neurotechcenter/VisualizeBCI2000 VisualizeBCI2000] is downloaded and unzipped from Github, run &#039;&#039;main.py&#039;&#039; with Python. This will bring you to the main page, shown below.&lt;br /&gt;
# Next, choose your BCI2000 location, under &#039;&#039;File&#039;&#039;, then &#039;&#039;Choose BCI2000 Location...&#039;&#039;&lt;br /&gt;
# Choose the filter to visualize, under &#039;&#039;Filters&#039;&#039;&lt;br /&gt;
# Run a batch file with the chosen filter in the pipeline. For example, if CCEPFilter was chosen, you should run a batch file that uses [[Contributions:CCEPFilter|CCEPFilter]] as its Signal Processing module. &lt;br /&gt;
# Set config, then start. Then the filter should be visualized!&lt;br /&gt;
&lt;br /&gt;
See the gallery below for images to follow each step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;slideshow&amp;quot; widths=400&amp;gt;&lt;br /&gt;
File:VisualizeBCI2000DefaultWorkspace.png|1. The initial view when main.py is run&lt;br /&gt;
File:VisualizeBCI2000OperatorLocation.png|2. The view after the BCI2000 location is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosen.png|3. View after the desired filter is chosen&lt;br /&gt;
File:VisualizeBCI2000FilterChosenRearranged.png|Optional rearrangement of the windows&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
These Settings are available to configure in the toolbar&lt;br /&gt;
* &#039;&#039;&#039;Choose BCI2000 Location&#039;&#039;&#039;: Choose the directory in which your BCI2000 resides. The folder chosen should be the main, root folder. This is mainly used to access the BCI2000Remote files, which are assumed to be located in the &#039;&#039;prog&#039;&#039; folder of the root directory.&lt;br /&gt;
* &#039;&#039;&#039;Filters&#039;&#039;&#039;: The BCI2000 Signal Processing filter which sends the incoming data. Each filter requires a custom Python implementation. Currently, the only 2 filters that are available are:&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;[[Contributions:CCEPFilter|CCEPFilter]]&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
** &#039;&#039;&#039;&#039;&#039;DataIOFilter&#039;&#039;&#039;&#039;&#039;: This streams the raw data from BCI2000 and continually updates a grid of plots. This is less of a useful visualization, and more of an example for a basic visualization.&lt;br /&gt;
* &#039;&#039;&#039;Data Streams&#039;&#039;&#039;: Defaults to BCI2000. If other data streams are desired, these must be implemented.&lt;br /&gt;
&lt;br /&gt;
=3D Visualization=&lt;br /&gt;
To enable the 3D visualization, you must input a VERA structure. VERA is an electrode localization application made to simplify electrode localization. The output of the VERA pipeline is a .mat (Matlab) structure, which is the input to be loaded into VisualizeBCI2000. In order to match the electrode names with the BCI2000 channel names, there must be a field called &#039;&#039;electrodeNamesKey&#039;&#039;, with columns &#039;&#039;VERANames&#039;&#039; and &#039;&#039;EEGNames&#039;&#039;. This table provides a necessary key between the two names.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000FilterChosenRearranged.png&amp;diff=11845</id>
		<title>File:VisualizeBCI2000FilterChosenRearranged.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000FilterChosenRearranged.png&amp;diff=11845"/>
		<updated>2025-04-29T17:08:20Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000FilterChosen.png&amp;diff=11844</id>
		<title>File:VisualizeBCI2000FilterChosen.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000FilterChosen.png&amp;diff=11844"/>
		<updated>2025-04-29T17:05:47Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000OperatorLocation.png&amp;diff=11843</id>
		<title>File:VisualizeBCI2000OperatorLocation.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000OperatorLocation.png&amp;diff=11843"/>
		<updated>2025-04-29T15:57:40Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000DefaultWorkspace.png&amp;diff=11842</id>
		<title>File:VisualizeBCI2000DefaultWorkspace.png</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=File:VisualizeBCI2000DefaultWorkspace.png&amp;diff=11842"/>
		<updated>2025-04-29T15:55:55Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Python_Visualizations&amp;diff=11841</id>
		<title>Python Visualizations</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Python_Visualizations&amp;diff=11841"/>
		<updated>2025-04-29T14:52:28Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: Redirect to VisualizeBCI2000, the new documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[VisualizeBCI2000]]&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
	<entry>
		<id>https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11840</id>
		<title>Contributions:gEstimFilter</title>
		<link rel="alternate" type="text/html" href="https://www.bci2000.org/mediawiki/index.php?title=Contributions:gEstimFilter&amp;diff=11840"/>
		<updated>2025-04-28T20:01:33Z</updated>

		<summary type="html">&lt;p&gt;Wengelhardt: /* Electrode Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:gEstim_PRO.jpg|400px|thumb|right|g.tec g.Estim PRO cortical stimulator]]&lt;br /&gt;
This filter allows for cortical stimulation with the g.tec gEstim PRO.&lt;br /&gt;
&lt;br /&gt;
==Versioning==&lt;br /&gt;
===Authors===&lt;br /&gt;
Kristopher Kaleb Goering (kaleb.goering@gmail.com)&lt;br /&gt;
&lt;br /&gt;
Alexander Belsten (belsten@neurotechcenter.org)&lt;br /&gt;
&lt;br /&gt;
===Source Code Revisions===&lt;br /&gt;
*Initial development: --&lt;br /&gt;
*Tested under: 6191&lt;br /&gt;
*Known to compile under: 6191&lt;br /&gt;
*Broken since: --&lt;br /&gt;
&lt;br /&gt;
==Functional Description==&lt;br /&gt;
This extension resides in the Application module and allows for electrical stimulation.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
The gEstimPro drivers must be installed. Contact gTec to obtain access.&lt;br /&gt;
&lt;br /&gt;
==Integration into BCI2000==&lt;br /&gt;
This extension resides in the private directory of BCI2000. It must be enabled in CMake by selecting &amp;lt;code&amp;gt;BUILD_GESTIMFILTER&amp;lt;/code&amp;gt;. Then recompile the &amp;lt;code&amp;gt;BCI2000FrameworkAppModule&amp;lt;/code&amp;gt;, and the application module you are using. Lastly, append the enable flag to your batch file (ex: &amp;lt;code&amp;gt;Start executable StimulusPresentation --local --ActivateEstim=1&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
The gEstim device is configured in the gEstim tab.  The configurable parameters are:&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Set-up Preferences&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
====ActivateEstim====&lt;br /&gt;
Enables/disables device.&lt;br /&gt;
&lt;br /&gt;
====UseStimulusPresentation====&lt;br /&gt;
[[File:Estim_with_StimulusPresentation.png|600px|thumb|center|upright=2.5|Figure 1: Adding an additional row labeled &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; to stimuli to trigger stimulation]]&lt;br /&gt;
This 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&#039;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 &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt;. Now, stimulation will be triggered on all stimuli defined in this matrix has its &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row set to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. Stimulation will not occur on stimuli that have this row set to &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====DeviceMode====&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
[[File:GEstimCheckmarkOptions.png|frame|right|upright=3|The on/off or enumeration options for gEstim]]&lt;br /&gt;
====UseMultipleConfigurations====&lt;br /&gt;
Enables the use of StimulationConfigurations table. This allows for multiple stimulation configurations during a run. Whenever stimulation is triggered through the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row or through &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt;, it will trigger the most recently uploaded configuration.&lt;br /&gt;
&lt;br /&gt;
Only some gEstim devices, with an updated firmware, can quickly change stimulation configurations with the use of SUPERMODE. If you enabled &#039;&#039;UseMultipleConfigurations&#039;&#039; 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. &lt;br /&gt;
&lt;br /&gt;
====DoSelfTest====&lt;br /&gt;
Enables user to disable the Self-test. g.Tec recommends performing the self-test before every use in case the device is faulty.&lt;br /&gt;
&lt;br /&gt;
====QuietStimulation====&lt;br /&gt;
Enable to silent the stimulation. &lt;br /&gt;
&lt;br /&gt;
====EnableExternalTrigger====&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
====EnableLillyPulses====&lt;br /&gt;
Enable to specify different amplitudes and durations of the first and second pulses. However, their charges must be balanced. This mode uses a different configuration in the StimulationConfigurations table, see the image below.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Stimulation Parameters&amp;lt;/u&amp;gt;===&lt;br /&gt;
====StimulationConfigurations====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; heights=400&amp;gt;&lt;br /&gt;
File:GEstimConfigTable.png|Option 1: a default StimulationConfigurations table&lt;br /&gt;
File:GEstimConfigTableLillyPulses.png|Option 2: to use Lilly Pulses, have this configuration&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Table that allows for multiple configurations. The parameters in the table are the same as below. The first row, &amp;lt;code&amp;gt;Expression&amp;lt;/code&amp;gt;, can either correlate to uploading the stimulation or uploading &#039;&#039;and&#039;&#039; starting the stimulation. &#039;&#039;&#039;To start immediately after upload, leave &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; empty and turn &amp;lt;code&amp;gt;UseStimulusPresentation&amp;lt;/code&amp;gt; off&#039;&#039;&#039;. Otherwise, &amp;lt;code&amp;gt;StimulationExpression&amp;lt;/code&amp;gt; or the &amp;lt;code&amp;gt;EstimOn&amp;lt;/code&amp;gt; row will start the stimulation that was uploaded. The &amp;lt;code&amp;gt;AbortExpression&amp;lt;/code&amp;gt; will still abort any active stimulation.&lt;br /&gt;
&lt;br /&gt;
====StimulationExpression====&lt;br /&gt;
Expression to start g.Estim stimulation. See the [[User_Reference:Expression_Syntax|expression]] page for more details on how to define an expression. &lt;br /&gt;
====AbortExpression====&lt;br /&gt;
Expression to abort g.Estim stimulation.&lt;br /&gt;
====Modularity====&lt;br /&gt;
[[File:gEstim_pulse_parameters.png|600px|thumb|right|upright=2.5|Configurable parameters of stimulation profile]]&lt;br /&gt;
Modularity of pulses; Biphasic or Monophasic&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Not used in Lilly pulse mode.&#039;&#039;&lt;br /&gt;
====Polarity====&lt;br /&gt;
Polarity of pulses; Alternating or Steady&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Is always Steady in Lilly pulse mode&#039;&#039;, due to the gEstim constraint that the first pulse needs to be positive&lt;br /&gt;
====PhaseDuration====&lt;br /&gt;
Duration of time of each +/- phase.&lt;br /&gt;
====InterphaseDuration====&lt;br /&gt;
Duration of time with no stimulation between each pulse&#039;s phases.&lt;br /&gt;
====Magnitude====&lt;br /&gt;
Magnitude of the pulse in milliamps. This quantity is peak-to-zero. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Both magnitudes must be greater than 0&#039;&#039; in Lilly mode. The 2nd pulse will automatically be negative.&lt;br /&gt;
====NumberOfPulses====&lt;br /&gt;
Number of pulses per train.&lt;br /&gt;
====PulseFrequency====&lt;br /&gt;
Frequency of each pulse in a train. Note that the &#039;&#039;PhaseDuration&#039;&#039; and &#039;&#039;InterphaseDuration&#039;&#039; impose a limit on the &#039;&#039;PulseFrequency&#039;&#039;. Make sure this parameter adheres to this limitation. &lt;br /&gt;
====NumberOfTrains====&lt;br /&gt;
Number of trains.&lt;br /&gt;
====FrequencyOfTrains====&lt;br /&gt;
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 &#039;&#039;FrequencyOfTrains&#039;&#039; adheres to this restriction. &lt;br /&gt;
====Jitter====&lt;br /&gt;
Jitter of trains between 0 and 100% in increments of 1%&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;Electrode Settings&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
[[File:GEstimElectrodeParameters.png|frame|Parameters for electrode type]]&lt;br /&gt;
====ElectrodeType====&lt;br /&gt;
Type of electrode being used: 1 Circle, 2 Depth, 3 Other.&lt;br /&gt;
====CircleDiameter====&lt;br /&gt;
For circle electrode type. Exposed diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactDiameter====&lt;br /&gt;
For depth electrode type. Contact diameter of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ContactLength====&lt;br /&gt;
For depth electrode type. Contact length of the electrode in micrometers in increments of 1&amp;amp;mu;m.&lt;br /&gt;
====ExposedSurfaceArea====&lt;br /&gt;
For other electrode type. Exposed surface area of electrode in square micrometers between in increments of 1&amp;amp;mu;m&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
===EstimStimulus===&lt;br /&gt;
This binary state is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; when a stimulation train is running and &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; otherwise.s&lt;br /&gt;
&lt;br /&gt;
===EstimCurrent===&lt;br /&gt;
Applied current in µA, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimVoltage===&lt;br /&gt;
Applied voltage in mV, reported from the stimulator. 16 bit state.&lt;br /&gt;
&lt;br /&gt;
===EstimImpedance===&lt;br /&gt;
Impedance of tissue in Ω in 16 bit state. Calculated using &amp;lt;code&amp;gt;EstimCurrent&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;EstimVoltage&amp;lt;/code&amp;gt; values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==[[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|SCIT]]==&lt;br /&gt;
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 [[User Reference:StimulationConfigurationIntegrativeTool (SCIT)|Stimulation Configuration tool user reference]] which will further tell you how to use this tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=&amp;quot;packed&amp;quot; widths=500px heights=500px&amp;gt;&lt;br /&gt;
File:gEstimGUIimg.png|Figure 3: The gEstim GUI which creates BCI2000 parameters from stimulation specifications. &lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tool currently does not have the new &amp;lt;code&amp;gt;StimulationConfigurations&amp;lt;/code&amp;gt; parameter, so it only allows for one configuration to be exported.&lt;br /&gt;
&lt;br /&gt;
==Latency==&lt;br /&gt;
[[File:gEstim_latency.png|400px|thumb|center|upright=2.5|Latency of stimulation]]&lt;br /&gt;
The above figure details the latency between positive evaluation of the &#039;&#039;StimulationExpression&#039;&#039; and pulse delivery.&lt;/div&gt;</summary>
		<author><name>Wengelhardt</name></author>
	</entry>
</feed>