When measuring with multiple systems simultaneously the commonly asked question is: “How are we going to synchronize our data streams?” Many instruments cannot be coupled directly but most do have a way of producing a trigger signal or have the capability to record one. We at Artinis Medical Systems always strive to make research as easy as possible. Therefore, we have developed both hardware-based and software-based options for data synchronization. In this blog we will explore the different options and discuss the advantages and disadvantages of each and provide a guide for sending hardware events and software events to Oxysoft.
Every hardware options we have uses either a cable or a device to send a trigger to multiple systems simultaneously. One way to do so is via our wireless event-generator (PortaSync), which generates a wireless digital (Bluetooth) and wired signal which can be used as an instantaneous synchronization trigger. When all systems record the trigger, the temporal position of the trigger can be used to (re)align the different datastreams. When connecting the PortaSync via Bluetooth, the latency is about 100-200 milliseconds, which is far below the commonly observed NIRS-derived physiological deviations in the hemodynamic signals. However, in specialized research paradigms with high-frequency signals like e.g. eye-tracking or EMG even lower latencies are requried.
We also have wired-only options (ParallelSync cable), as these cables transmit instantaneous analogue signals, there is no latency. All hardware options require extra hardware, hence the name, and parallel ports are unfortunately generally not incorporated in modern laptops anymore. Therefore, it can be more convenient to use a software-based synchronization approach.
In the following paragraphs we will describe a simple step by step procedure how to send software events to Oxysoft. Any software package that can access the DCOM interface can send triggers to Oxysoft. Since Oxysoft 3.0.103 this feature is implemented in Oxysoft, if you would like to use this feature too for older software versions, please contact our application specialists. As an illustration of this feature two examples show the implementation in both Matlab and E-Prime. This enables both Matlab and E-Prime to directly send trigger signals to Oxysoft for synchronization of the datastreams and as analysis aid.
Step 1: Registration of Oxysoft as DCOM interface
The first step is to register Oxysoft as DCOM interface on your system. If this has been done already on your computer you can skip this and go immediately to step 2. If not, registration of Oxysoft as DCOM interface can be performed via the command prompt (Windows button -> type “cmd”) run in Administrator mode. Using the commands as shown in the figure below, you can register Oxysoft as a DCOM-interface on your system.
Please be aware that you should use the Oxysoft version that you are currently using, else you will get the message saying “The system cannot find the path specified”. Your current Oxysoft version can be found by pressing the Artinis-logo in Oxysoft, in this case it is 3.2.27:
To confirm correct registration, you can check under Component Services -> Computer -> My computer -> DCOM configuration if Oxysoft is visible. If not, please check if you did run the command prompt in Administrator mode (right mouse click -> Run as administrator) and you used the correct Oxysoft version.
Once this registration is complete, Oxysoft is ready to receive trigger signals from other software packages. This step has to be performed only once on any computer.
Step 2: Sending your events
An often-used tool is E-prime, which can be used to build easy-to-use graphical interfaces for behavioral experiments. In E-Prime, you can attach InLine code to any Pre- or PostStimulus event as shown above. The code will send a trigger automatically to Oxysoft any time a new piece of text, an auditory stimulus or task is initiated.
In this case an event P with event-description Prestimulus is send to Oxysoft at the start of the stimulus. This can be verified and reviewed via Analysis -> Event list and the result is shown below. Using this code you can automatically send any trigger from E-Prime to Oxysoft during your experiment.
Matlab is a versatile software package that is often used for data analysis and recording. From the Matlab software package it is also possible to send events to Oxysoft. A simple proof-of-concept script is shown below, but you can also integrate this in for example PsychToolbox and create advanced experimental paradigms in Matlab.
In this script a connection to Oxysoft is made using the command “actxserver”. A successful connection is confirmed by the formation of a COM-Object in the workspace, in this case named Oxysoft. Subsequently, with the command “Oxysoft.WriteEvent” any event and accompanying description can be send to Oxysoft.
In this particular script an experimental task (fingertapping) is repeated 10 times for 15 seconds, with a resting period of 30 seconds plus or minus a random number between 0 and 5 seconds. The variable resting period can be used to correct for the breathing cadence of the subject, so not every task starts at the same phase of the breathing pattern. This reduces systemic breathing influences on the measurement. Prior to initiation of the task sequence a time-window of instruction is created, which gives you time to instruct the subject and start the task sequence when you feel the subject is ready by the simple click of a button. After running your experimental paradigm in Matlab, all events are visible in Oxysoft. This can be verified and reviewed via Analysis -> Event list and the result is shown below.
Step 3: Enjoy your synchronized data!
To summarize, the following steps have to be performed for automated triggering to Oxysoft.
- Start a measurement in Oxysoft.
- Whenever you have set-up your NIRS-measurement and feel like you can start your experiment, run your experimental paradigm in e.g. E-Prime and Matlab.
- The events generated will be automatically added to your measurement in Oxysoft.
Subsequently, data analysis can be performed within Oxysoft or the data can be exported effortlessly to e.g. Homer2, FieldTrip or NIRS-SPM using our proprietary Oxysoft2Matlab-tool.