Setting up an ERPs experiment using PsychoPy

1,005 views
Skip to first unread message

Hossein Moghaddam

unread,
Feb 12, 2016, 2:23:36 PM2/12/16
to psychopy-users

Hello,

Dear psychopy-users members,

 

My question is about experience with PsychoPy in ERP experiments. I use PsychoPy 1.83.1, I work with Builder on Windows 8.1, 64bit computer.

 

I have designed a task for investigating perceptual distortion using PsychoPy and want to use MITSAR -EEG 202 amplifier for ERP recording. By default this equipment need to PSYTASK software for task design and jointly with WinEEG for task presentation. Moreover, this amplifier require WinEEG software for EEG recording (using a dongle). Data analyzing also need to WinEEG software. It uses USB for connecting amplifier to computer and recommends serial com port to synchronization between two presentation and recording computers (Its manual recommends this synchronization parameter for WinEEG program):                               

  • Baud rate - 57600
  • Number of bits - 8
  • Stop bits - 1
  •  Parity - None


I have no idea for its set up for PsychoPy. Would you please guide me in this regard? I’m not expert in “coder” and I am involved these questions:

  1.  What kind of information I should look for to setting up ERP Experiment by PsychoPy and synchronize the software and hardware?  
  2.  Is it possible to run ERP Experiment aiding PsychoPy and such amplifier? How can send event marker to recording EEG (for example, by MITSAR that just work with WinEEG + PSYTASK software)?
  3.  How do to set synchronization for presentation and recording computers when I use PsychoPy?
  4.  How do I to set I/O in PsychoPy for stimuli in “builder” when I needserial com port” (for example)  While, PsychoPy just provide parallel port?

 

Thanks in advance,

Hossein

Michael MacAskill

unread,
Feb 14, 2016, 9:06:59 PM2/14/16
to psychop...@googlegroups.com
Dear Hossein,

> I have no idea for its set up for PsychoPy. Would you please guide me in this regard? I’m not expert in “coder” and I am involved these questions:
You can create your experiment in Builder but will need to customise it by inserting a few snippets of code in a "Code component" to allow serial port communication.

> • What kind of information I should look for to setting up ERP Experiment by PsychoPy and synchronize the software and hardware?
You need to know what signals the EEG expects to receive over the serial port. i.e. you can send a series of numerical values from 0-255 over the serial port (which can also represent letters). You need to find out what codes correspond to what commands/events as expected by the EG hardware and the analysis software.

> • Is it possible to run ERP Experiment aiding PsychoPy and such amplifier? How can send event marker to recording EEG (for example, by MITSAR that just work with WinEEG + PSYTASK software)?
> • How do to set synchronization for presentation and recording computers when I use PsychoPy?
I don't know the details of your setup. But I guess you will either connect the computer running PsychoPy to the EEG hardware directly via a serial cable, or that you use it to communicate with another computer running some other software.

> • How do I to set I/O in PsychoPy for stimuli in “builder” when I need “serial com port” (for example) While, PsychoPy just provide parallel port?
PsychoPy does allow serial communications, but I don't think there is currently a graphical button for that in Builder. So you need to insert a code component. In its "begin experiment" tab, you need to create a connection to the serial port, as per the online documentation <http://www.psychopy.org/api/serial.html>:


import serial
serial_port = serial.Serial(0, 57600, timeout=1) # open first serial port & give it a name


Then at various points in your experiment (e.g. at the beginning of each trial, or when a stimulus is how within a trial, you need to send a code, like this:


serial_port.write('someCommand')


When to do this depends on your experimental task. What to send depends on the requirements of your particular EEG hardware & software.
In the "end experiment" tab, we also need to tidy up by closing the serial port, like this:


serial_port.close()


Come back to us when you have some more details,


Regards,

Michael



--
Michael R. MacAskill, PhD 66 Stewart St
Research Director, Christchurch 8011
New Zealand Brain Research Institute NEW ZEALAND

Senior Research Fellow, michael....@nzbri.org
Te Whare Wānanga o Otāgo, Otautahi Ph: +64 3 3786 072
University of Otago, Christchurch http://www.nzbri.org/macaskill

Reply all
Reply to author
Forward
0 new messages