LogoLogo
  • Start Here
    • Introduction to NCIL
      • Welcome
      • Mission Statement
      • Getting Started
      • Make this handbook better!
  • Policies & Expectations
    • Working in NCIL
      • Aaron's Philosophy on Supervision
      • General Policies
      • Roles & Expectations
        • Interpersonal and Working Relationships
        • Lab Director: Aaron Newman
        • Lab Manager: Cindy Hamon-Hill
        • Collaborators
        • Postdocs
        • Lab Research Assistants
        • Graduate Students
        • Undergraduate Students
      • Work Ethic
        • Vacations & Absences
      • Money
        • Employment
        • Undergraduate Research Awards
        • Graduate Student Funding
    • Communication
      • Basecamp
      • Lab Meetings
      • Communication Among Lab Members
      • Communicating with Research Participants
      • Website & Social Media
      • Meetings with Supervisor
      • Response Times
    • Lab Space and Resources
      • Hours of Operation
        • After-Hours Research
      • Safety
    • Intellectual Property
      • Data
      • Authorship
      • Publishing: Where and When
  • Data Management & Analysis
    • Data Science Tools
      • Jupyter
        • JupyterLab
      • Python
      • R
      • How to set up your computer for NCIL data science
    • Servers & Computers
      • Accounts
      • File Server (NCILNAS)
        • Accessing NCILNAS
      • Compute Server
        • Jupyter
        • VS Code - Setup
        • VS Code - Everyday Use
      • GitHub Copilot
    • Data Analysis
      • Behavioural Data
      • EEG Analysis
      • fMRI Analysis
        • Processing fMRI Data with SPM
        • fMRI Analysis in SPM
      • Power analysis with simR in R
    • Data Management
      • Github
      • Open Science
    • Learn Some Coding
  • How To Run Experiments
    • How to Get a Research Study Started
      • Research Ethics
      • Your Research Protocol
        • Components of a Research Protocol
      • Pilot Testing
    • Running a Participant
      • Communicating With Participants
      • Recruiting
      • Before Each Participant Arrives
      • When a Participant is in the Lab
    • Experiment Programming
      • Stimulus Presentation Programs
      • Brain-Computer Interface Programs (BCI)
      • EEG Trigger Codes
        • Lab Streaming Layer
        • Trigger Code Hardware Setup
        • Timing Test
    • Data Storage & Protection
    • Word Similarity Measures
  • Communicating Science
    • Submitting papers to Aaron for review
    • Lab Meeting Talks
    • Independent Study Course
    • Honours Thesis
      • Getting Started
    • Master's Thesis
    • 😓PhD Dissertation
    • PhD Comps
    • Conferences
    • Publications
    • Reviewing Journal Manuscripts
  • Old
    • VS Code on NCIL server
Powered by GitBook
On this page
  • PyschoPy
  • DirectRT

Was this helpful?

  1. How To Run Experiments
  2. Experiment Programming

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.

PreviousExperiment ProgrammingNextBrain-Computer Interface Programs (BCI)

Last updated 2 years ago

Was this helpful?