Skip to content

Commit 0042390

Browse files
committed
Merge remote-tracking branch 'openbci/master'
2 parents 4fcd1e5 + 4700c94 commit 0042390

24 files changed

+1369
-15
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ We support bindings for:
4444
* [C++](./cpp-package/)
4545
* [C# (Windows only)](./csharp-package/brainflow/)
4646
* [Matlab](./matlab-package/brainflow)
47+
* [Julia](.julia-package/brainflow)
4748

4849
## License:
4950
MIT

docs/BuildBrainFlow.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,30 @@ Steps to setup Matlab binding for BrainFlow:
6969
- Add folders lib and inc to Matlab path
7070
- If you want to run Matlab scripts from folders different than brainflow/matlab-package/brainflow you need to add it to your Matlab path too
7171

72+
73+
Julia
74+
--------
75+
76+
Steps to setup Julia binding for BrainFlow:
77+
78+
- Compile Core Module, using instructions below
79+
- Set PATH(on Windows) or LD_LIBRARY_PATH(on Unix) env variables to ensure that compiled libraries are in search path
80+
- Install BrainFlow package locally
81+
82+
.. compound::
83+
84+
Example ::
85+
86+
# compile core module first
87+
# set env variable
88+
export LD_LIBRARY_PATH=/home/andreyparfenov/brainflow/installed_linux/lib/:$LD_LIBRARY_PATH
89+
cd julia-package/brainflow
90+
julia
91+
# type ']' to switch to pkg terminal
92+
activate . # activate BrainFlow's env
93+
94+
95+
7296
Compilation of Core Module and C++ Binding
7397
-------------------------------------------
7498

docs/Examples.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,40 @@ Matlab Denoising
269269
.. literalinclude:: ../matlab-package/brainflow/examples/Denoising.m
270270
:language: matlab
271271

272+
Julia
273+
--------
274+
275+
Julia Get Data from a Board
276+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
277+
278+
.. literalinclude:: ../julia-package/brainflow/test/brainflow_get_data.jl
279+
:language: julia
280+
281+
Julia Read Write File
282+
~~~~~~~~~~~~~~~~~~~~~~~~
283+
284+
.. literalinclude:: ../julia-package/brainflow/test/serialization.jl
285+
:language: julia
286+
287+
Julia Transforms
288+
~~~~~~~~~~~~~~~~~~
289+
290+
.. literalinclude:: ../julia-package/brainflow/test/transforms.jl
291+
:language: julia
292+
293+
Julia Signal Filtering
294+
~~~~~~~~~~~~~~~~~~~~~~~~~
295+
296+
.. literalinclude:: ../julia-package/brainflow/test/signal_filtering.jl
297+
:language: julia
298+
299+
Julia Denoising
300+
~~~~~~~~~~~~~~~~~
301+
302+
.. literalinclude:: ../julia-package/brainflow/test/denoising.jl
303+
:language: julia
304+
305+
272306
Notebooks
273307
------------
274308
.. toctree::

docs/SupportedBoards.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ To create an instance of BoardShim class for your board check required inputs in
1313
"Cyton", "BoardIds.CYTON_BOARD (0)", "dongle serial port(COM3, /dev/ttyUSB0, /dev/cu.usbserial-xxxxxx...)", "-", "-", "-", "-", "-", "-"
1414
"Ganglion", "BoardIds.GANGLION_BOARD (1)", "dongle serial port(COM3, /dev/ttyUSB0...)", "Optional: Ganglion's MAC address", "-", "-", "-", "-", "Timeout for device discovery(default 15sec)"
1515
"Cyton Daisy", "BoardIds.CYTON_DAISY_BOARD (2)", "dongle serial port(COM3, /dev/ttyUSB0, /dev/cu.usbserial-xxxxxx...)", "-", "-", "-", "-", "-", "-"
16-
"Ganglion Wifi", "BoardIds.GANGLION_WIFI_BOARD (4)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "-"
17-
"Cyton Wifi", "BoardIds.CYTON_WIFI_BOARD (5)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "-"
18-
"Cyton Daisy Wifi", "BoardIds.CYTON_DAISY_WIFI_BOARD (6)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "-"
16+
"Ganglion Wifi", "BoardIds.GANGLION_WIFI_BOARD (4)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "Timeout for HTTP response(default 10sec)"
17+
"Cyton Wifi", "BoardIds.CYTON_WIFI_BOARD (5)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "Timeout for HTTP response(default 10sec)"
18+
"Cyton Daisy Wifi", "BoardIds.CYTON_DAISY_WIFI_BOARD (6)", "-", "-", "Wifi Shield IP(default 192.168.4.1)", "any local port which is free", "-", "-", "Timeout for HTTP response(default 10sec)"
1919
"BrainBit", "BoardIds.BRAINBIT_BOARD (7)", "-", "-", "-", "-", "-", "Serial Number of BrainBit device", "Timeout for device discovery(default 15sec)"
2020

2121

@@ -205,6 +205,7 @@ To choose this board in BoardShim constructor please specify:
205205
- board_id: 4
206206
- ip_address field of BrainFlowInputParams structure should contain WiFi Shield Ip address(in direct mode its 192.168.4.1)
207207
- ip_port field of BrainFlowInputParams structure should be any local port which is free right now
208+
- optional: timeout field of BrainFlowInputParams structure, default is 10sec
208209

209210
Supported platforms:
210211

@@ -235,6 +236,7 @@ To choose this board in BoardShim constructor please specify:
235236
- board_id: 5
236237
- ip_address field of BrainFlowInputParams structure should contain WiFi Shield Ip address(in direct mode its 192.168.4.1)
237238
- ip_port field of BrainFlowInputParams structure should be any local port which is free right now
239+
- optional: timeout field of BrainFlowInputParams structure, default is 10sec
238240

239241
Supported platforms:
240242

@@ -267,6 +269,7 @@ To choose this board in BoardShim constructor please specify:
267269
- board_id: 6
268270
- ip_address field of BrainFlowInputParams structure should contain WiFi Shield Ip address(in direct mode its 192.168.4.1)
269271
- ip_port field of BrainFlowInputParams structure should be any local port which is free right now
272+
- optional: timeout field of BrainFlowInputParams structure, default is 10sec
270273

271274
Supported platforms:
272275

docs/UserAPI.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,27 @@ Full code for R binding:
117117
Matlab API Reference
118118
----------------------
119119

120-
Matlab binding calls C\C++ code as any other binding, it's not compatible with Octave. Use our code samples as a reference for Matlab API.
120+
Matlab binding calls C\C++ code as any other binding, it's not compatible with Octave. Use Matlab examples and API reference for other languaes as a starting point.
121121

122122
A few general rules to keep in mind:
123123

124124
- Use char arrays instead strings to work with BrainFlow API, it means 'my_string' instead "my_string", otherwise you will get calllib error
125125
- Use int32 values intead enums, it means int32 (BoardIDs.SYNTHETIC_BOARD) instead BoardIDs.SYNTHETIC_BOARD, the same is true for all enums in BrainFlow API
126126

127+
Like here:
128+
129+
.. literalinclude:: ../matlab-package/brainflow/examples/Serialization.m
130+
:language: matlab
131+
132+
133+
Julia API Reference
134+
---------------------
135+
136+
Julia binding calls C\C++ code as any other binding. Use Julia examples and API reference for other languaes as a starting point.
137+
138+
Since Julia is not Object-Oriented language, there is no DataFilter class. BoardShim class exists but all BoardShim class methods were moved to BrainFlow package and you need to pass BoardShim object to them.
139+
140+
Like here:
141+
142+
.. literalinclude:: ../julia-package/brainflow/test/serialization.jl
143+
:language: julia

julia-package/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# BrainFlow
2+
3+
BrainFlow is a library intended to obtain, parse and analyze EEG, EMG, ECG and other kinds of data from biosensors.
4+
5+
#### Advantages of BrainFlow:
6+
7+
* powerful API with many features to simplify development
8+
* Straightforward API for data acquisition
9+
* Powerful API for signal filtering, denoising, downsampling...
10+
* Development tools like Synthetic board, Streaming board, logging API
11+
* easy to use
12+
* BrainFlow has many bindings, you can choose programming language you like
13+
* All programming languages provide the same API, so it's simple to switch
14+
* API is uniform for all boards, it makes applications on top of BrainFlow almost board agnostic
15+
* easy to support and extend
16+
* Code to read data and to perform signal processing is implemented only once in C/C++, bindings just call C/C++ methods
17+
* Powerful CI/CD system which runs integrations tests for each commit automatically using BrainFlow's Emulator
18+
* Simplified process to add new boards and methods
19+
20+
## [BrainFlow Docs, Dev and User guides and other information](https://brainflow.readthedocs.io)
21+
22+
## [BrainFlow's slack workspace](https://openbraintalk.slack.com/), use this [link to join](https://c6ber255cc.execute-api.eu-west-1.amazonaws.com/Express/)
23+
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[Base64]]
4+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
5+
6+
[[Dates]]
7+
deps = ["Printf"]
8+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
9+
10+
[[Distributed]]
11+
deps = ["Random", "Serialization", "Sockets"]
12+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
13+
14+
[[InteractiveUtils]]
15+
deps = ["Markdown"]
16+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
17+
18+
[[JSON]]
19+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
20+
git-tree-sha1 = "b34d7cef7b337321e97d22242c3c2b91f476748e"
21+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
22+
version = "0.21.0"
23+
24+
[[Logging]]
25+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
26+
27+
[[Markdown]]
28+
deps = ["Base64"]
29+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
30+
31+
[[Mmap]]
32+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
33+
34+
[[Parsers]]
35+
deps = ["Dates", "Test"]
36+
git-tree-sha1 = "d6d82d5bdbb75048e574cd2d2c89dfbf2c74250c"
37+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
38+
version = "1.0.0"
39+
40+
[[Printf]]
41+
deps = ["Unicode"]
42+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
43+
44+
[[Random]]
45+
deps = ["Serialization"]
46+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
47+
48+
[[Serialization]]
49+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
50+
51+
[[Sockets]]
52+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
53+
54+
[[Test]]
55+
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
56+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
57+
58+
[[Unicode]]
59+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name = "brainflow"
2+
uuid = "abd5acf9-0fc9-4730-984d-e27a37823580"
3+
authors = ["Andrey1994 <a1994ndrey@gmail.com>"]
4+
version = "0.1.0"
5+
6+
[deps]
7+
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"

0 commit comments

Comments
 (0)