A suitable application of OpenVibe?

Come here to discuss about OpenViBE in general!
pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

A suitable application of OpenVibe?

Post by pwsnow »

Hi All,

Just a quick question to double check my initial research.

I currently have a TMSi Porti device and would like to capture and process EMG (and other data GSR etc which does not require processing) data for hand opening/closing for amputees (which I asume would require classification within OpenVibe designer) to be sent out via VRPN to Vizard from WorldViz to open/close a virtual hand (which works using a camera system at the moment).

I know if I can get the EMG signals into OpenVibe and classified I will be fine, but just wanted to double check if this type of classification would be possible in real time and that the general idea doesn't sound too crazy.

Many thanks in advance,

Peter

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

Re: A suitable application of OpenVibe?

Post by toncho11 »

It sounds fine to me. I have not done it with EMG, but I have a similar project in mind.

Question is whether your amplifier is supported by OpenVibe.

Yes, you can output the result with VRPN to another application - we do that all the time. We use OpenVibe for the algorithmic part and we have another application that stimulates the user and provides him with real-time feedback (through VRPN from OpenVibe). This application is the front-end.

Classification is OK with LDA - both train/online. For SVM I am not sure (SVM might take longer time to train).
You can try do the something like in the motor imagery scenario in OpenVibe.

So, go ahead :)
Last edited by toncho11 on Tue Jul 30, 2013 9:00 am, edited 1 time in total.

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

toncho11 wrote:It sounds fine to me. I have not done it with EMG, but I have a similar project in mind.

Question is whether your amplifier is supported by OpenVibe.

Yes, you can output the result with VRPN to another application - we do that all the time. We use OpenVibe for the algorithmic part and we have another application that stimulate the user and provides him with real-time feedback (through VRPN from OpenVibe). This application is the front-end.

Classification is OK with LDA - both train/online. For SVM I am not sure (SVM might take longer to train).
You can try do the something like in the motor imagery scenario in OpenVibe.

So, go ahead :)
Many thanks for the reply.

Thankfully my amplifier is supported and stable for OpenVibe, I might have to give it another try since last time I tried it I couldn't get it to connect to the acquisition server.

It sounds like LDA will work fine, I have some experience using SVM so I'll read up on LDA.

I'll post any results etc if it helps the community.

Many thanks again. :D

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

I should add we are using the TMSi Porti (32 channel) device, it might take some playing around with but should work out the box with OpenVibe.

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

Re: A suitable application of OpenVibe?

Post by yrenard »

Dear pwsnow,

the TMSi Porti32 device works perfectly well with OpenViBE, and it has already been used at Inria for EMG recording, no crazy idea here...

As to the classifcation of EMG, you will likely have to create dedicated processing pipelines, the classifier is not alone for this task and different classifiers usually give sensibly similar results. The SVM is indeed longer to train than LDA but you might have slightly better results with it. Other classifiers might be implemented as well.

Porti32 is a good device for both EEG and EMG :)
Have fun !
Yann

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

yrenard wrote:Dear pwsnow,

the TMSi Porti32 device works perfectly well with OpenViBE, and it has already been used at Inria for EMG recording, no crazy idea here...

As to the classifcation of EMG, you will likely have to create dedicated processing pipelines, the classifier is not alone for this task and different classifiers usually give sensibly similar results. The SVM is indeed longer to train than LDA but you might have slightly better results with it. Other classifiers might be implemented as well.

Porti32 is a good device for both EEG and EMG :)
Have fun !
Yann
Thanks for the confirmation :D

Are you using the MindMedia Nexus32B drivers? I keep getting connection failing messages with them.

I did consider using the FieldTrip drivers as a backup.

I'm using the lastest version of OpenVibe too.

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

Just to give an update,

I think the current release of OpenVibe doesn't suppor the driver of the TMSi Porti32 we recieved from TMSi.

I get the usual error when trying to play on the acquisition server (same goes when using the TMSI Driver but it doesn't connect):


[ INF ] Connecting to device [MindMedia NeXus32B]...
[ INF ] Connection succeeded!
[ INF ] Staring the acquisition...
[ ERROR ] Could not start acquisition with NeXus API
[ ERROR ] Starting failed!
[ INF ] Stoping the acquisition

We recieved the unit early this year but the date stamp of the TmsiSDK.dll is early 2012.

Guess I'll modify the existing driver to create a new driver. When talking to TMSi a while back about us writing a Python plug in for our Porti32 device they did mention some things have changed and certain steps/changes need to be implemented.

yrenard, how old is your Porti32 device?

EDIT: I should add I have tried connecting the device on two separate machines, one 64 bit one 32bit with no luck too.

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

yrenard,

I've exported the dll file of the Porti device (I'm writing a driver for it now) is this similar to the content of your dll file?

Code: Select all

Function Name 	Address 	Relative Address 	Ordinal 	Filename 	Full Path 	Type 
ClassInstall	0x0000000180007460	0x00007460	1 (0x1)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
Close	0x0000000180007c70	0x00007c70	15 (0xf)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
CloseCardFile	0x0000000180009890	0x00009890	23 (0x17)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
ConvertSignalFormat	0x0000000180008c30	0x00008c30	40 (0x28)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
DeviceFeature	0x00000001800086c0	0x000086c0	19 (0x13)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
Free	0x0000000180007470	0x00007470	8 (0x8)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
FreeDeviceList	0x0000000180007740	0x00007740	13 (0xd)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetBufferInfo	0x00000001800081c0	0x000081c0	48 (0x30)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetCardFileList	0x0000000180009330	0x00009330	26 (0x1a)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetCardFileSamples	0x0000000180009910	0x00009910	24 (0x18)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetCardFileSignalFormat	0x00000001800095e0	0x000095e0	28 (0x1c)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetConnectionProperties	0x0000000180009250	0x00009250	21 (0x15)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetDeviceList	0x00000001800075d0	0x000075d0	12 (0xc)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetErrorCode	0x00000001800092e0	0x000092e0	20 (0x14)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetErrorCodeMessage	0x0000000180009300	0x00009300	2 (0x2)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetExtFrontEndInfo	0x000000018000a020	0x0000a020	25 (0x19)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetFrontEndInfo	0x00000001800091d0	0x000091d0	3 (0x3)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetOEMData	0x000000018000a820	0x0000a820	46 (0x2e)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetOEMSize	0x000000018000a630	0x0000a630	44 (0x2c)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetRandomKey	0x000000018000a380	0x0000a380	42 (0x2a)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetRecordingConfiguration	0x0000000180009bd0	0x00009bd0	30 (0x1e)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetRevision	0x000000018000a360	0x0000a360	35 (0x23)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetRtcAlarmTime	0x0000000180008fb0	0x00008fb0	39 (0x27)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetRtcTime	0x0000000180008e20	0x00008e20	37 (0x25)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetSamples	0x0000000180008210	0x00008210	10 (0xa)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
GetSignalFormat	0x0000000180008a70	0x00008a70	16 (0x10)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
LibraryExit	0x0000000180007d50	0x00007d50	5 (0x5)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
LibraryInit	0x0000000180007490	0x00007490	4 (0x4)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
Open	0x0000000180007770	0x00007770	14 (0xe)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
OpenCardFile	0x0000000180009450	0x00009450	29 (0x1d)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
OpenFirstDevice	0x00000001800079a0	0x000079a0	47 (0x2f)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
ResetDevice	0x0000000180008c00	0x00008c00	18 (0x12)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetMeasuringMode	0x0000000180008410	0x00008410	17 (0x11)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetOEMData	0x000000018000a6c0	0x0000a6c0	45 (0x2d)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetRecordingConfiguration	0x0000000180009de0	0x00009de0	31 (0x1f)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetRefCalculation	0x0000000180009ba0	0x00009ba0	36 (0x24)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetRtcAlarmTime	0x0000000180008ec0	0x00008ec0	38 (0x26)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetRtcTime	0x0000000180008d60	0x00008d60	11 (0xb)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetSignalBuffer	0x0000000180007fe0	0x00007fe0	9 (0x9)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
SetStorageMode	0x0000000180007e10	0x00007e10	49 (0x31)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
Start	0x0000000180007e30	0x00007e30	6 (0x6)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
StartCardFile	0x0000000180009810	0x00009810	22 (0x16)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
Stop	0x0000000180007f30	0x00007f30	7 (0x7)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
StopCardFile	0x0000000180009880	0x00009880	27 (0x1b)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
TMSiFlashFirmware	0x000000018000a1e0	0x0000a1e0	33 (0x21)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
TMSiGetFirmwareStatus	0x000000018000a2f0	0x0000a2f0	34 (0x22)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
TMSIRawData	0x000000018000a980	0x0000a980	41 (0x29)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
TMSISendDataBlock	0x00000001800090c0	0x000090c0	32 (0x20)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLGetBufferInfo	0x000000018000134c	0x0000134c	50 (0x32)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLGetUsbDeviceList	0x00000001800013a4	0x000013a4	51 (0x33)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLOpenFile	0x00000001800011a8	0x000011a8	52 (0x34)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLOpenUSBDevice	0x00000001800015c0	0x000015c0	53 (0x35)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLReadCirculairBuffer	0x00000001800012f4	0x000012f4	54 (0x36)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLStartIsoStream	0x00000001800012bc	0x000012bc	55 (0x37)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UCLStopIsoStream	0x00000001800012d8	0x000012d8	56 (0x38)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function 
UnlockFrontEnd	0x000000018000a470	0x0000a470	43 (0x2b)	TmsiSDK.dll	C:\Dev\TmsiSDK.dll	Exported Function
I'm trying to compile the source on Visual Studio but have run into a problem, I'll see if I can get that fixed.

I've looked at the source code for both the Mind Media NeXus32B & the TMSi Refa32B drivers and the methods mentioned above are different. I thought the Porti32 box was a clone of the Mind Media NeXus32B?

Peter

EDIT: It turns out that our version of the driver is 7, I believe that the driver written for the current version of OpenVibe is 6. Explains why my device doesn't work. Well at this rate at least my new driver will contribute to the community :D

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

Re: A suitable application of OpenVibe?

Post by yrenard »

Dear Peter

the porti32 and nexus32 are identical devices.

the nexus32 driver has been built by mindmedia in 2006 or so. it might be possible to have a new build along to the latest TMSi SDK from them if needed.

the refa32 driver has been built by bpayan at Inria in 2009 or so. it might be possible to grab the source code or have a new build along to the latest TMSi SDK from his former team if needed. Laurent Bougrain shall be contacted for this I believe.

Hope this helps,
Best regards,
Yann

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

yrenard wrote:Dear Peter

the porti32 and nexus32 are identical devices.

the nexus32 driver has been built by mindmedia in 2006 or so. it might be possible to have a new build along to the latest TMSi SDK from them if needed.

the refa32 driver has been built by bpayan at Inria in 2009 or so. it might be possible to grab the source code or have a new build along to the latest TMSi SDK from his former team if needed. Laurent Bougrain shall be contacted for this I believe.

Hope this helps,
Best regards,
Yann
Many thanks, that is what I have been doing. v7 of the TMSi driver is completely rewritten and lots of steps needed in v6 (current OpenVibe drivers) have been taken out. This is partly a good idea since so long as the device is connected (Wifi/UBS/Bluetooth) it is automatically connected to and not via the registry.

I'm half way through writing the driver so once I have tested it I'll write some quick documentation and it will be ready for the community to use :D

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

yrenard wrote:Dear pwsnow,

the TMSi Porti32 device works perfectly well with OpenViBE, and it has already been used at Inria for EMG recording, no crazy idea here...

As to the classifcation of EMG, you will likely have to create dedicated processing pipelines, the classifier is not alone for this task and different classifiers usually give sensibly similar results. The SVM is indeed longer to train than LDA but you might have slightly better results with it. Other classifiers might be implemented as well.

Porti32 is a good device for both EEG and EMG :)
Have fun !
Yann
Hi Yann,

Is there any documentation for creating dedicated processing pipelines in OpenVibe?

Regards,

Peter

fabien.lotte
Posts: 112
Joined: Sun Mar 14, 2010 12:58 pm

Re: A suitable application of OpenVibe?

Post by fabien.lotte »

Hello,

I don't know exactly what kind of EMG processing you would like to do, but there are already a number of generic signal processing boxes in OpenVIBE (see http://openvibe.inria.fr/documentation/ ... ithms.html), to filter the signals, apply basic mathematical operations on it, classify it, etc. So there are probably enough boxes available to already perform some form of EMG processing (provided there is already a driver to read your EMG signals in OpenViBE - if not you will need to create one for your EMG device, see http://openvibe.inria.fr/tutorial-creat ... on-server/). Could you be more specific on what kind of processing you would like to achieve?

I hope this helps,

Best regards,
Fabien

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

Apologies for the extremely long delay in replying.

Progress has been made to using the TMSi Porti 32 and EMG.

Thanks to the recent drivers the acquisition from the amp is perfect.

Using this report as a guideline http://buck.ugent.be/fulltxt/RUG01/001/ ... 001_AC.pdf we have managed to collect the data and clasify it (to a point, the report uses LDA, which gives me error messages about training failed via crashing but I can only get SVM working with 50% accuracy). Just having problems with the online classifier.

I have managed to get the VRPN working with our own external software (both data from our EMG recordings & from the demo applications which come with OpenVibe).

I guess its a problem with the data being classified incorrectly since I'm basing the scenairos off of the paper which uses LDA and using SVM outputs 0.5 This is flagged on the BCI motor imagery demo scenairos shifting the value.

Can anyone point me in the right direction, since I know EMG can be used in OpenVibe? It will be great to get basic EMG working online streaming via VRPN to show open and close. Once this is done I can work on our goal of adding more complex feature extraction since we want to use this EMG signal to detect grasp and release in a amputated limb.

I am continuing reading more papers based on EMG applied to grasp & release, just hard translating prior work to OpenVibe.

Many thanks, sorry for the lack of replies!

Peter

pwsnow
Posts: 13
Joined: Thu Jun 21, 2012 12:03 pm

Re: A suitable application of OpenVibe?

Post by pwsnow »

Just a quick question, whilst looking at the class descriptions on the Configure Graz Motor Imagery BCI Stimulator settings I came across "OVTK_GDF_Artifact_EMG". Could I not use this as a class?

fabien.lotte
Posts: 112
Joined: Sun Mar 14, 2010 12:58 pm

Re: A suitable application of OpenVibe?

Post by fabien.lotte »

Hi There,

Good to now you are making progress here!

Could you please be more specific about the problem you have with the online classifier? Maybe you can send us your scenario so we can have a look at them and see what may be wrong?
I guess that if you have an error/warning message, that could be an issue indeed.

Regarding the "OVTK_GDF_Artifact_EMG" you can indeed use that as a class label. In fact you can use any stimulation as the class label.

best,
Fabien

Post Reply