neurofeedback - use existing software, write anew?

edited December 2014 in Software
My primary interest in OpenBCI is for neurofeedback for mental/brain-health (and maybe peak performance training). I have some experience on the receiving end of neurofeedback in clinical settings, but the equipment seemed too far out of reach for home use.

Now I've got my OpenBCI (32-bit), and I'm trying to figure out what I need to do to get to practical applications.

The last time I looked at tools (while waiting for OpenBCI to ship), it seemed like the two most promising (open-source) platforms are BrainBay and OpenViBE. But, after having installed BrainBay and taken a second look at the documentation for OpenViBE, it seems like we're a ways away from being able to start one of those and click on a button that says "Start Alpha Training Session."

and while I wasn't willing to try to cobble together an OpenEEG unit on my own — I'm not that confident in my electronics skills — I can write software.

So from here it seems like the options are:
  1. write/document/publish neurofeedback session designs for BrainBay
    • pros: BrainBay already offers some interoperability for related tools, already has an OpenBCI driver that allows full-precision use of all channels.
    • cons: Windows-only. It's reported to run on OS X and Linux under WINE, but if I needed to do any development beyond what the existing components offer, I'd probably need Visual Studio and such. Kind of a drag given the otherwise open source environment of OpenBCI.
  2. write/document/publish scenarios for OpenViBE
    • pros: Also integrates with a lot of existing stuff. OpenViBE runs on Windows and Linux. Can maybe even write components in non-C++ languages?
    • cons: No OpenBCI-specific drivers yet.
  3. write a new thing
    • pros: 
      • could potentially include Android in our targeted platforms, which would be neat given OpenBCI's form factor and Bluetooth connectivity.
      • I like Python, and it seems like there are other Python fans around here too.
    • cons:
      • Not-Invented-Here syndrome, lose out on compatibility, wisdom, and mind-share from existing projects.
      • lack of a diagram-based configuration system might be less accessible to non-programmers.
Am I missing things? Other tools I should know about? Am I over-simplifying the problem or over-complicating the solution?

Comments

  • Hi I am a Neurofeedback trainer from the Netherlands.

    I would like to second that. I will be using the OpenBCI for two purposes if possible.

    Neurofeedback and a device for reading evoked potentials. The last one will be coming very close to the things this group wants. At the moment is see no other way to use brainwaves to manage devices or games as evoked potentials.

    http://en.wikipedia.org/wiki/Evoked_potential

    I can think of one other software program that would be very useful and that is Bioexplorer.
    • Pro's:
    • It's modular and programmable.
    • It is professional
    • Not necessary to program new DSP filters.
    • Cons
    • Commercial (no problem for me since I already have a dongle).
    • Windows based

    I would prefer to have some Linux software as well. Possible something that I can run on a Raspberry Pie :-)

    But, and a very big one it is, I am not a programmer. I have seen 10000s of EEG's and know a lot of Neurofeedback. But the max I can do is write a BASH script. I have a nephew that is able to do programming, I hope he will help. And when I have a running device I will contact a friend of mine who is running a hackerspace in Almere (http://sk1llz.nl/blog/)

    Also. for the evoked potentials I guess that we will be needing some kind of filtering. But I will look into that when I have the OpenBCI running. And that is not the case at the moment. I am RTFM-ing

    Warm greetings,

    Paul



  • wjcroftwjcroft Mount Shasta, CA
    edited December 2014
    Kevin, Paul, hi.

    There are a number of posts on the forum mentioning BioExplorer, BioEra, neurofeedback. Search box at lower right of topic page will find these. Pete Van Deusen's Bioexplorer neurofeedback protocols are well respected, documented, and in use by a large number of home-trainers. I use both BioEra and BioExplorer here with Pocket-Neurobics hardware. Bioexplorer (and BioEra, OpenViBE) will work as soon as we have OpenEEG emulation working as an option with the OpenBCI firmware (new command code character to enter OpenEEG mode.) Chip's V2 code to do this is on his Github. Just needs porting to V3 and integration with the command parser.

    BrainBay is quite usable and already comes with a number of sample neurofeedback session protocols. See the CONFIGURATIONS/EEG subfolder. Pete's protocol library is way beyond this level, but Brainbay users will be able to get quite a good start, and later decide if they want to try a commercial package. Brainbay can be built with Visual Studio, but also with open source build chains. (See the developer pdf.)

    I've looked at the function blocks in OpenViBE compared to the others mentioned above. OpenViBE is really geared towards BCI signal processing programmers. And would be a daunting platform for neurofeedback home trainers. It has limited functionality built-in for those wanting to do biofeedback protocols.

    It's possible we could get Larry Janow (Bioexplorer author) to do a native driver for us. Unfortunately he is not very responsive to emails or queries. However if persuaded with the prospect of substantial new customers, he might be more open.

    Jarek Foltynski, BioEra author, on the other hand is very responsive to new drivers / features for his BioEra package. However this is an advanced design environment and would not be the best choice for beginners.

    I also support your idea of some type of new neurofeedback design environment, that would scale across platforms. It would not have to be necessarily VPL "visual programming language" (block wiring) oriented as the others mentioned above. But you would face a substantial amount of reinvention inertia to overcome. One thing I notice with the VPL oriented platforms, is that they work fine up to a modest level of complexity. But past a certain point, they become challenging to maintain the designs, as there is no concept of source control, diff-ing between versions, etc. Some type of "intermediate flow control" language would be beneficial. The same elements as the VPL blocks, but described say in terms like Python would, with nested paragraphs and 'arguments'. (Preferably with named / keyword arguments.)

    A consideration of interpreted languages such as Processing / Python, is that some of the element blocks (such as filters) take considerable processing cycles. So if an interpreter is used, it will have to support callouts to C, C++ functions / libraries, that can handle the heavy lifting.

    Best regards,

    William Croft

  • wjcroftwjcroft Mount Shasta, CA
    edited February 2015
    Found some folks using Python / Cython for realtime signal processing:

    https://www.google.com/search?q=realtime+signal+processing+python

    http://bastibe.de/2012-11-02-real-time-signal-processing-in-python.html

    --

    Another realtime VPL (audio processing oriented) I did not mention is PureData / Max .

    https://en.wikipedia.org/wiki/Pure_Data

    http://www.pd-tutorial.com/  http://en.flossmanuals.net/pure-data/

    --

    Val Brown actually used another VPL, National Instruments LabView, to build his Zengar NeurOptimal system,

    http://www.ni.com/labview/

    There is now a LabView toolkit for OpenBCI, see

    http://openbci.com/forum/index.php?p=/discussion/274/labview-openbci-toolkit
  • Thank you William for your response.

    I will look into it when I have a running system. I am confident we can at least do something in this direction.

    As to BioExplorer, there a lot of professionals in the Netherlands that use this program. I play around with it as well, but not on clients. The writer is notorious for slow email response though ;-) For windows a .dll would probably be enough.

    As to Val's toy I can not say much about that without getting severe legal issues. I was the one that put a 10 Hz signal into his system, proving it did not do what he said it did at that time. He kicked me out of the forum and community for that ;-)

    I go on and struggle with the documentation now to get a working system. Still a bit afraid for a RTFM.

    Although I can't find the "M" :-(

    Warm greetings,

    Paul
  • BioEra Pro now has a driver for OpenBCI.  I will be creating a set of designs/protocols for Neruofeedback in the coming days.  I will share these with the OpenBCI community for those who wish to do NFB training.  The designs will be unlocked so users can feel free to examine and modify them.  I could also offer some consultation on use of the software, as it is tricky to learn the design creation process.  It you have ideas as to what you would like to see in a design feel free to get in touch.


    George Martin
  • Hi George,

    Just wondering. How would you make a 2 channel design? I put A1 + A2 on one (1) SRB by using a cable to connect the both.

    And does the test version of BioEra timeout or does it have less functionality?

    Your name does ring a bell.

    Warm greetings,

    Paul
  • Paul,

    The Demo version of BIoEra does time out and does not allow for design creation,   The newest full version 3.183 is the version that has the OpenBCI drivers

    George
  • Why go to all the trouble of creating open source hardware and then not finish the job by creating open source software? Last year I conducted research for the Australian Defence Force on open source hardware and software in research, specifically biological sensors and psycho-physiology. One of the findings of that research was the problem with propriety software in that the methods of protecting the copyright always interferes with the functionality of the software (in particular with the ability to inter-operate with other software). The other issue is that there is no incentive for the manufacturer to maintain or improve the software once they have your license fee. No wonder the writer of BioExplorer is slow to answer emails, what is the incentive?

    As I have said before, the beauty of open source software is that everyone can suit themselves. I will be working with anyone who wants to create great open source software written in Python. There are many good reasons for choosing this language, which i can go into if anyone is interested. There are several packages that we should be looking to link in with:  mushu, wyrm and pyff as well as labstreaminglayer, Kivy and Psychopy. Pandas, Plotly and the iPython IDE could also fill the role of reporting, to give clients nice visual displays of their progress.

    OpenVibe and BCI2000 are great but things have moved on since they were created and I think we can do something better.

    Please don't mistake my bluntness for unwillingness to discuss any of these issues. I thought it was better to say exactly what my opinion is rather than try to be too diplomatic and not bring up the issues that I think are important.

    It might be necessary to make a decision about if it should be simple for someone who knows no programming to start or if it should be configurable and open to experimentation but require a level of programming knowledge.

    My main aim is to develop neurofeedback protocols and conduct research into Neurofeedback treatment.

    I also want to use it for BCI.

    I think the work Keturn has done is very promising and I'd be happy with the idea of Keturn being lead developer of this Python/Kivy software idea for the OpenBCI board. Opening this discussion is an example of how Keturn conducts things. I also like the look of the plans Keturn has for the future of the txOpenBCI project.

    ## Brain dump complete
  • biomurphbiomurph Brooklyn, NY
    Great thread!

    We are very excited to have been picked up by already existing software platforms like brainBay and BioEra. Many folks are already plugged into those tools, and it's great to be welcomed into those communities!

    memebrain, I am totally with your spirit there. OpenBCI is committed to Open Source in what we do, and the goal is to offer and share free software solutions to some of these most interesting and useful applications of BCI. Open source neurofeedback therapy software and a P300 speller would be dope! Conor and I are not quite scientists (though we think we're scientific) so we are not going to be able to pull that kind of thing off. That's where you and the community we're building together come in.
    I also think that Python is a very good platform for this. As is Open Frameworks, and even Processing. 

    Looking forward to the year in brains!
  • wjcroftwjcroft Mount Shasta, CA
    BrainBay neurofeedback tutorial and sample design is posted, see,

    http://openbci.com/forum/index.php?p=/discussion/90/brainbay-install-neurofeedback-design

    William

  • edited March 2016
    Dear community,

    I am checking sometimes, if there are any news around this thread and it
    doesn't seem to develop since last year. I was recently very close to hire
    someone to write a Bio Era support for OpenBCI, but I have to admit, I prefer
    to have it open source. This being said, I also have to admit that I don't have any programming skills which makes all of that quite hard to tackle (I started to learn Python ones on my own, but I don't have any idea how much I would need to know/ time to invest, in order to be able to create something helpful :P). I would be
    willing though to invest other ressources, if that can be helpful to advance
    the process. I am really keen on using Open BCI in a clinical context, as I am
    a psychotherapist and it's a pity that I couldn't so far. So, if you guys see
    any way how I can contribute, shoot!!!

    I would be also happy to be filled in, if there has been things going on
    since last year.

    That's it for the moment. Maybe this discussion can be revived.

    Heike

  • wjcroftwjcroft Mount Shasta, CA
    Neuromore is another VPL visual programming language, that is now available. The Community edition is free.

    http://openbci.com/forum/index.php?p=/discussion/469/neuromore-studio-new-free-visual-programming-language-vpl-for-openbci

    What kinds of neurofeedback training have you done in the past and what do you hope to do with OpenBCI? The upcoming Ganglion operates at 256 samples per second, which has the potential to emulate one of the Bioexplorer compatible amplifiers (such as OpenEEG). This would then allow use of Pete Van Deusen's Brain-Trainer NFB protocol suite. But of course would require purchasing Bioexplorer and Pete's package.

    [note on the forum software we use here: cutting / pasting from Microsoft Word often produces poor formatting; just type your post directly into the comment box. Or use a plain text editor.]

    William

  • Thanks a lot for the neuromore advice.

    I would like to train the different wave lengths (SMR up. Theta down). I am also interested in the Rosenfeld protocol for example.

    When you talk about the sampling rate of the upcoming ganglion, does that mean that I will encounter problems with the current one anyways? Will it be possible at all to use it with Bio Era (if I have an interface programmed?) etc from this perspective or is the sampling rate too low in general?

    I am considering to hire someone to build a program from scratch, as I intend do purchase some more openBCI ganglions. Where could I find programmer's who have knowledge in the NFB background?

    Thanks a lot,

    Heike
  • wjcroftwjcroft Mount Shasta, CA
    Heike,

    Do you currently have an OpenBCI v3 (8 bit or 32 bit)? Or did you participate in the Ganglion Kickstarter?

    The trainings you mention are straightforward band amplitude trainings. This is easy to do in any of the VPLs such as BrainBay, BioEra, or neuromore. All of these support the current v3 OpenBCI boards. And will support the Ganglion when it is released. Bioexplorer does NOT support OpenBCI at present. So Pete's protocol package is not an option. But your protocols are simple enough, that you or your engineer can set those up with a VPL.

    As an example of a simple alpha up, beta down single channel amplitude training with BrainBay, see,


    > does that mean that I will encounter problems with the current one anyways?

    No, all sample rates will be supported, both the original 250 s/sec and the Ganglion 256 sps. Since Ganglion may in the future have an OpenEEG emulation mode, that could potentially allow it to work with Bioexplorer and Pete's protocols. But that will probably not be available immediately when the Ganglion starts shipping. (Technical note: OpenEEG emulation requires 256 sps and hence is incompatible with our original 250 sps.)

    > Where could I find programmer's who have knowledge in the NFB background?

    "Build from scratch" is fairly straightforward with the VPLs. There will likely be protocol sharing going on in various public forums and file exchange areas. neuromore will in the future support a way for developers to share their designs with end users via their cloud file server. With the other VPLs, the sharing is just done by downloading manually the 'design' input file to the VPL.

    In addition to this OpenBCI forum, some others are:


    Regards,

    William

  • Thanks a lot William,

    I have the 32Bit V3 Version and I will look into all these options.

    Best,

    Heike
Sign In or Register to comment.