The easiest way to use this task for EEG (Windows, Cedrus button box, TTL Status Channel triggers via Parallel Port/LPT):
- install psychopy
- place psiclj.exe in the task root directory (for Win7/macOS, see psiclj.jar. Linux can use the heroku binary)
- clone or download+extract this repository
- double click
loeffegg.bat
in the root directory (../loeffeeg.bat) to confirm everything is setup - drag loefeeg.bat onto the desktop as a shortcut (hold shift). inspect properties and ensure it’s launching in the task root directory
- optionally: change icon
A photodiode is important to get accurate timing. Web browsers do not provide precision timing. ../http_ttl.py translates button box PD signals to a TTL value of 1. see *TTL values
- a http server (like psiclj) is not strictly needed. It is possible to open out/index.html from the local filesystem with the anchors you want (
out/index.html#where=eeg&ttl=local
). http_ttl.py will still be needed to translate button pushes and send TTL. You will also need to manually save data at the finish screen using the download link - web browser security may block the task from sending data to http_ttl.py if index.html is hosted on the wider internet. If external queries to localhost are allowed, this is also viable. That is, you can run the task from https://labneurocogdevel.github.io/choice-landscape/. You still need to manually save at the end and have http_ttl.py running.
The task’s logic is written in clojurescript and compiled to javascript to be run by a web browser.
As a result, the task can recruit from and be presented to amazaon turk users but requires additional infrastructure to interface with hardware and record responses when run locally (within the lab). Multi-site compatibility is handled by “tweaking” the anchor part of the URL given to browser (ending the address location with e.g. #where=mri
)
The anchor part of the URL is used specify where and how the task is being run. The URL can also encode participant identification, visit number, and other task settings like the background landscape to use.
We use html forum as an interface to these settings. see /out/extra/loefeeg.html
for eeg, /out/extra/mr.html
for MRI, and out/extra/practice.html
for practice. These work best when run on a local http server. See psiclj used in e.g. loeffeeg.bat
(windows). loeffeeg.bat will also open the browser to the loefeeg.html page.
At the end of the task, the “Finished” slide presents a link to download a .json
file containing every task event, it’s timing, responses, and trial scores. This may suffice, but has limitations. Data cannot be saved until the task is successfully completed and requires manual intervention (clicking and saving the link). When using psiclj, task data is saved at the end of each trial into a sqlite3 database.
The browser has no mechanism to communicate with button boxes nor parallel port interfaces. A separate program http_ttl.py
listens for http messages sent by the task at specific event/times and translates them to TTL Status Channel triggers. http_ttl.py
also translates Cedrus or RTBox button pushes to simulated keyboard keypress. loeffeeg.bat
launches this by depending on psychopy.
- http_ttl.py sets PD and buttons:
- PD is 1.
- Button pushes are 2-4.
- Task sent TTLs values are described in ../src/landscape/model/phase.cljs. base values for each phase are
(case (:name phase)
:iti 10
:chose 20 ;; side + picked adds up to 18 for all below
:catch 50
:timeout 70
:waiting 150
:feedback 200
;; survey, or otherwise unknown
230)
both the cedrus button box and RTBox support adapters for a photodiode. Task timing through the browser is not consistent. PD gives a much better estimate