Skip to content

Tracking the neural dynamics underlying variations in flow/attentional states at the timescale of second

License

Notifications You must be signed in to change notification settings

fcbg-platforms/meg-flow

Repository files navigation

Ruff Code style: black Imports: isort codecov tests

MEG-flow

Title: Tracking the neural dynamics underlying variations in flow/attentional states at the timescale of second

The project is composed of a python package flow and of a Unity task. The python package can be installed on all platforms and uses psychopy to control an oddball auditory paradigm.

Install

On macOS or Windows, the python package can be installed in a virtual environment with pip or uv (drop-in replacement for pip, recommended):

$ uv pip install git+https://github.com/fcbg-platforms/meg-flow

On Linux, psychopy requires the following manual step prior to the installation of the flow package:

  • wxPython which can be retrieved here for your platform, or compiled locally.

  • the system dependencies:

    $ sudo apt install libusb-1.0-0-dev portaudio19-dev libasound2-dev libsdl2-2.0-0
  • the following ulimits:

    $ sudo groupadd --force psychopy
    $ sudo usermod -aG psychopy $USER
    $ sudo nano /etc/security/limits.d/99-psychopylimits.conf

    Set the content of 99-psychopylimits.conf to:

    @psychopy   -  nice       -20
    @psychopy   -  rtprio     50
    @psychopy   -  memlock    unlimited
    

Important

As of writing, psychopy is still limited to Python 3.10, thus make sure to create a virtual environment with a compatible version of Python.

Usage

The flow package has 2 command-line entry-points:

  • forward-force: to stream the sensor force to Unity.
$ flow forward-force --help
  • oddball: to start the oddball paradigm.
$ flow oddball --help

The oddball paradigm can be halted and resumed via ZMQ messages. An example is provided in script/zmq-control.py.