how to run Box processing on saved EEG to test and refine pipeline
how to run Box processing on saved EEG to test and refine pipeline
So far, in learning OPenViBE, I have not seen how to run Box processes on previously recorded EEG files in anything but "real time", by which I mean you have to wait for the EEG to flow through a scenario at the same speed it was recorded. I would like to test the computational steps in a scenario in "computer time", that is, as fast as the computer can calculate. This is how one would develop any processing pipeline using a procedural language. I have developed our pipeline using Matlab, for instance, and have tried to port it to OpenViBE, but in order to test it and play around with it I really need to have it run as fast as it does under Matlab.
I am hoping this is possible, and probably just need to find the right documentation, or an example to follow.
-Jeff
I am hoping this is possible, and probably just need to find the right documentation, or an example to follow.
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Hi Jeff,
Luckily you are indeed not the only one wanting to do this and it is therefore possible in OpenViBE.
When you want to run a scenario reading a file for offline processing, instead of pressing the play button you can click on the double-arrow on the right side of the play button. This will execute the scenario as fast as possible.
Kind regards,
Thomas
Luckily you are indeed not the only one wanting to do this and it is therefore possible in OpenViBE.
When you want to run a scenario reading a file for offline processing, instead of pressing the play button you can click on the double-arrow on the right side of the play button. This will execute the scenario as fast as possible.
Kind regards,
Thomas
Re: how to run Box processing on saved EEG to test and refine pipeline
Outstanding! I will try this right away.
Thanks,
-Jeff
Thanks,
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
I tried to run the attached scenario and it ran overnight and was still running in the morning.
I do not understand the function of the "Play Controller" box.
I went back and hovered over the double-arrow icon and it states: run the scenario in a loop, un-check to stop loop". This is not what I want.
Please advise how to achieve my goal.
-Jeff
I wish to have an output that gives me the classification results after training. I do not understand the function of the "Play Controller" box.
I went back and hovered over the double-arrow icon and it states: run the scenario in a loop, un-check to stop loop". This is not what I want.
Please advise how to achieve my goal.
-Jeff
- Attachments
-
- smoke_1 scenario 2023-08-01_21-10-01.png (31.27 KiB) Viewed 24700 times
Re: how to run Box processing on saved EEG to test and refine pipeline
I Jeff,
Sorry my previous reply may have been ambiguous. By "double-arrow" button, I was referring to the button in between the "play" and the "double blue arrows" button. If you hover over it, it will say "executes the scenario as fast as possible".
The player Controller box, is configurable to do an action upon receiving a specific stimulation. For exemple, STOP the scenario when receiving the stimulation "OVTK_StimulationId_TrainCompleted".
The Classifier trainer box happens to output "OVTK_StimulationId_TrainCompleted" when the data training is complete, so if the Player Controller is configured as specified in the previous sentence, it should stop the scenario automatically.
Hope this helps,
Thomas
Sorry my previous reply may have been ambiguous. By "double-arrow" button, I was referring to the button in between the "play" and the "double blue arrows" button. If you hover over it, it will say "executes the scenario as fast as possible".
The player Controller box, is configurable to do an action upon receiving a specific stimulation. For exemple, STOP the scenario when receiving the stimulation "OVTK_StimulationId_TrainCompleted".
The Classifier trainer box happens to output "OVTK_StimulationId_TrainCompleted" when the data training is complete, so if the Player Controller is configured as specified in the previous sentence, it should stop the scenario automatically.
Hope this helps,
Thomas
Re: how to run Box processing on saved EEG to test and refine pipeline
Thomas,
I cannot figure out how to set the [Player Controlle]r to "STOP". Its Box documentation is no help.
Also, how do I verify that the [Classifier Trainer] is truly set to output what you say it will?
-Jeff
I cannot figure out how to set the [Player Controlle]r to "STOP". Its Box documentation is no help.
Also, how do I verify that the [Classifier Trainer] is truly set to output what you say it will?
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Yes indeed that box documentation is quite light.
If you double click on the box, you will see its two settings:
Note that the Classifier Trainer will only send that Training completion stimulation once it has finished the training. For this to happen, the box needs to be told to train on the received data. The training is trigger by sending the box the following stimulation: OVTK_StimulationId_Train.
This trigger stimulation is set as the first parameter of the box in you scenario. Is that stimulation present at the end of the file you are reading ?
Let met know how you get on with this.
Thomas
If you double click on the box, you will see its two settings:
- The first one is the stimulation it is expecting in order to perform an action, here you want to write "OVTK_StimulationId_TrainCompleted"
- The second one is the action to perform, you want to select "Stop"
Note that the Classifier Trainer will only send that Training completion stimulation once it has finished the training. For this to happen, the box needs to be told to train on the received data. The training is trigger by sending the box the following stimulation: OVTK_StimulationId_Train.
This trigger stimulation is set as the first parameter of the box in you scenario. Is that stimulation present at the end of the file you are reading ?
Let met know how you get on with this.
Thomas
Re: how to run Box processing on saved EEG to test and refine pipeline
Thomas,
I did what you suggested. No, the EEG file does not have the OVTK_StimulationId_Train stimulation at the end. We ahd no clue about the need for it.
Is there a way to add it to the end of the file we already have?
Or any way to simulate it in the scenario?
How do we make sure it is there going forward?
Thanks,
-Jeff
I did what you suggested. No, the EEG file does not have the OVTK_StimulationId_Train stimulation at the end. We ahd no clue about the need for it.
Is there a way to add it to the end of the file we already have?
Or any way to simulate it in the scenario?
How do we make sure it is there going forward?
Thanks,
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Jeff,
There are two options,
Hope this helps,
Thomas
There are two options,
- First the easiest, is there a stimulation at the end of your EEG data ? It doesn't matter which stimulation it is, but it is important that it is unique in the stream and marking the end of the stream.
If there is such a stim at the end of the file, then you can use it as the trigger for the Classifier Trainer. To do so, double-click on the Classifier-Trainer box and change the first parameter "Train Trigger" to the corresponding stimulation.
- The second option consists in generating the OVTK_SimulationId_Train stimulation when the EEG signal finishes.
To do so, you can add to your scenario the "Timeout" box. This box can generate a stimulation when it stops receiving signal.
You want to connect its input to the signal output of the generic stream reader, and its output to the stimulation input of the Classifier Trainer Box.
Then modify its settings (double-click on the box) to:- Timeout Delay: 1
- Output Stimuation: OVTK_StimulationId_Train
Hope this helps,
Thomas
Re: how to run Box processing on saved EEG to test and refine pipeline
Thomas,
I will try to absorb all of this and apply it today.
Thanks for the detailed suggestions.
-Jeff
I will try to absorb all of this and apply it today.
Thanks for the detailed suggestions.
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Thomas,
I mentioned before that there is nothing at the end of the EEG data file as we had not knowledge that it was needed.
I tried the second suggestion, here is the result: Thanks for your continuing patience with me.
-Jeff
I mentioned before that there is nothing at the end of the EEG data file as we had not knowledge that it was needed.
I tried the second suggestion, here is the result: Thanks for your continuing patience with me.
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Here is the scenario,
-Jeff
-Jeff
- Attachments
-
- smoke_1.xml
- (27.8 KiB) Downloaded 660 times
Re: how to run Box processing on saved EEG to test and refine pipeline
Jeff,
I don't see well the whole error messages, but from what I can see, the Classifier box has tried to train on the received data and failed.
It is complaining of not having received enough data. The time of the log is at 3 seconds of running the scenario, with the Timeout box set at 1 second, it would appear that there is only 2 seconds of signal in the file you are reading.
Can you double check that there is more than 2 seconds of data in your OV file ?
Feel free to share the file so I can reproduce the issue on my machine if you want.
Thanks
Thomas
I don't see well the whole error messages, but from what I can see, the Classifier box has tried to train on the received data and failed.
It is complaining of not having received enough data. The time of the log is at 3 seconds of running the scenario, with the Timeout box set at 1 second, it would appear that there is only 2 seconds of signal in the file you are reading.
Can you double check that there is more than 2 seconds of data in your OV file ?
Feel free to share the file so I can reproduce the issue on my machine if you want.
Thanks
Thomas
Re: how to run Box processing on saved EEG to test and refine pipeline
Thomas,
Please try the test file I made today, link to it in other thread.
Good luck,
-Jeff
Please try the test file I made today, link to it in other thread.
Good luck,
-Jeff
Re: how to run Box processing on saved EEG to test and refine pipeline
Hi Jeff,
The problem you are encountering here is due to the fact that the data you are playing is already epcohed and contains gaps of around a second, which trigger the Timeout box to send the Train stimulation.
I tried to set the timeout to 2 seconds, but it triggered again a bit later in the file since there must have been a bigger gap then.
Finally, with 3 seconds it went through.
As I mentioned in your other post, I think it would be better practice to play data which is raw (no filter/epoching) and reapply it in the scenarios so you have the best control on the data and its filtering.
Note that when I tried, that amount of data made the training pretty long and OpenViBE hang.
Kind regards,
Thomas
The problem you are encountering here is due to the fact that the data you are playing is already epcohed and contains gaps of around a second, which trigger the Timeout box to send the Train stimulation.
I tried to set the timeout to 2 seconds, but it triggered again a bit later in the file since there must have been a bigger gap then.
Finally, with 3 seconds it went through.
As I mentioned in your other post, I think it would be better practice to play data which is raw (no filter/epoching) and reapply it in the scenarios so you have the best control on the data and its filtering.
Note that when I tried, that amount of data made the training pretty long and OpenViBE hang.
Kind regards,
Thomas