Comma confusion in output format of OpenBCI_GUI ?

edited November 2016 in OpenBCI_GUI
Hi there, I have a question regarding the output format of the openbci. The output format is comma-seperated but unfortunately there are commas in the values as well. This means that a statistics program used to analyse the data will either seperate variables also within the values or not recognise the values as numeric and declare them as factors. We thought of writing an algorithm which replaced a comma followed by a space just with a space, since we have a lot of data it unfortunately takes ages to run through the huge files. Also it is not very elegant. So my question is whether there is a way to change the output format of the openbci to space-seperation. This would make it much easier for anyone to analyse data. Any help is much appreciated! Cheers!

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Kito, hi.

    Can you show a few lines (only need say 3 lines) of your GUI output file here? There should be only commas as separators.

    William

  • Hey William,

    thanks for your quick response. Here are a few lines:

    17, -33449,99, 0,00, 12767,41, 0,00, -12278,37, 0,00, 0,00, 0,00, -0,01, -0,02, 0,98
    18, -33468,65, 0,00, 12775,38, 0,00, -12303,88, 0,00, 0,00, 0,00, -0,01, -0,02, 0,98
    19, -33496,19, 0,00, 12772,77, 0,00, -12327,14, 0,00, 0,00, 0,00, 0,00, -0,02, 0,98
    20, -33481,08, 0,00, 12761,86, 0,00, -12313,40, 0,00, 0,00, 0,00, 0,00, -0,02, 0,98
    21, -33448,45, 0,00, 12754,80, 0,00, -12289,35, 0,00, 0,00, 0,00, 0,00, -0,02, 0,98
    22, -33432,96, 0,00, 12758,06, 0,00, -12288,81, 0,00, 0,00, 0,00, 0,00, -0,02, 0,98
    23, -33457,63, 0,00, 12765,55, 0,00, -12317,13, 0,00, 0,00, 0,00, 0,00, -0,02, 0,98
  • wjcroftwjcroft Mount Shasta, CA
    I'm going to mention @Conor and AJ @pushtheworld here.

    Conor, it looks like Processing is using some kind of 'localization' scheme to set the decimal point character to a country specific value. In this case comma. Was that a recent mod? I have not heard of any other complaints on this before. Can someone suggest a quick source level fix? Or should he change his OS localization setting to be United States or something like that?

    Regards,

    William

  • Sounds like a localization issue @wjcroft

    @kito what's you location preferences? 

    Maybe you can switch up the output to use tabs, vertical bars, or semi colons.


  • @pushtheworld and wjcroft: where can I change the localization to avoid the issue?
    Or how can I change the output format to tabs or vertical bars? I looked through the entire code of the openbci_gui and could not find a way to change the output format.
  • AndreaAndrea New York
    edited November 2016
    Hi @kito,

    In the original processing GUI it looks like the comma is appended on line 82 of dataFiles.pde. You can try changing that line to the delimiter you need for your project. :D
  • wjcroftwjcroft Mount Shasta, CA
    edited November 2016
    @kito, hi. "Localization" is set in the operating system. Usually in the Settings or Preferences panel of your OS. On Mac OS X, this is set in the System Preferences app, the subsection called "Language & Region". This subsection also has an Advanced button, where you can adjust the Decimal point character directly.

    On Windows,


    On Ubuntu, 

  • Hey everybody,
    thanks so much for your help and suggestions. I used the technique suggested by you, Andrea, and changed the code. And it worked.
    Many thanks!
  • @kito glad to hear it's working for you! Good luck!
  • I had this issue as well. I modified dataFiles.pde line 83 to work for computers running all cultures, not just US, by adding Locale.US to String.format in the writeValues method:

    output.print(String.format(Locale.US, "%.2f", scale_fac * float(values[Ival])));

    I've made a pull request for this fix.
  • marianamariana Germany
    edited April 2017
    Hallo, I'm trying to playback a file in OpenBCI-GUI Processing, Mac. 8 channels
    When I recorded the file I had just channel 3 and 4 on. The saved file looks so:

    %OpenBCI Raw EEG Data
    %
    %Sample Rate = 250.0 Hz
    %First Column = SampleIndex
    %Other Columns = EEG data in microvolts followed by Accel Data (in G) interleaved with Aux Data
    0, 0,00, 0,00, 16530,34, 23103,97, 0,00, 0,00, 0,00, 0,00, 0,08, 0,19, 0,99
    1, 0,00, 0,00, 16529,40, 23106,54, 0,00, 0,00, 0,00, 0,00, 0,08, 0,19, 0,99
    2, 0,00, 0,00, 16530,99, 23107,39, 0,00, 0,00, 0,00, 0,00, 0,07, 0,19, 0,96
    ...
    255
    0

    .... and so on ....

    When I try to playback it the OpenBCI-GUI gives the channel 3 in the 5, the
    channel 4 in the 7 and in channel 6 and 8 gives some information that I
    can't understand. What I'm doing wrong?
    Thaks in advance!
    Mariana


    https://lh3.googleusercontent.com/qTWfylHDyHVBGGt5LDNI0SNbb9oaoPtGvgdce38JZXSeEZHBGlkMmD3i8SopJMps-H495B8e=w2762-h1542
  • wjcroftwjcroft Mount Shasta, CA
    @mariana, hi.

    I merged your question into this previous thread. See the earlier posts. You can either (1) change your OS localization setting to use period instead of comma as the decimal separator. Or (2) do the source level change mentioned.

    It's possible the pull request mentioned by @wezzix has not made it into the distributed GUI files. Or you are using an old version of the GUI.

    William
  • this was patched in 2.1.2
  • @wjcroft thank you!!

    Indeed I have the GUI version from 2016. I have changed the source as @wezzix mentioned and it works fine now.

    best
    Mariana
Sign In or Register to comment.