https://github.com/dfsp-spirit/psynet-animation
Evaluating the creation of APNG-based animations in PsyNet.
https://github.com/dfsp-spirit/psynet-animation
multimedia psychology psychology-experiments psynet webserver
Last synced: 3 months ago
JSON representation
Evaluating the creation of APNG-based animations in PsyNet.
- Host: GitHub
- URL: https://github.com/dfsp-spirit/psynet-animation
- Owner: dfsp-spirit
- Created: 2025-03-17T10:12:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-24T12:54:55.000Z (7 months ago)
- Last Synced: 2025-07-10T16:11:52.527Z (3 months ago)
- Topics: multimedia, psychology, psychology-experiments, psynet, webserver
- Language: Shell
- Homepage:
- Size: 18.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PsyNet APNG Animation Test
This is a psychological remote experiment implemented using the [PsyNet framework](https://www.psynet.dev/).
This repo demonstrates and provides tools to create interactive animations based on images in Animated Portable Network Graphics format (APNG, see [Wikipedia article on APNG here](https://en.wikipedia.org/wiki/APNG)). There are scripts to [generate an APNG from a selection of standard PNGs](./source_images/), and a script to [transform an animated SVG into an APNG](./graphics/).
The main part is [a PsyNet experiment](./experiment.py) that creates animations based on APNGs. The user needs to click on certain graphical elements to advance to the next section of the PsyNet timeline. PsyNet provides a Python wrapper around [Raphaël JS](http://raphaeljs.com/) for this.

*Screen capture gif created with [peek](https://github.com/phw/peek) under Linux.*Note: Raphaël is an SVG animation library, but an APNG image can be a component embedded into an SVG file, and it can be animated using Raphaël like any other SVG component.
Thanks to Leandra for the bird images.
## Installing PsyNet and preparing to run this experiment
We highly recommend to run this under Linux and in a Python virtual environment using `venv`. This will spare you the hassle of setting up WSL2 and Docker under Windows. For final testing of your experiment before deploying it, we would recommend to run it in Docker once (again under Linux).
### Quick install instructions for Linux
Make sure you have a recent Python version (e.g., Python 3.12) and the Google Chrome browser installed.
Then get python dev packages, a database server and redis. E.g., for Ubuntu 22.04 LTS:
```sh
sudo apt install vim python3.11-dev python3.11-venv python3-pip redis-server git libenchant-2-2 postgresql postgresql-contrib libpq-dev unzip
```For Ubuntu 24.04 LTS, just replace `python3.11-dev python3.11-venv` with `python3.12-dev python3.12-venv`.
Then setup the postgres database:
```sh
sudo service postgresql start
sudo -u postgres -i # opens a new shell as the database user 'postgres'
createuser -P dallinger --createdb # add DB user dallinger with createDB permission. When asked for new password, enter 'dallinger' (twice).
createdb -O dallinger dallinger # create database dallinger owned by user dallinger
createdb -O dallinger dallinger-import # create database dallinger-import owned by user dallinger
exit # exits the shell of user postgres, so you are back to your user
sudo service postgresql reload # apply configuration
```Now install the experiment from this repo, which will install dependencies like the PsyNet and Dallinger python packages:
```sh
git clone https://github.com/dfsp-spirit/psynet-animation.git
cd psynet-animation/
python -m venv venv
source venv/bin/activate
pip install -r constraints.txt # This will get you PsyNet, Dallinger and their dependencies
psynet debug local # starts PsyNet server and opens connection to it in your Chrome webbrowser.
```Chrome should open automatically and display the PsyNet overview page. If not, open Chrome manually and connect to [localhost:5000](http://localhost:5000).
Select the `Development` tab and click `New Participant` to run the experiment.
Note: If you are running an older Linux version and your system Python is very old, you can install [miniconda](https://www.anaconda.com/docs/getting-started/miniconda/install) and use it to get a more recent Python.
### Other ways of installing
If you need to run this under Windows, please follow the full PsyNet installation instructions, available in [docs/INSTALL.md](./docs/INSTALL.md). In that case, you will also want to have a look at the list of run commands in [docs/RUN.md](./docs/RUN.md).
## General information on the PsyNet framework
For more information about PsyNet, see the [documentation website](https://psynetdev.gitlab.io/PsyNet/).
## Troubleshooting hints
#### Problem: I am being asked for credentials I don't know when manually connecting to the PsyNet overview page at http://localhost:5000.
Solution: PsyNet uses a user and password to protect its overview page and provides these credentials to Chrome automatically on startup. If you connect manually, you will be asked for this information. The easiest way to get the information is to define it yourself in the config file `~/.dallingerconfig` like this:
Create the file `~/.dallingerconfig` and put these lines into it (it's in INI format):
```
[Dashboard]
dashboard_user = admin
dashboard_password = 12345
```Restart the PsyNet server. Then use these credentials to login when asked.