OpenVibe & Matlab & Real-time
OpenVibe & Matlab & Real-time
Hello! We are a group of spanish students. We are trying to get a real-time EEG signal processing system based on an openEEG hardware , the openVibe software and Matlab. We don't know yet how to communicate openVibe with Matlab. It would be very precious to us if someone could help us. Thank you!
Regards.
Regards.
Re: OpenVibe & Matlab & Real-time
Dear JavierJ,
first, thank you for your interest in OpenViBE and welcome on this board... I'm glad some people get interested in the Matlab/OpenViBE integration.
For now, Matlab can only be used with OpenViBE under Linux OS. Are you using Linux ? Then you should enable the build of the Matlab plugin branch, editing your linux-init_env_command file and adding the $OpenViBE_plugin_matlab to your OpenViBE_build_order (see around line 178). I expect this will build the Matlab box.
Additionally, this box being experimental, you will have to modify your configuration file to make it appear in the designer... Just edit your ~/.openviberc file and add the following line :
You will find the Matlab box under Tools.
Tell us if you have any problem.
Best regards,
Yann
first, thank you for your interest in OpenViBE and welcome on this board... I'm glad some people get interested in the Matlab/OpenViBE integration.
For now, Matlab can only be used with OpenViBE under Linux OS. Are you using Linux ? Then you should enable the build of the Matlab plugin branch, editing your linux-init_env_command file and adding the $OpenViBE_plugin_matlab to your OpenViBE_build_order (see around line 178). I expect this will build the Matlab box.
Additionally, this box being experimental, you will have to modify your configuration file to make it appear in the designer... Just edit your ~/.openviberc file and add the following line :
Code: Select all
Designer_ShowUnstable = true
Tell us if you have any problem.
Best regards,
Yann
Re: OpenVibe & Matlab & Real-time
Hello Javier and welcome on board !
Openvibe communicates with Matlab through a dedicated plugin (a.k.a. a dedicated box).
Basically, the Matlab box can execute matlab code, once you provide it your local matlab engine and matlab code. However, this box has not been fully tested yet (we didn't have enough feedback from potential users, but we are working on it) and is only available on the forge.
Thus you will have to download the source code using subversion, and build the sources. As Yann pointed at, you will have to do minor changes to the scripts so the matlab branch is being built.
Thanks for your interest in the project, and feel free to post more questions on the forum, we will do our best to answer it quickly.
Laurent
Openvibe communicates with Matlab through a dedicated plugin (a.k.a. a dedicated box).
Basically, the Matlab box can execute matlab code, once you provide it your local matlab engine and matlab code. However, this box has not been fully tested yet (we didn't have enough feedback from potential users, but we are working on it) and is only available on the forge.
Thus you will have to download the source code using subversion, and build the sources. As Yann pointed at, you will have to do minor changes to the scripts so the matlab branch is being built.
Thanks for your interest in the project, and feel free to post more questions on the forum, we will do our best to answer it quickly.
Laurent
Re: OpenVibe & Matlab & Real-time
Thank you for the quick reply! We are not working with linux, due to the fact that we are not "good experienced" linux users. For now, we are studying if we can make it run, based on a simulink solution. If we don't find something interesting in simulink, maybe we will turn back to the linux implementation. I will keep you up to date if we start to develop the solution under matlab with open vibe.
Thank you for your attention!
Regards!
Thank you for your attention!
Regards!
Re: OpenVibe & Matlab & Real-time
Dear JavierJ,
I believe porting the box to windows is very straight forward. I will give it a try immediately and keep you posted.
Best regards,
Yann
I believe porting the box to windows is very straight forward. I will give it a try immediately and keep you posted.
Best regards,
Yann
Re: OpenVibe & Matlab & Real-time
Dear JavierJ,
I just uploaded a few changes to the CMake / init-env-command scripts so that you can compile the MATLAB box on Windows.
Please follow those steps to get it working :
- update to the latest SVN repository,
- edit your win32-dependencies.cmd file and add the following line with whatever path meets your installation :
- remove your win32-init_env_command.cmd file and update it with the new win32-init_env_command.cmd-skeleton
- edit your fresh win32-init_env_command.cmd file and request the compilation of the matlab plugin (see and uncomment around line 212)
- run win32-build.cmd
If any problem occurs, please send me the files I mentioned above and the output of your win32-build.cmd console.
You will find the box in the Tools section. In order to use it, provide a path where you put two .m files such as those ones :
and
Tell me if it works.
Kinda regards,
Yann Renard
I just uploaded a few changes to the CMake / init-env-command scripts so that you can compile the MATLAB box on Windows.
Please follow those steps to get it working :
- update to the latest SVN repository,
- edit your win32-dependencies.cmd file and add the following line with whatever path meets your installation :
Code: Select all
SET OV_DEP_MATLAB=c:/program files/matlab/r2009b
- edit your fresh win32-init_env_command.cmd file and request the compilation of the matlab plugin (see and uncomment around line 212)
- run win32-build.cmd
If any problem occurs, please send me the files I mentioned above and the output of your win32-build.cmd console.
You will find the box in the Tools section. In order to use it, provide a path where you put two .m files such as those ones :
Code: Select all
% bci_Initialize.m
function result = bci_Initialize(bci_context, matrix)
[sample_count, channel_count] = size(matrix)
result = zeros(sample_count, channel_count)
Code: Select all
% bci_Process.m
function result = bci_Process(bci_context, stimulation_set, matrix)
plot(matrix)
[sample_count, channel_count] = size(matrix)
result = matrix
Kinda regards,
Yann Renard
Re: OpenVibe & Matlab & Real-time
Hello Yann!
I already have the latest SVN repository version, but i can't find the win32-dependencies.cmd file.
Where is it?
Thank you!
I already have the latest SVN repository version, but i can't find the win32-dependencies.cmd file.
Where is it?
Thank you!
Re: OpenVibe & Matlab & Real-time
Hi Javier !
If I remember correctly, win32-dependencies.cmd is generated automatically when you install the dependencies (using the dependencies installer given in /trunk/scripts).
Best regards,
Laurent
If I remember correctly, win32-dependencies.cmd is generated automatically when you install the dependencies (using the dependencies installer given in /trunk/scripts).
Best regards,
Laurent
Re: OpenVibe & Matlab & Real-time
Hi,
I too am working on Open-ViBE + Matlab + an external VRPN server on the closest-to real-time basis possible. I succeeded in building Open-ViBE with the Matlab toolbox, but now I experience difficulties to use it.
To test the box, I used a simple Process.m file, which only divides the input matrix by 2:
I did not change Initialize.m:
On Open-ViBE I created a scenario in which I put:
GDF File Reader ----> Matlab Filter ----> GDF File Writer
(At first I wanted to use Signal Display, but it proved to be quite slow...)
Also : - The GDF I use is not corrupted because Matlab processes it with no difficulty.
- I did specify the working directory in the Matlab filter parameters.
Unfortunately the output GDF is empty.
What could be the problem? Thanks in advance.
I too am working on Open-ViBE + Matlab + an external VRPN server on the closest-to real-time basis possible. I succeeded in building Open-ViBE with the Matlab toolbox, but now I experience difficulties to use it.
To test the box, I used a simple Process.m file, which only divides the input matrix by 2:
Code: Select all
function result = bci_Process(bci_context, stimulation_set, matrix)
result = matrix./2;
Code: Select all
function result = bci_Initialize(bci_context, matrix)
[sample_count, channel_count] = size(matrix);
result = zeros(sample_count, channel_count);
GDF File Reader ----> Matlab Filter ----> GDF File Writer
(At first I wanted to use Signal Display, but it proved to be quite slow...)
Also : - The GDF I use is not corrupted because Matlab processes it with no difficulty.
- I did specify the working directory in the Matlab filter parameters.
Unfortunately the output GDF is empty.
What could be the problem? Thanks in advance.
Re: OpenVibe & Matlab & Real-time
Dear Johann,
Thank you for your interest in our software and welcome on this board.
I think you should rename your Process.m to bci_Process.m.
Tell me if that helps,
Yann
Thank you for your interest in our software and welcome on this board.
I think you should rename your Process.m to bci_Process.m.
Tell me if that helps,
Yann
Re: OpenVibe & Matlab & Real-time
Thank you, unfortunately I misspelled the name of the file on my last post; I did call the two files bci_Process.m and bci_Initialize.m
Any other idea?
Any other idea?
Re: OpenVibe & Matlab & Real-time
Dear Johann,
what if you try to plot the input matrix ? is it working ?
Yann
what if you try to plot the input matrix ? is it working ?
Yann
Re: OpenVibe & Matlab & Real-time
Thanks for your answer. Yes, the plotting of the matrix works, there are values and colors. It is quite slow and the cmd window indicates that it could not reach real-time, but it works.
The display of the signal is OK too (in scan mode though, because the scroll mode is really slow).
It obviously comes from the Matlab Filter, but I have no clue why...
The display of the signal is OK too (in scan mode though, because the scroll mode is really slow).
It obviously comes from the Matlab Filter, but I have no clue why...
Re: OpenVibe & Matlab & Real-time
Dear Johann,
what if you try the sample scripts I posted earlier in this thread ?
Yann
what if you try the sample scripts I posted earlier in this thread ?
Yann
Re: OpenVibe & Matlab & Real-time
Thanks again,
Nope, even with the simplest code, the output matrix is still empty. The Signal Display and the Matrix Display boxes show nothing, and an analysis under Matlab confirms it (plus the output file is only 244 bytes, every time - I guess it's the size of a basic empty GDF file, containing only the headers).
When I launch the process under OV, the Matlab Command window appears (it looks like Windows' cmd.exe window, written black on white), but nothing happens, it just stays blank.
Any other idea?
Nope, even with the simplest code, the output matrix is still empty. The Signal Display and the Matrix Display boxes show nothing, and an analysis under Matlab confirms it (plus the output file is only 244 bytes, every time - I guess it's the size of a basic empty GDF file, containing only the headers).
When I launch the process under OV, the Matlab Command window appears (it looks like Windows' cmd.exe window, written black on white), but nothing happens, it just stays blank.
Any other idea?