Using VPixx Hardware with PsychoPy
In this VOCAL, we will cover how to use VPixx Technologies’ software tools for Python, with an emphasis on using it with the PsychoPy suite of tools for scientists.
If you are new to PsychoPy, we encourage you to check out their Resources for Learning and Teaching webpage to learn more about how to use their system. In general, PsychoPy offers two methods of working with its tools:
Use PsychoPy’s Builder interface to graphically design an experiment,
supplementing their built-in tools with .csv conditions files and custom code blocks.Access the PsychoPy library into your Python Integrated Development Environment (IDE), like PsychoPy Coder, Spyder or PyCharm.
VPixx Technologies has a library of Python functions for our data acquisition systems, called pypixxlib. This library allows the user to interact with our hardware directly in their Python experiment code. Pypixxlib is the Python equivalent of our Datapixx commands for MATLAB/Psychtoolbox, which you can read more about here: Introduction to VPixx MATLAB documentation.
For a full list of our Python functions and some IDE-based examples, please check out our pypixxlib documentation. There, you will also find instructions on how to install our Python tools in the Getting Started section. Common Python troubleshooting problems and their solutions are documented in our Frequently Asked Questions – Troubleshooting.
The purpose of this VOCAL guide is to orient researchers to using pypixxlib with PsychoPy. We will start with a general introduction to the two ‘flavours’ of pypixxlib, and then discuss how to implement our library within the Builder, and in a Python IDE. We will then cover some general tips and recommendations for working with PsychoPy.
If you are using a VIEWPixx /EEG and/or your primary goal is to generate frame-accurate digital TTL triggers, we have a fully automated solution for this called Pixel Mode. There is an in-depth explanation of Pixel Mode in our VOCAL guide: Sending Triggers with Pixel Mode. If you decide to use Pixel Mode, you do not need to invoke pypixxlib in your experiment. However, we still recommend you read the Tips section of this guide for helpful information about drawing pixels in PsychoPy so triggers are sent properly.
For most other applications, you most certainly will have to write some code. This is true even if you are using the Builder; there are no default drag-and-drop tools to support VPixx hardware, so you will need to use custom code blocks to interact with our systems. We provide some examples in this guide to help you get started.
Navigation
References
Peirce, J. W., Gray, J. R., Simpson, S., MacAskill, M. R., Höchenberger, R., Sogo, H., Kastman, E., Lindeløv, J. (2019). PsychoPy2: experiments in behavior made easy. Behavior Research Methods. 10.3758/s13428-018-01193-y