Contributions:BrainFlow: Difference between revisions
| Line 4: | Line 4: | ||
==BrainFlow Installation/Setup== | ==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]. | ||
'''Please note that after generating the libraries for debug or release, you may ONLY build in that configuration! To switch to the other configuration you must rebuild the libraries, which can quickly be done through the BrainFlowBuild.py script in the SignalSource\BrainFlow folder''' | '''Please note that after generating the libraries for debug or release, you may ONLY build in that configuration! To switch to the other configuration you must rebuild the libraries, which can quickly be done through the BrainFlowBuild.py script in the SignalSource\BrainFlow folder''' | ||
===Automatic Installation=== | ===Automatic Installation=== | ||
Revision as of 21:35, 17 January 2024
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.
Please note that after generating the libraries for debug or release, you may ONLY build in that configuration! To switch to the other configuration you must rebuild the libraries, which can quickly be done through the BrainFlowBuild.py script in the SignalSource\BrainFlow folder
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 (which will be one folder outside of BCI2000--if your BCI2000 copy has directory User\BCI2000, then this script will create User\brainflow) 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}"). This can be done by searching for "Path" in the windows search bar, which will show "Edit the system environment variables", which upon opening will open up a tab labelled system properties. Open the "Environment" tab and click on "Path" under the "System Variables" window, and press edit. At the bottom of the list, enter the folder ...\brainflow\compiled.
C:\Users\Robbie\Documents\BCI2000folder\brainflow\installed\lib
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"--if this is selected, BCI2000 will fail to build. In the batch file to be used, append start executable BrainFlowADC --local to the line corresponding to the source module.
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.
Afterward, you will need to add the generated libraries to your systems path. ("Compiled/{Release and/or Debug}"). This can be done by searching for "Path" in the windows search bar, which will show "Edit the system environment variables", which upon opening will open up a tab labelled system properties. Open the "Environment" tab and click on "Path" under the "System Variables" window, and press edit. At the bottom of the list, enter the folder ...\brainflow\compiled.
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 the batch file to be used, append start executable BrainFlowADC --local to the line corresponding to the source module.
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