Categories
Science

Programming platforms considerations

We plan to develop the final EEG-synth user-interface in Python for several reasons:

  1. It can be run on the Raspberry Pi (on the Debian-based Rasbian operating system), with is our target system for the final ‘product’
  2. It has a great number of libraries for numerical calculations, serial and MIDI interfacing, and graphical display
  3. It has a huge active professional user base
  4. Has a good balance between low and high level programming for most of our purposes
  5. It is transferable knowledge with respect to my professional work (i.e. I do not mind spending time learning Python)
  6. It will allow the inclusion of the large neuroscience community that uses the Python-based MNE toolbox.

Much of the development, however, we will also be doing in MATLAB in parallel, because:

  1. It can be integrated with existing implementations and idea’s about real-time processing in FieldTrip
  2. It allows inspiration and further development of the FieldTriptoolbox
  3. We are already fluent in its use
  4. It will allow the inclusion of the large neuroscience community of FieldTrip

When it comes to the actual transfer of the EEG data to the analysis (and user interface) computer, we will use or develop two approaches:

  1. FieldTrip buffer
  2. Python serial communication

The FieldTrip buffer necessitates the programming in C of a OpenBCI-to-FieldTrip buffer program. With the available documentation and example code of the OpenEEG2ft.c (in /fieldtrip/realtime/scr) this should be not too hard. The Python serial communication protocols are already implemented in the OpenBCI Python code (in OpenBCI_v3.py, in the repository).

However, the FieldTrip buffer already solves many issues such as bookkeeping of the data in a standardized buffer. Not only that, the TCP/IP based protocol is easily accessible from many devices, programming platforms and operating systems. In fact, there is a script around (somewhere…) for accessing the FieldTrip buffer in Python. I imagine the Python serial interface to be mainly used for setting parameters on the EEG board, as bi-directional communication does currently not fit the approach taken by the FieldTrip buffer implementation.

Of course we do not exclude the possibility that we (or someone else) will develop code for Java or the Java-based Processing environment that OpenBCI supplies. In fact, the FieldTrip buffer can be accessed through Java already. This approach might be especially useful for a public that is generally less familiar with programming, such as artists, but for whom we are developing this.

Leave a Reply

Your email address will not be published. Required fields are marked *