lsl_archived icon indicating copy to clipboard operation
lsl_archived copied to clipboard

StreamViewer

Open JnewbieD opened this issue 10 years ago • 4 comments

Hi,
I am trying to use a compiled version of StreamViewer in Matlab to visualize data coming from a custom device that are developing in my team. I tried to follow two ways:

  1. Compile the matlab version, but it does not work if in the same matlab session a lsl_outlet has been started, it works if it is started in other matlab session, but I need to start from the same one.
  2. Compile the embarcadero version (I know anything of embarcadero) but it gave me 51 errors that I past below.

Do you have any suggestion? Thank you

[bcc32 Warning] Xml.XMLDoc.hpp(587): W8058 Cannot create pre-compiled header: initialized data in header [bcc32 Error] iosfwd(385): E2238 Multiple declaration for 'char_traits<wchar_t>::int_type' [bcc32 Error] iosfwd(136): E2344 Earlier declaration of 'char_traits<wchar_t>::int_type' [bcc32 Error] iosfwd(391): E2238 Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(141): E2344 Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(396): E2238 Multiple declaration for 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(146): E2344 Earlier declaration of 'char_traits<wchar_t>::eq(const wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(401): E2238 Multiple declaration for 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(151): E2344 Earlier declaration of 'char_traits<wchar_t>::lt(const wchar_t &,const wchar_t &)' [bcc32 Error] iosfwd(407): E2238 Multiple declaration for 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(156): E2344 Earlier declaration of 'char_traits<wchar_t>::compare(const wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(414): E2238 Multiple declaration for 'char_traits<wchar_t>::length(const wchar_t *)' [bcc32 Error] iosfwd(167): E2344 Earlier declaration of 'char_traits<wchar_t>::length(const wchar_t *)' [bcc32 Error] iosfwd(421): E2238 Multiple declaration for 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(176): E2344 Earlier declaration of 'char_traits<wchar_t>::copy(wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(429): E2238 Multiple declaration for 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)' [bcc32 Error] iosfwd(187): E2344 Earlier declaration of 'char_traits<wchar_t>::find(const wchar_t *,unsigned int,const wchar_t &)' [bcc32 Error] iosfwd(436): E2238 Multiple declaration for 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(197): E2344 Earlier declaration of 'char_traits<wchar_t>::move(wchar_t *,const wchar_t *,unsigned int)' [bcc32 Error] iosfwd(443): E2238 Multiple declaration for 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)' [bcc32 Error] iosfwd(212): E2344 Earlier declaration of 'char_traits<wchar_t>::assign(wchar_t *,unsigned int,wchar_t)' [bcc32 Error] iosfwd(454): E2238 Multiple declaration for 'char_traits<wchar_t>::to_int_type(const wchar_t &)' [bcc32 Error] iosfwd(227): E2344 Earlier declaration of 'char_traits<wchar_t>::to_int_type(const wchar_t &)' [bcc32 Error] iosfwd(465): E2238 Multiple declaration for 'char_traits<wchar_t>::eof()' [bcc32 Error] iosfwd(238): E2344 Earlier declaration of 'char_traits<wchar_t>::eof()' [bcc32 Error] iosfwd(486): E2238 Multiple declaration for 'char_traits::assign(char &,const char &)' [bcc32 Error] iosfwd(141): E2344 Earlier declaration of 'char_traits::assign(char &,const char &)' [bcc32 Error] iosfwd(491): E2238 Multiple declaration for 'char_traits::eq(const char &,const char &)' [bcc32 Error] iosfwd(146): E2344 Earlier declaration of 'char_traits::eq(const char &,const char &)' [bcc32 Error] iosfwd(496): E2238 Multiple declaration for 'char_traits::lt(const char &,const char &)' [bcc32 Error] iosfwd(151): E2344 Earlier declaration of 'char_traits::lt(const char &,const char &)' [bcc32 Error] iosfwd(502): E2238 Multiple declaration for 'char_traits::compare(const char *,const char *,unsigned int)' [bcc32 Error] iosfwd(156): E2344 Earlier declaration of 'char_traits::compare(const char *,const char *,unsigned int)' [bcc32 Error] iosfwd(509): E2238 Multiple declaration for 'char_traits::length(const char *)' [bcc32 Error] iosfwd(167): E2344 Earlier declaration of 'char_traits::length(const char *)' [bcc32 Error] iosfwd(516): E2238 Multiple declaration for 'char_traits::copy(char *,const char *,unsigned int)' [bcc32 Error] iosfwd(176): E2344 Earlier declaration of 'char_traits::copy(char *,const char *,unsigned int)' [bcc32 Error] iosfwd(524): E2238 Multiple declaration for 'char_traits::find(const char *,unsigned int,const char &)' [bcc32 Error] iosfwd(187): E2344 Earlier declaration of 'char_traits::find(const char *,unsigned int,const char &)' [bcc32 Error] iosfwd(531): E2238 Multiple declaration for 'char_traits::move(char *,const char *,unsigned int)' [bcc32 Error] iosfwd(197): E2344 Earlier declaration of 'char_traits::move(char *,const char *,unsigned int)' [bcc32 Error] iosfwd(538): E2238 Multiple declaration for 'char_traits::assign(char *,unsigned int,char)' [bcc32 Error] iosfwd(212): E2344 Earlier declaration of 'char_traits::assign(char *,unsigned int,char)' [bcc32 Error] iosfwd(549): E2238 Multiple declaration for 'char_traits::to_int_type(const char &)' [bcc32 Error] iosfwd(227): E2344 Earlier declaration of 'char_traits::to_int_type(const char &)' [bcc32 Error] iosfwd(560): E2238 Multiple declaration for 'char_traits::eof()' [bcc32 Error] iosfwd(238): E2344 Earlier declaration of 'char_traits::eof()' [bcc32 Error] xutility(346): E2406 Dependent type qualifier 'bool' is not a class or struct type [bcc32 Error] xutility(346): E2228 Too many error or warning messages

JnewbieD avatar Nov 10 '15 09:11 JnewbieD

I missed the first error lines: [bcc32 Error] UNewViewer2.h(33): E2209 Unable to open include file 'Chart.hpp' [bcc32 Error] UNewViewer2.h(34): E2209 Unable to open include file 'TeEngine.hpp' [bcc32 Error] UNewViewer2.h(35): E2209 Unable to open include file 'TeeProcs.hpp'

JnewbieD avatar Nov 10 '15 09:11 JnewbieD

In order to compile StreamViewer you will need the Embarcadero IDE. It might be possible to do it with bcc, but it will be hell tracking down all the dependencies and getting it to compile everything in the correct order -- which will probably affect things mightily. If you have Embarcadero, the project will compile without error right out of the box.

You can download a compiled version here: ftp://sccn.ucsd.edu/pub/software/LSL/Mobi_Utils/. When you download the zip archive, the executable will be in the folder called 'bin'.

This data visualizer is made specifically for looking at EEG data and event markers. It will only work for a handful of recognized LSL stream types, so it's not super robust in this regard. It might not be a good tool for developing a new device, anyway (although maybe this is exacttly why you are trying to compile your own version).

If you want to use liblsl-Matlab to visualize data, I recommend starting from the examples https://github.com/sccn/labstreaminglayer/tree/master/LSL/liblsl-Matlab/examples. Once lsl is loaded and the inlet is established (see examples for how to do this), you could do something like

figure; data = zeros(channels, buff_len); while(1) plot(data) data(:,1:end-1) = data(:,2:end); data(:,end) = inlet.pull_sample; end

This is just mock up code and is totally untested. It is likely I have the matrices transposed etc., so you will have to figure all that out. You will also probably want to buffer more than one data point at a time so you aren't drawing a new plot so often.

dmedine avatar Nov 10 '15 17:11 dmedine

A note regarding MATLAB: indeed, since MATLAB is single threaded the receive call in the viewer and the send call in your code will block each other. Do you have only one MATLAB license or memory limitations that prevent you from starting a second MATLAB instance?

On Tue, Nov 10, 2015 at 9:47 AM, David Medine [email protected] wrote:

In order to compile StreamViewer you will need the Embarcadero IDE. It might be possible to do it with bcc, but it will be hell tracking down all the dependencies and getting it to compile everything in the correct order -- which will probably affect things mightily. If you have Embarcadero, the project will compile without error right out of the box.

You can download a compiled version here: ftp://sccn.ucsd.edu/pub/software/LSL/Mobi_Utils/. When you download the zip archive, the executable will be in the folder called 'bin'.

This data visualizer is made specifically for looking at EEG data and event markers. It will only work for a handful of recognized LSL stream types, so it's not super robust in this regard, and so it might not be a good tool for developing a new device, anyway (although maybe this is exacttly why you are trying to compile your own version).

If you want to use liblsl-Matlab to visualize data, I recommend starting from the examples https://github.com/sccn/labstreaminglayer/tree/master/LSL/liblsl-Matlab/examples. Once lsl is loaded and the inlet is established (see examples for how to do this), you could do something like

figure; data = zeros(channels, buff_len); while(1) plot(data) data(:,1:end-1) = data(:,2:end); data(:,end) = inlet.pull_sample; end

This is just mock up code and is totally untested. It is likely I have the matrices transposed etc., so you will have to figure all that out. You will also probably want to buffer more than one data point at a time so you aren't drawing a new plot so often.

— Reply to this email directly or view it on GitHub https://github.com/sccn/labstreaminglayer/issues/69#issuecomment-155511536 .

chkothe avatar Nov 10 '15 18:11 chkothe

Thank you for your suggestions.

About compiling the stream viewer in Embarcardero, I downloaded the trial of the version of Embarcadero c++ builder 10 seattle, but compiling the project it gives me the same 51 errors. Probably I miss some options. Anyway, I downloaded the compiled version from the ftp and it works, and I can call it from my matlab code without problems, even if it has not the filtering features of the matlab vis_stream.

About Matlab, I started from the example in lsl-matlab and in very few time I was able to communicate between two matlab session and it works very well. However, I need to visualize raw and filtered data, so the best way for me is take advantage of the filtering features of streamviewer, but avoiding of starting multiple matlab sessions. So, I tried to compile the matlab version of streamviewer (vis_stream), it starts from windows cmd and works fine, it starts with the asynchronous system command of matlab (! vis_stream.exe &), but only if lsl_outlet command has not been given before. The strange thing is that after a lsl_outlet command vis_stream.m starts.

any suggestions would be appreciate. Cheers

JnewbieD avatar Nov 11 '15 12:11 JnewbieD