Skip to content

IBT-FMI/COSplay

Repository files navigation

COSplay

Journal of Open Source Software Publication Status

Documentation Status

COSplay (Contrast optimized stimulus player) is a Python based software solution for the delivery of stimulus sequences in stimulus evoked experiments. It is fully compatible with the stimulus sequence optimization package COSgen. The software is best used in conjunction with a COSplayer, an open source device, assembly instructions for which can be found here.

Rationale and Use Case Example

In many research areas, the functioning of complex systems is probed by measuring stimulus-evoked responses. COSplay can allow e.g. a neuroscientist to present milli-second accurate stimuli to a subject during a measurement procedure. Commonly, stimulus train delivery is coordinated by in-house and/or proprietary solutions, which are often ill-documented, expensive, poorly reproducible, high-maintenance, and unsustainable. Uniquely, COSplay permits stimulus train delivery via a small and portable device, capable of interfacing with proprietary measurement systems --- but in and of itself not containing any additional proprietary software or hardware!

Features

  • TTL trigger from MRI scanner can be used
  • 2 transistor channels
  • 2 TTL output channels (3.3V)
  • 2 amplitude modulation channels
  • Microcontroller can be used standalone (c.f. Standalone use section in the docs)
  • Stimulus pulse delivery with ms or μs accurary
  • Random selection of a sequence from a sequence library
  • Piping of sequence file to the directory of the latest scan on the MRI computer
  • Error message forwarding to computer

Installation

COSplay can be installed using Python's setuptools.

git clone https://github.com/IBT-FMI/COSplay.git
cd COSplay
python setup.py install --user

Dependencies

Hardware

  • PyBoard 1.1
  • microSD (recommended)
  • USB cable (A to micro-B)

Minimal Usage Example

To execute a demo sequence on the COSplayer device, please follow the subsequent steps:

  1. Install the package on a machine according to the instructions above.
  2. Connect the COSplayer device to the machine. At this point the blue, orange, and green LEDs should light up, according to the LED legend.
  3. Press the USR button twice. At this point the blue LED should light up, the red LED may also intermittently light up, according to whether data is being written on disk.
  4. After the device is recognised by the host computer, navigate to the sequence_library directory.
  5. Copy a file formatted according to the COSplay/BIDS standard into the directory. An example file is provided in this repository. All values are interpreted as SI base units, seconds and hertz, respectively --- with the exception of the amplitude (see more).
  6. After the file has copied and the red LED is no longer lit, safely remove the volume, and press the RST button.
  7. Click the USR button once to select the standalone operation mode. At this point the LED lighting should transition from blue, orange, and green to none.
  8. Click the USR button again to arm the device. At this point the orange LED should light up.
  9. Click the USR button once more to trigger the sequence. At this point the green LED should light up, and, as stimulation is delivered, the blue LED should intermittently light up as well.

Contributing Guidelines

You can: