Connecting OpenVibe with BCILAB using labstreaminglayer

Come here to discuss about OpenViBE in general!
Post Reply
sumitsoman
Posts: 16
Joined: Thu Oct 11, 2012 11:24 am

Connecting OpenVibe with BCILAB using labstreaminglayer

Post by sumitsoman »

Hi,

We wanted to use EEG data recorded from the BrainProducts ActiChamp EEG system for online analysis in BCILAB. http://sccn.ucsd.edu/wiki/BCILAB

Apparently, this can be done using Lab Streaming Layer https://code.google.com/p/labstreaminglayer/.

LSL provides a version of the OpenVibe Acquisition Server that allows its recording application to read data that is read by the OpenVibe Acquisition Server (OVAS). This is provided as OVAS-for-LSL https://code.google.com/p/labstreaminglayer/wiki/OVAS.

However, this distribution does not have the driver for ActiChamp EEG device in the list, so we are not able to connect the OVAS to the EEG device. Any way the Actichamp driver provided in the OpenVibe v0.15 can be integrated into this version of the OpenVibe acquisition server?

Thanks

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by toncho11 »

Hi,

I had a look at it. It is nice to see the signal forwarded from OpenVibe to Matlab in real-time. There are students in my lab that we will prefer it like this.

It could be done in several ways:

1) The driver is integrated in OVAS LSL version - doable, but then when you recompile you need ActiChamp SDK. So I myself not having this SDK (headers and libs) - I can not produce such executable that has both.

2) The LSL streaming implemented in 0.14 by the LSL team is transferred to 0.15 version (which has the driver), but then I do not have the SDK again.

3) A box for the OpenVibe designer is probably the best thing in the sense that this way any device supported by the AS can be streamed through LSL. This way you do not provide a custom version of the AS that lowers the number of supported devices. A drawback is that you will need to start two applications: the AS and the Designer. Bu then you can read files with OpenVibe readers and stream them to Matlab.

If I have some time then I might be able to produce this box.

The opposite can also be useful because I see that LSL supports some devices, not provided by the OpenVibe AS. For us this will be Biosemi and Eyelink eyetracker.

Anton Andreev,
Gipsa-lab

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by toncho11 »

Done.

The Gipsa-lab extensions dll version 2.1 now contains the box for the streaming you need :
http://code.google.com/p/openvibe-gipsa ... /Downloads

It works well with Matlab.

Also with C++. You can acquire the signal from OpenVibe using the following code:

Code: Select all

#include "../../../include/lsl_cpp.h"
#include <vector>
#include <iostream>
using namespace std;

/**
 * This is a minimal example that demonstrates how a multi-channel stream of a particular name (here: OpenVibe Stream) can be 
 * resolved into an inlet, and how the raw sample data & time stamps are pulled from the inlet.
 */

typedef float float32; 

int main(int argc, char* argv[]) {
	using namespace lsl;

	// resolve the stream of interest & make an inlet to get data from the first result
	std::vector<stream_info> results = resolve_stream("name","OpenVibe Stream");
	
	stream_inlet inlet(results[0]);

	int NbChan = results[0].channel_count();

	// receive data & time stamps forever (not displaying them here)

	std::vector<float32> sample(NbChan);
	while (true)
	{
		double ts = inlet.pull_sample(&sample[0],NbChan);
		std::cout << "channel 1: " << sample[2] <<"\n";
	}
	
	return 0;
}
Have fun,
Anton

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by toncho11 »

Stimulations can also be exported now.

toncho11
Posts: 124
Joined: Tue Apr 19, 2011 7:58 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by toncho11 »

The LSL Export box by Gipsa-lab is now integrated by Inria in the latest source code of OpenVibe - after 0.17.

Please test and report back.

sumitsoman
Posts: 16
Joined: Thu Oct 11, 2012 11:24 am

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by sumitsoman »

We managed to setup OpenVibe 0.17 with the GIPSA extension 2.1 compatible with this version.

However, we are not able to "connect" and "play" the Actichamp with the OpenVibe Acqusition Server. The following is the error log:

Code: Select all

[  INF  ] Connection succeeded !
[  INF  ] Starting the acquisition...
[  INF  ] Now acquiring...
[WARNING] After 5000 milliseconds, did not receive anything from the driver - Timed out
[  INF  ] Stopping the acquisition.
[  INF  ] Disconnecting.
Though the Actichamp device does link with then native Actichamp Connector provided by LSL https://code.google.com/p/labstreamingl ... /ActiChamp, But the OpenVibe Acquisition Server is unable to connect.

When we try to configure the driver properties for ActiChamp in OpenVibe Acquisition Server, on clicking "apply", the application stops working and gives the following error message:
Error Message on applying driver properties for Actichamp in OpenVibe Acquisition Server
Error Message on applying driver properties for Actichamp in OpenVibe Acquisition Server
Error.png (33.2 KiB) Viewed 27138 times
How can this be resolved?


sumitsoman
Posts: 16
Joined: Thu Oct 11, 2012 11:24 am

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by sumitsoman »


This would require building from sources? It doesn't seem to be part of the binaries of Openvibe 0.17.

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by lbonnet »

Hi sumitsoman!
I'm Laurent Bonnet, working at Mensia Technologies. Maybe I can help on that ;)

Recent bug reports indicated that the actiCHamp driver was indeed not working properly with openvibe 0.17.0.
We contributed a patch recently that corrects some bugs, included the error while configuring the device (integrated in release 0.17.1), but the "timeout" error you get here is still present (no samples received).
This is due to the driver not finding a specific actichamp file when running.

We are still discussing the best way to correct this ASAP!
Meanwhile, a very easy quickfix can be performed:
  • Go into openvibe installation folder (default should be something like C:/Program Files (x86)/openvibe)
  • Go into the folder bin
  • Copy the file ActiChamp.bit
  • Go back one folder level up (into the root installation folder)
  • Paste the file
This seems trivial to correct but actually this bug highlighted some side effects of the software path management, we need to find the best solution to handle this.

I hope this helps!
Laurent-
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

madi
Posts: 9
Joined: Sat Nov 05, 2016 12:47 pm

Re: Connecting OpenVibe with BCILAB using labstreaminglayer

Post by madi »

Hello everyone!

I have a BrainMaster Discovery 24E amplifier which is not present in the lab streaming layer Supported EEG Hardware https://github.com/sccn/labstreaminglay ... vices.wiki

Since BrainMaster Discovery 24E is present in the OpenVIBE supported hardware, I record raw EEG using BrainMaster amplifier but then I want to transfer those recorded data in edf or gdf file format to BCILAB for analysis.

Can anyone suggest me on how to export OpenVIBE recorded EDF or GDF files in BCILAB for Offline analysis?

Best Regards,
Madi

Post Reply