instructions and examples for using the EOG regression process

About the GUI application to design signal processing pipelines
Post Reply
KJeffrey
Posts: 74
Joined: Wed Jul 20, 2022 6:47 pm

instructions and examples for using the EOG regression process

Post by KJeffrey »

Hello,

We are using OpenViBE for the first time for a neurofeedback protocol. I wish to use the EOG removal process, but cannot find a detailed explanation of how to apply it, and an example to compare to. All I can find is a very basic description of the configuration fields for the two components. Can you please point me to such documentation?

-Jeff

Thomas
Posts: 212
Joined: Wed Mar 04, 2020 3:38 pm

Re: instructions and examples for using the EOG regression process

Post by Thomas »

Hi Jeff,

Here is a link to Mentalab wiki, providing some tutorial on EOG Artifact Removal: https://wiki.mentalab.com/applications/power-bands/

Setps 1 to 5 might be different depending on your acquisition hardware, but the rest should be helpful.

In the scenarios, pressing F1 on each box will take you to its documentation which might be complementary.

Hope this helps,
Thomas

KJeffrey
Posts: 74
Joined: Wed Jul 20, 2022 6:47 pm

Re: instructions and examples for using the EOG regression process

Post by KJeffrey »

Thomas,

I reviewed this and see that it is a two-step process. I will try it out when I am in the lab later this week.

I had implemented this method in Matlab for use with previously recorded data and it did not require a training step. Instead, it just calculated the b-matrix for each 1-second epoch using derived vertical and horizontal EOG channels. We would rather not do the extra EOG training step. If I wanted to implement my method in OpenViBE, what are my options?

-Jeff

KJeffrey
Posts: 74
Joined: Wed Jul 20, 2022 6:47 pm

Re: instructions and examples for using the EOG regression process

Post by KJeffrey »

Thomas,

I have reviewed the boxes in the eog-calibration scenario example and wish to try it with our previously recorded OV data file. I do not have specific EOG channels but can derive them from existing scalp electrodes. How do I create new channels as the difference between two existing channels?

-Jeff

KJeffrey
Posts: 74
Joined: Wed Jul 20, 2022 6:47 pm

Re: instructions and examples for using the EOG regression process

Post by KJeffrey »

I modified the EOG scenario and tried to get it working. I have many questions. Here is what I came up with so far:
test EOG denoise kje.png
test EOG denoise kje.png (19.47 KiB) Viewed 11098 times
Q1: I do not understand what the Keyboard simulator does, and the meaning and purpose of the stimulations in this context

I ran my version, and got this output:
key_sim.png
key_sim.png (149.87 KiB) Viewed 11098 times
The 1st warning about the TCP Tagging plugin seems important
The 2-3rd warnings seem to indicate that it has been self-limited to 43 seconds
The 4th warning says the matrix was not calculated but I have no idea why

Q2: how can I select a 40 second segment out of the input file (which is a 19 minute recording) as input?

here is an outline of what I am trying to do:
smoking classification.png
smoking classification.png (47.82 KiB) Viewed 11098 times
As I wrote in an earlier post, I wish to calculate the b-matrix for each epoch individually

Q3: I wish to use derive channels 1-5 for vertical and 29-5 for horizontal - how do I calculate these?
Q4: the red arrows and ?-marks indicate where I would need to control the b-matrix use, passing it on the EOF Denoising box and applying to the EEG epoch chosen in the Stimulation based epoching box. Is this possible here?

-Jeff
Last edited by KJeffrey on Wed Jul 12, 2023 1:54 pm, edited 1 time in total.

Thomas
Posts: 212
Joined: Wed Mar 04, 2020 3:38 pm

Re: instructions and examples for using the EOG regression process

Post by Thomas »

Hi Jeff,

Thanks for the details and screenshots.

Q1: The keyboard stimulator is here so that you set the sart and end point of the data that will be used for calibration. Let's say your input file is 5 minutes long, if you press 'a' at 1min and 'u' at 3mn, then calibration will be done on the data between 1 and 3 minutes. The box is programmed in such way that it won't go through the calibration if those start/end points are not provided.

Q2:
- 1st warning is ok. it happens because you don't have the acquisition server running which is fine.
- 2nd and 3rd warnings indeed indicate that the box was ready to process and that 43 seconds had elapsed (the time of the log itself matches the 43 seconds). This happens when the box stops receiving signal on its EOG input.
- 4th warning: the reason why it could not calculate the b Matrix is my answer to Q1.

To answer your question, if you want a 40 seconds segment you need to use the keyboard at the right times to select the segment you want.
Alternatively you use a Lua stimulation or python box to send the right stimulations (start and end) to the EOG Denoising Calibration box at the times of interest.

For info the start stimulation expected by the EOG box (and sent when pressing 'a' on the keyboard) is OVTK_StimulationId_Label_01, and the end stimulation expected is OVTK_StimulationId_Label_07.

Q3: When you run the scenario, you can get one b-Matrix at the end, so as it is, you cannot have it for each epoch. Maybe it could be done with as many EOG Denoising boxes as there are epochs to process but that would be a pretty big and scary scenario to build (and I'm not entirely sure that it is possible). The "easiest" would be to modifiy the EOG Denoising Calibration box, to process each epoch received.

Q4: At the moment, it is not possible this way. The output of the EOG Denoising Calibration box is only here to indicate that the b-Matrix processing is done. The matrix is written in a file that needs to be read by the EOG Denoising box. This has been designed to be a 2 steps (and 2 scenarios) process, so linking the two boxes in a scenario is not possible. Also the calibration box is here to calibrate the denoising box for future use, so I'm not sure to understand how you would use both in a single scenario ?

I think the boxes are not quite where you would like them to be for your pipeline, but I hope this helps a little anyway.

Thomas

KJeffrey
Posts: 74
Joined: Wed Jul 20, 2022 6:47 pm

Re: instructions and examples for using the EOG regression process

Post by KJeffrey »

I appreciate your answering all my questions here. It seems I should have the info I need now to run the 2-step process as designed.

In the interests of time, I am going to submit to reality and use the 2-step process in our study for the time being. I will have to run the first step on a few control subjects to get some data to work with.

If I or my more competent colleague still wish to create a 1-step process run on each epoch separately, we will have to learn how to make our own Boxes. I am actually interested in determining which (1 or 2 step) is actually better. The 2-step will obtain a global b-matrix for generalizability, but the 1-step might be better fit to the individual epochs which might be advantageous. I could easily test this in Matlab "sometime", but not now.

Thanks,
-Jeff

barraka
Posts: 2
Joined: Sat Jun 08, 2024 8:10 am

Re: instructions and examples for using the EOG regression process

Post by barraka »

I have managed to solve the same problem, thanks for the resource.

Post Reply