Jump to content

Contributions:BrainFlow: Difference between revisions

From BCI2000 Wiki
Rlellis (talk | contribs)
Created page with "==Installation== ===BrainFlow Install=== 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 [https://gitforwindows.org/ git bash], and enter 'git clone https://github.com/OpenBCI/brainflow.git' ([https://github.com/OpenBCI/brainflow/tree/master BrainFlow]). Aft..."
 
Mellinger (talk | contribs)
 
(48 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Installation==
[[File:Brainflowpic.png|300px|thumb|right]]
===BrainFlow Install===
==Synopsis==
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 [https://gitforwindows.org/ git bash], and enter 'git clone https://github.com/OpenBCI/brainflow.git' ([https://github.com/OpenBCI/brainflow/tree/master 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.  
This module integrates the data aquistion capabilities from [https://brainflow.readthedocs.io/en/stable/ BrainFlow] into BCI2000, allowing for compatibility with several new boards, especially boards from the OpenBCI hardware project.


If you wish to use debug mode, open build.py and search for 'config' until you find a section that looks like this:
==Location==
http://{{SERVERNAME}}/svn/trunk/src/contrib/SignalSource/BrainFlow


def build(args):
<!--
    if platform.system() == 'Windows':
==BrainFlow Installation/Setup==
        config = 'Release'
Before installation, please install [https://gitforwindows.org/ git bash] and [https://www.python.org/downloads/ python]. Note that VS2022 is not compatible with this module.




'config' determines how the solution is built, so adjust this according to which version you plan to use, then run it.
===Automatic Installation===
'''Note that instillation will take around 125MB. Also ensure that you are using VS2019.'''


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.
Libraries generated from BrainFlow are needed for this module, which requires the user to download and build the project. The download/compilation process can be automated using this script located in SignalSource\BrainFlow:
<gallery mode="packed" widths=75px heights=75px>
File:BFLibInstall.JPG|BrainFlow library install script
</gallery>
All that needs to be done to use this scripts is: locate them in {BCI2000 Folder}\src\contrib\SignalSource\BrainFlow, and double click on "GenerateLibraries.bat". This will clone the [https://github.com/brainflow-dev/brainflow BrainFlow repository] into src\extlib. The script will build libraries for both debug and release configurations, so there will be two folders installed. '''Make sure to press enter when indicated. Do not exit the console until everything has finished installing--just follow the prompts given by the console.''' After each set of libraries are installed, you will be told to add the directories {BCI2000 Folder}\src\extlib\brainflowDebug\installed\lib and {BCI2000 Folder}\src\extlib\brainflow\installed\lib to your systems PATH
(please follow [https://www.youtube.com/watch?v=91SGaK7_eeY this] tutorial if you are unsure how to do this).


In BCI2000's CMake window,
In CMake, make sure under "BUILD" that "BUILD_ALL_SOURCEMODULES" is selected. In the batch file to be used, append '''start executable BrainFlowADC --local''' to the line corresponding to the source module.
C:/Users/Robbie/Documents/BCI2000folder/brainflow/installed/lib/Brainflow.lib
-->
C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/BoardController.lib
==Parameters==
C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/DataHandler.lib
===BoardID===
C:/Users/Robbie/Documents/BCI2000folder/brainflow/compiled/Debug/MLModule.lib
Identifier for the board in use, compatible with any board able to be used with BrainFlow.
C:\Users\Robbie\Documents\BCI2000folder\brainflow\installed\lib\cmake\brainflow
BoardIDs are listed the parameter's commentary, and boards are displayed by name in the parameter GUI.
 
===RecordingChannels===
Sets which board channels will be used for data acquisition. Some boards will not have all listed channel types, in which case no data will be collected from such types. If channels are found and '''ChannelNames''' is set to auto, listed channels will be given their designated names.
 
 
'''The following information might not be needed for specific boards. Search for your board [https://brainflow.readthedocs.io/en/stable/SupportedBoards.html here] to see which parameters are necessary.''' 
 
===COM===
Specifies the port the device is connected to (this must be found by the user--the program will not search ports to find which the device is connected to. Open your system's device manager to determine this) if needed. If not needed, leave as auto.
 
===MAC===
Specifies the MAC address of the device if needed. If not needed, leave as auto.
 
===IPPort===
Specifies the address of an IP port if needed. If not needed, leave as auto.
 
===SerialNumber===
Specifies the serial number of the device if needed. If not needed, leave as auto.
 
==See also==
[[User Reference:Filters]], [[Contributions:ADCs]]
 
[[Category:Contributions]][[Category:Data Acquisition]]

Latest revision as of 12:31, 17 December 2024

Synopsis

This module integrates the data aquistion capabilities from BrainFlow into BCI2000, allowing for compatibility with several new boards, especially boards from the OpenBCI hardware project.

Location

http://www.bci2000.org/svn/trunk/src/contrib/SignalSource/BrainFlow

Parameters

BoardID

Identifier for the board in use, compatible with any board able to be used with BrainFlow. BoardIDs are listed the parameter's commentary, and boards are displayed by name in the parameter GUI.

RecordingChannels

Sets which board channels will be used for data acquisition. Some boards will not have all listed channel types, in which case no data will be collected from such types. If channels are found and ChannelNames is set to auto, listed channels will be given their designated names.


The following information might not be needed for specific boards. Search for your board here to see which parameters are necessary. 

COM

Specifies the port the device is connected to (this must be found by the user--the program will not search ports to find which the device is connected to. Open your system's device manager to determine this) if needed. If not needed, leave as auto.

MAC

Specifies the MAC address of the device if needed. If not needed, leave as auto.

IPPort

Specifies the address of an IP port if needed. If not needed, leave as auto.

SerialNumber

Specifies the serial number of the device if needed. If not needed, leave as auto.

See also

User Reference:Filters, Contributions:ADCs