Contributions:BrainFlow: Difference between revisions
| Line 1: | Line 1: | ||
==Installation== | ==Installation== | ||
===BrainFlow | ==Synopsis== | ||
This module integrates the data aquistion capabilities from [https://brainflow.readthedocs.io/en/stable/ BrainFlow] into BCI2000, allowing for compatibility with several new boards. | |||
==BrainFlow Installation/Setup== | |||
Before installation, please install [https://gitforwindows.org/ git bash] and [https://www.python.org/downloads/ python]. | Before installation, please install [https://gitforwindows.org/ git bash] and [https://www.python.org/downloads/ python]. | ||
| Line 34: | Line 37: | ||
In BCI2000's CMake window (build\Configure.sh.cmd), press the blue "Add Entry" arrow in the top right corner. In the dropdown menu for "Type:", select "PATH", then in "Name:" enter: "CMAKE_PREFIX_PATH". For the value, enter the entire file location of brainflow\installed\lib\cmake\brainflow (go to the folder your BCI2000 folder resides in, a folder named "brainflow" will be located there. You can append the the location of this folder with this location so your entire file location looks like C:\Users...\{Folder containing BCI2000 folder}\brainflow\installed\lib\cmake\brainflow). After these three fields are filled out, press "OK". Make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected, '''and you will also need to deselect "USE_DYNAMIC_CRT" under "USE"'''. | In BCI2000's CMake window (build\Configure.sh.cmd), press the blue "Add Entry" arrow in the top right corner. In the dropdown menu for "Type:", select "PATH", then in "Name:" enter: "CMAKE_PREFIX_PATH". For the value, enter the entire file location of brainflow\installed\lib\cmake\brainflow (go to the folder your BCI2000 folder resides in, a folder named "brainflow" will be located there. You can append the the location of this folder with this location so your entire file location looks like C:\Users...\{Folder containing BCI2000 folder}\brainflow\installed\lib\cmake\brainflow). After these three fields are filled out, press "OK". Make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected, '''and you will also need to deselect "USE_DYNAMIC_CRT" under "USE"'''. | ||
==Parameters== | |||
*BoardID | |||
Identifier for the boad in use, compatable with any board able to be used with BrainFlow. | |||
*RecordingChannels | |||
Sets which board channels will be used for data aquisition. Some boards will not have all listed channel types, in which case no data will be collected from such types. | |||
*COM | |||
Specifies the port the device is connected to | |||
*MAC | |||
Specifies the MAC address of the device | |||
Revision as of 23:18, 11 December 2023
Installation
Synopsis
This module integrates the data aquistion capabilities from BrainFlow into BCI2000, allowing for compatibility with several new boards.
BrainFlow Installation/Setup
Before installation, please install git bash and python.
- Automatic Installation:
Libraries generated from BrainFlow are needed for this module, which requires the user to download and build the project. The download process (and configuring the solution) can be automated using these scripts:
-
BrainFlow installation/configuration automation scripts
All that needs to be done to use this scripts is: locate them in {BCI2000 Folder}\src\contrib\SignalSource\BrainFlow, and double click on "BrainFlowInstall.bat". This will clone the BrainFlow repository*** into the correct location as well as run the BrainFlowBuild.py script, which will generate compiled libraries for either debug or release, depending on what you enter upon being prompted (0=debug, 1=release).
Afterward, you will need to add the generated libraries to your systems path. ("Compiled/{Release and/or Debug}")
In BCI2000's CMake window (build\Configure.sh.cmd), press the blue "Add Entry" arrow in the top right corner. In the dropdown menu for "Type:", select "PATH", then in "Name:" enter: "CMAKE_PREFIX_PATH". For the value, enter the entire file location of brainflow\installed\lib\cmake\brainflow (go to the folder your BCI2000 folder resides in, a folder named "brainflow" will be located there. You can append the the location of this folder with this location so your entire file location looks like C:\Users...\{Folder containing BCI2000 folder}\brainflow\installed\lib\cmake\brainflow). After these three fields are filled out, press "OK". Make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected, and you will also need to deselect "USE_DYNAMIC_CRT" under "USE".
- Manual Installation:
First, in the same folder containing your working copy of BCI2000, create a folder named 'brainflow'. For example, if the location of your copy of BCI2000 is C:\Users\Bob\Desktop\BCI2000, your folder will be C:\Users\Bob\Desktop\brainflow. In this new folder, open git bash, and enter 'git clone https://github.com/OpenBCI/brainflow.git' (BrainFlow). After installation is complete, navigate to the 'tools' folder, and run build.py. This will create the solution needed to generate the libraries for EITHER debug or release.
Afterward, you will need to add the generated libraries to your systems path. ("brainflow\compiled\{Release and/or Debug}")
If you wish to use debug mode, open build.py and search for 'config' until you find a section that looks like this:
def build(args):
if platform.system() == 'Windows':
config = 'Release'
'config' determines how the solution is built, so adjust this according to which version you plan to use ("Release" or "Debug"), then run it.
Next, go to brainflow\build and open 'brainflow.sln'. Set the version to match the config used above (release or debug), and build the solution.
In BCI2000's CMake window (build\Configure.sh.cmd), press the blue "Add Entry" arrow in the top right corner. In the dropdown menu for "Type:", select "PATH", then in "Name:" enter: "CMAKE_PREFIX_PATH". For the value, enter the entire file location of brainflow\installed\lib\cmake\brainflow (go to the folder your BCI2000 folder resides in, a folder named "brainflow" will be located there. You can append the the location of this folder with this location so your entire file location looks like C:\Users...\{Folder containing BCI2000 folder}\brainflow\installed\lib\cmake\brainflow). After these three fields are filled out, press "OK". Make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected, and you will also need to deselect "USE_DYNAMIC_CRT" under "USE".
Parameters
- BoardID
Identifier for the boad in use, compatable with any board able to be used with BrainFlow.
- RecordingChannels
Sets which board channels will be used for data aquisition. Some boards will not have all listed channel types, in which case no data will be collected from such types.
- COM
Specifies the port the device is connected to
- MAC
Specifies the MAC address of the device
C:/Users/Robbie/Documents/BCI2000folder/brainflow/installed/lib/cmake/brainflow
C:/Users/Robbie/Documents/BCI2000folder/brainflow/installed/lib/Brainflow.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/BoardController.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/DataHandler.lib C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/MLModule.lib C:\Users\Robbie\Documents\BCI2000folder\brainflow\installed\lib\cmake\brainflow