Stimulus Presentation Programs

In NCIL, we typically use one of two software packages for presenting stimuli, collecting responses, and communicating with the neuroimaging hardware.

PyschoPy

PsychoPy is, as the name suggests, a package for developing stimulus programs using the Python programming language. PsychoPy actually has a GUI (graphical user interface) that allows you to build most experiemnts without ever writing (or even seeing) Python code. You assemble components of the experiment on a timeline, and PychoPy generates the necessary Python code that is executed when you run the study. You can write a PsychoPy program from scratch, but this is a terrible idea. Firstly, it would take you considerably more time. Secondly, when you use the Experiment Builder in PsychoPy you get a ton of essential components "for free", and written in ways that are optimal for program execution (kind of like AI for experiment programming). There are occasions when you might need to build an experiment in PsychoPy and then edit the Python code it generates. For example, sometimes we can optimize the position of the lines of code that send triggers to the EEG system to ensure optimal timing.

PsychoPy is not hard to get started with, and there are numerous tutorials on PsychoPy's website and on YouTube - as well as the expertise of senior lab members. PsychoPy is free, and runs on Mac, PC, and Linux operating systems. With all these good points, some things are challenging in PsychoPy, and some people in the past have been quite confounded by its bugs and limitations. As well, it is still under ongoing development, and sometimes "improvements" cause new problems to arise (or break older programs).

DirectRT

DirectRT is commercial (paid-for) software and runs only on Windows. However, compared to PsychoPy it is often much quicker and easier to get a program running in DirectRT. A DirectRT program is essentialy a spreadheet file (e.g., created in Excel - DirectRT reads Excel format files as well as CSV text files), in which each row is a trial of the experiment. It is very easy to present pictures, videos, sounds, and text in DirectRT, as well as collecting responses (button presses and vocal responses) and sending trigger codes to the EEG system. Its timing is excellent and its log files are nice and detailed.

DirectRT's biggest limitation is also it's biggest strength β€”Β in being quite easy to get started with and build experiments, it is also somewhat limited in the kinds of programming logic you can include (e.g., it doesn't have loops or variables). This means every trial must be explicitly defined as a row in the spreadsheet, and creates possibility of human error via typos (although cut-and-paste and autofill can help mitigate this risk). It also has some limitations around collecting responses, or sending EEG trigger codes, during presentation of a video or audio file. Even beyond these limitations, there is a bit of a learning curve to figure out certain "tricks" (e.g., how to get a stimulus to stay on for a fixed period, or turn off as soon as a repsonse is made).

The fact that it's commercial (and not inexpensive) software also creates some limitations. Anyone can get a free 30 day trial license for free, and it's generally possible to get free student licenses for lab members (if Aaron writes to the company) if you need it for longer. However, if you don't have a Windows computer, you can't run DirectRT, so you would need to do all your programming (or at least testing) in the lab.

A hybrid approach that Aaron has used to get around some limitations of DirectRT is to write Python code that generates spreadsheet files that DirectRT can read and run.

Last updated