- Home /
Getting log from unity and ECG physiological markers using VB script
Hello all,
I'm doing a project for my masters, where we use unity for VR, and we want to have people to be in the trial and experience this VR space and be connected to ECG, for reading their heart beat as a physiological marker.
My questions are thus, 1. Does anyone knows of such a pipeline of unity and external machine like ECG or EEG, and what logs can I get? (it's a tough one, not sure I understand it myself) 2. Can I record the trial using a plugin maybe, so all the time the user in the VR, his trial is recorded and I can watch it latter on.
EDIT: Does anyone knows if I can integrate VBscript API's with UNITY3D?
Thanks!
Not sure I quite understand your question.
The nature of the external machine is irrelevant. You just need to know if and how you can output the data through an IO port.
Please do not rely on Unity for Realtime $$anonymous$$edical Diagnosis/$$anonymous$$onitoring. It is a loosely ticking Game Engine and most definitely does NOT have the accuracy required for actual medical devices. (Of course for something non-critical as you are suggesting, Unity should be great; just don't stake peoples' lives on its operation).
Hi,
Thanks for the link, its really helping focusing my search.
It's really nothing operational or intrusive, it's a psycho-biological trial, when people experience a VR environment and their heart rate is measured, and I need to see that there's a relation between their heart rate and the events (trigger) in the simulation, to see if there's any causality. So, I need to learn, how do I record the trigger, once the user is experiencing an event. It's very common in psychology, to for example show a picture and see the physiological reaction to the picture on the exact time it shown, this is called a trigger. How do I generate triggers with Unity? How can I synchronize unity3D, with the ECG (heart activity recorder) "time wise" - so it's synchronized per each event?
I'm going to look farther into what you've suggested, any help is great here. Thanks.
Answer by FortisVenaliter · Apr 06, 2017 at 10:49 PM
I would definitely recommend separating the processes. You can run the ECG/EEG from a program that's completely separate from the Unity program. You could even run them from different computers due to @meat5000's concerns. But unless the ECG/EEG will affect anything in the game, it would likely be much easier to do run them separately, then combine any data after the fact. Plus, the added bonus of that would be that the machine likely already comes with monitoring software you can use out of the box.
Hi,
Let's see if I understand the whole pipeline here: After the simulation is build (like a game), it can run on any computer, one fit for VR. The ECG is on a separate device with a software (I have these). VR computer is connected to the recording device with a USB, the same device that records the Heart Activity and translates it into a signal. While the simulation is running, the user is entering a trigger collider and the machine needs to "register" that time. Will it be by a code? Perhaps a c# code that says: when a user is in the collider, send log with exact time and date. So I look back at the trial and be able to analyze, maybe even print that/these "log/s".
Also the connecting of the "build" environment with the USB to the recorder, requires a script?
I think this tutorial might be helpful: https://www.youtube.com/watch?v=6vl1IY$$anonymous$$pwVQ and this one: https://www.youtube.com/watch?v=Qffgl_vz$$anonymous$$QE
If you have more please share.
Yeah, that was basically what I was suggesting. Just have both programs separately write out logs with timestamps. Then you can correlate the data afterwards separately, or even write a quick C# program to combine and analyze them if it's a lot of data.
I wouldn't even bother connecting the two though, until after the simulation. Let them run separately and combine after.
Just have both programs separately write out logs with timestamps.
How do you get unity to create these "logs with timestamps"?
If you're running on Windows, then the same as any program. Use the System.IO namespace, particularly the StreamWriter class.
Answer by agirault · Jun 17, 2019 at 09:25 PM
Very late to the game here, but if you want to "simulate" an ECG or any other vitals in Unity, this asset it now available for free: https://assetstore.unity.com/packages/tools/integration/pulse-physiology-engine-139773
Your answer
Follow this Question
Related Questions
XR Management package not importing correctly 1 Answer
2019.3 Oculus XR Plugin play mode does not work for Oculus Quest 0 Answers
Is it possible to override the texture component values even though the variable is set to public? 0 Answers
Can I see debug log(ex:printf) from C++ dll in Unity? 0 Answers
Using Leap Motion Assets in Unity 4 0 Answers