Connecting with the Medelopt VR System

Medelopt

MedelOpt® research devices provide full integration of functional nearinfrared spectography (fNIRS) and electroencephalogram (EEG) modalities in a wearable, self-contained headset. The unique design, developed by researchers for researchers, blends bimodality and flexi-modularity in an adaptable and self-contained system that supports a wide range of research possibilities.  The flexible, adaptable headset supports acquisition for up to 8 hours. Use for research applications with regions of interest from prefrontal to the cerebellum and through parietal, and lateral cortex. Integrate MedelOpt with other physiological data from BIOPAC devices for multimodal data acquisition.

Click here for more information

Example for sending events to the ElOpt software for the Medelopt system. This will send an event to synchronize with the Medelopt data. An event is sent when a gaze time or gaze end event occurs. The "buttonTrigger" functions shows how to send a marker with a keypress (in this case the 't' key)

Note: requires installing the pyserial library using the Package Manager

import sightlab_utils.sightlab as slfrom sightlab_utils.settings import *import serial # ElOptimport struct # ElOptimport time # added MV
# ElOpt - fNIRSCOM_PORT = 'COM9' # define the com port numbers = serial.Serial(COM_PORT)s.open # Open the COM port
sightlab = sl.SightLab()
def gazeActionEnd(e): print('Gaze Ended') s.write(struct.pack('!B',2)) # ELOPT - AUX1 OFF # Added MV
def gazeActionStart(e): print('ELOPT Marker sent') s.write(struct.pack('!B',1)) # ELOPT - AUX1 ON #s.write(struct.pack('!B',2)) # ELOPT - AUX1 OFF
vizact.addCallback(sightlab.GAZE_TIME_EVENT, gazeActionStart)    vizact.addCallback(sightlab.GAZE_END_EVENT, gazeActionEnd)
sightlab.addCustomTrialDataColumn('ELOPT Markers')
def buttonTrigger(): sightlab.setCustomTrialData('Send Custom ELOPT Marker', 'ELOPT Markers') s.write(struct.pack('!B',3)) # ELOPT - AUX2 ON wait_timer = 0.5 # sec time.sleep(wait_timer) s.write(struct.pack('!B',4)) # ELOPT - AUX2 OFF print("marker sent with key")vizact.onkeydown('t',buttonTrigger)
viztask.schedule(sightlab.runExperiment)