Driver for ModularEEG / OpenEEG

Making & changing box plugins and external apps
mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

hi

well i dont understand, i do an epoch average , of let say 3 block. it should then average the last 3 epoch i guess.
and when i display the results its exactly the same as the last epoch. as if no average was done.
could you explain ?

for the modular i'll post a bug report asap.

also a little feature, would it be easy to set up thet the setting/options windows always stays in front of the main window.
right now when they get hidden behind the main window, this one get stuck and you have to lower all windows to find the one that stuck them in the desktop.

also, i'd like to average the signal but my way (i.e. on the last 10 sample for ex). right now its always done according to the sample of the aqcuisition server. not very practicle.

finaly, using the common average reference. as i understood , it shall normalize each channel on the average of both right.
if you have channel 1 and 2 as c1 and c2 , the new signals should be C1= c1/(c1+c2)/2 and C2 = c2/(c1+c2)/2.
when i plot it they are in fact symetric. i.e. C2 = -C1 , why ?

m

ChangeWind
Posts: 9
Joined: Wed Nov 25, 2009 11:16 am

Re: Driver for ModularEEG / OpenEEG

Post by ChangeWind »

Hi mswynghedauw,
Could you explain is there a relationship between Neuroserver used by brainBay and the Driver of modularEEG you wrote? BrainBay use Neuroserver for accessing different drivers and I like to hear your view. CW.

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

brainbay has a nice working driver for the modularEEG. i just import the src of this driver into openvibe.
the driver is pretty easy, i was just lazy.
anyway mine work fine into openvibe. the one in the release doesnt. maybe i'm not using it the proper way. it seems to get stuck into the loop() awaiting for a too big buffer.

m

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

i forgot to mention, brainbay doesn not nescessary need neuroserver to connect.

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Driver for ModularEEG / OpenEEG

Post by yrenard »

Dear mswynghedauw, sorry for late reply, I've been quite busy these days.
mswynghedauw wrote:also a little feature, would it be easy to set up thet the setting/options windows always stays in front of the main window.
Please post a bug report about this.
mswynghedauw wrote:also, i'd like to average the signal but my way (i.e. on the last 10 sample for ex). right now its always done according to the sample of the aqcuisition server. not very practicle.
Just fix the windows size as you want puting a time based epoching before your averaging.
mswynghedauw wrote:... the new signals should be C1= c1/(c1+c2)/2 and C2 = c2/(c1+c2)/2. ...
Indeed, the common average box does not do what you are expecting. The common average substracts to each channel the mean of all channel. So you should expect the following result :
C1= c1 - (c1+c2)/2 and C2 = c2 - (c1+c2)/2

The behavior your are expecting should most probably be named "normalization something".
mswynghedauw wrote:... the one in the release doesnt...
Christoph Veigl should contact you about this, he supposes you have a different firmware version.

Hope it helps,
Best regards,
Yann

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Driver for ModularEEG / OpenEEG

Post by yrenard »

mswynghedauw wrote:hi
well i dont understand, i do an epoch average , of let say 3 block. it should then average the last 3 epoch i guess.
and when i display the results its exactly the same as the last epoch. as if no average was done.
could you explain ?
Also, concerning this question, I see no problem with the average. I attached a sample scenario that you can test yourself. Press A to get a new epoch... Top widgets show the last epoch you selected, bottom left shows the average of the last 4 epochs at every new epoching and the bottom right one shows the average of the last 4 epochs every 4 epochings.

I hope this illustrates the behavior correctly.

Best regards,
Yann
Attachments
test-average.xml
(24.35 KiB) Downloaded 293 times

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

thank for your reply

i used your example, and i dont understand the result. i set the epoch count to 1 in both epoch average. this means no average. i'd expect the result to be the same as the incoming epoch.
but i get that (see pict attached). the signal is weird.


could you explain?
Attachments
epoch2.rar
(200.38 KiB) Downloaded 314 times

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Driver for ModularEEG / OpenEEG

Post by yrenard »

mswynghedauw,

based on the scenario I attached in previous post and modifying epoch average setting to 1 instead of 4, I can't reproduce the bug you are pointing out, neither on Windows nor Linux. Can you send me your actual scenario ? In any case, averaging a single epoch sounds like loss of time and CPU ;o)

Yann

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

hi,
averaging over 1 count is just a test to see that the black box i'm using is doing what i want and that its not bugged.
i'm using the exact scenario you sent (see attachement). by just changing the count to 1.
i use the last V4 that i just recompile.
Attachments
test-average.xml
(24.34 KiB) Downloaded 285 times

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

hi

forget it, in the compilation i was linking to an outdated bugged lib.
it work now.
thank for the help.

talking about black boxes. i usually like to view what i'm doing before doing crazy statistics. in particular before feeding some trainer with choosen epoch
i like to view them. usually you know the relevance of a statistic by just looking at it.

how hard i'd be to be able to plot on a same plot each epoch, the average and the chi2 (or sigma) of the average ?
in much the same way it is done usually in the litterature.

also , it says openvibe can connect matlab, where ?

m

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Driver for ModularEEG / OpenEEG

Post by yrenard »

Dear mswynghedauw,

you should be able to plot the epochs altogether by either studying the code of the signal display and adapt it to your needs, or export the epochs to a CSV file which is really straight forward to read whith whatever programming language fits your needs to display it (e.g. python).

Concerning the MATLAB integration, there is a plugin that compiles for Linux. It is in openvibe-plugins/matlab and is not compiled by default. You can request its compilation with your linux-init_env_command and you'll have the MATLAB filter box available. This box takes a signal and associated stimulations and outputs a modified signal. It will use two .m files, one for initialization and one for processing. This box is in beta stage but works... There is still a lot of place for contribution here. Feel free to join us on IRC to discuss this if you are interested ! In any case, feedbacks are welcome.

Yann

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

hi yann

well honestly, i'm becomming a little discouraged by the complexity of the codes of openvibe , especially for an open source (no offence...)
adapting the existing codes to my needs is a lot of time consuming (when you're not the original developper), not talking about debugging (too many template kills...).
and it is less time left for true research.
i'd need basic statistical/viewing/stimulation tools in real time of ERPs for ex. (ex when i average i like to have the signification of the average (sigma), making operation on multiple input signals ,plugging video /audio/midi, etc..).

i'm looking at the same time at brainbay, which on the other hand is much lighter and more straigh forward to add ressources.

i'll keep you updated on my level of discouragement..

m

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Driver for ModularEEG / OpenEEG

Post by yrenard »

Dear mswynghedauw,

sorry for late reply,
well honestly, i'm becomming a little discouraged by the complexity of the codes of openvibe , especially for an open source (no offence...)
no offence, really ;) It's nice you tell us that you feel discouraged instead of leaving the place silently. Hope we can continue the discussion however. What do you mean "especially for an open source" ? And what particular complexity do you find in the code ? I expect the API to be very clear and documented. Of course, taking some existing code in order to modify it mostly depends on the programmer style and may vary from a file to another...
adapting the existing codes to my needs is a lot of time consuming (when you're not the original developper)
You are talking about the signal display here, right ?
If you look at the history, this visualization box is the first one we did... So it has all the defaults of the begining. Don't know how deep in the code you digged... but the callback system at this time was far too complicated. It is far easier today with the stream encoders/decoders.
not talking about debugging (too many template kills...).
I tried to avoid templates as much as possible.
i'd need basic statistical/viewing/stimulation tools in real time of ERPs for ex. (ex when i average i like to have the signification of the average (sigma), making operation on multiple input signals ,plugging video /audio/midi, etc..).
Right, as stated before, this is currently missing, basically because we never needed it. We visualize P300 ERPs in realtime with the signal display as explained before but that's all what we needed until now. On one hand, we hope that the community can contribute, on the other hand, we can place such feature in the roadmap but we also have research to do ;) and can't do everything in the short time.
i'm looking at the same time at brainbay, which on the other hand is much lighter and more straigh forward to add ressources.

i'll keep you updated on my level of discouragement..
Well, I hope you'll find something in OpenViBE that will let you come back ;)

Do you think that including a scripting language such as python in OpenViBE would help people to quickly develop their own feature prototypes before C++ developments could be done ?

I hope you'll stay with us and again, concerning the sound stuff with SDL, feel free to submit your contributions ;) this is what makes opensource so powerfull. People contributions = faster development !

Yann

Chris Veigl
Posts: 6
Joined: Wed Jul 15, 2009 10:43 pm

Re: Driver for ModularEEG / OpenEEG

Post by Chris Veigl »

hello mswynghedauw (?),
also i tried the driver for the modularEEG in the v4 and it does not work. i rewrote another one that work (for me...) based on the src available from brainbay.
could you describe these troubles in more detail ?
- i used exactly the same P2 - protocol parser for the OpenVibe driver as in brainbay...
do you maybe use another protocol liek P3 or P21 ?


regards,
chris

mswynghedauw
Posts: 13
Joined: Thu Sep 10, 2009 8:44 am

Re: Driver for ModularEEG / OpenEEG

Post by mswynghedauw »

hi chris,

long time i hacnt checked that forum.

i posted my codes for the driver of the P2. (into the acquisition server/modulareeg post in the forum).
i had the same trouble as him in the loop.
i rewrote the codes and now it work fine.

i use the ModularEEG P2, with a USB/RS232 cable on windows 7.

marc

Post Reply