Skip to content

Experimental stimulus presentation software using LÖVE

License

Notifications You must be signed in to change notification settings

dangom/love-experiments

Repository files navigation

Visual stimulation software

Introduction

./imgs/flickering-checkerboard.png

This is my personal fMRI stimulus presentation software. Its goal are to be lightweight, cross-platform, free and easier to use than the alternatives without sacrificing temporal precision. The experiments are programmed in Lua using the LÖVE 2D framework for game development since it aligns with all of the goals described above and provides sufficient and adequate timing precision. Another advantage of this choice is that the framework is widely used and has a thriving and welcoming community, making it easy to find help if necessary.

To run the experiments, first install LÖVE and then run `love experiment`, where experiment is a directory containing a main.lua file. More info in the installation section below, or see the examples in this repository. Example code to parse the logfiles and plot task performance is also provided.

Currently, love-experiments only provides flickering checkerboards and flickering scaled noise experiments, since these are the ones I’ve been using in my own visual experiments. Nonetheless, the software takes care of the following:

  • Logging of keypresses and scanner triggers in close to BIDS compatible format
  • Log results even if the experiment exits early or fails
  • Display participants feedback at the end of the session
  • Parse command line arguments for more flexibility
  • Keyboard agnostic

As currently implemented, the code is also performant enough to run on resource starved computers without dropping any single frame.

Installation

In order to install this, install LÖVE 2D either by downloading the runtime from their official website, or using your package manager (recommended).

Example for MacOS:

brew install love

Example for Ubuntu:

sudo add-apt-repository ppa:bartbes/love-stable
sudo apt-get update
sudo apt-get install love

Then, if not familiar with Lua, use the provided Python wrapper to call and run the script. If familiar with Lua, use love to call the experiment directly.

Once love is installed:

git clone https://github.com/dangom/love-experiments.git
./run_oscillatory_flicker.py  --frequency 0.20 --tr 1 --n_volumes 200 --offset 0 --sub_id "test" --run_id "test"
# or
# /run_blocked_flicker.py --on_blocksize 15 --off_blocksize 45 --flicker 8 --offset 0 --tr 1 --n_volumes 500 --sub_id "test"  --scalednoise 0 --luminance 0.7 --run_id "test"

About

Experimental stimulus presentation software using LÖVE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published