(aka Landscape choice)
- see running version: https://labneurocogdevel.github.io/choice-landscape/
- see doc/ for a setup guide and images
- aesthetic motivated by Dubois et al 2021 elife task: landscape with choices
task responses recorded at https://lncdwells.herokuapp.com/testid/habitv1/1/1/(20221128 - no free heroku)
- clone and open out/index.html to start the task in a web browser (responses not saved).
- NB. for where=mri and where=eeg, task ends presents “Download Data” with link to json file that can be saved locally/manually.
- save psiclj (.jar or .exe) in the root directory and launch as a local service to save to a sqlite3 file. (e.g. loeffeeg.bat)
- See ./WIN_INSTALL.bat for help with Windows (after installing psychopy)
Using Procfile on heroku w/ addon:heroku-postgres
and https://github.com/LabNeuroCogDevel/psiclj buildpack
- http_ttl.py can be launched as a second service to capture button box responses, simulate keyboard events, and translate http requests from the task into TTL triggers in the EEG recording.
- run without arguments for help
- supported button boxes
- Cedrus (XidDevice) via pyxid2
- RTBox via https://github.com/xiangruili/RTBox_py
- TTL via
- LPT via psychopy.parallel
- USB 1208FS (DAQ) via https://github.com/wjasper/Linux_Drivers
- async tornado to listen for http and async.sleep to wait for button push
see results/ directory, esp. results/Makefile.
- DB stores ‘json’ column that can be converted to row per trail text file with dbjsontotsv.jq
- read.R::fix_and_save cleans up the output
- summary.R summarizes
- app.R is a shinny app to explore results
This project is clojurescript that transpiles to javascript (see the Makefile). The final assets are in the out/ directory.
- model/STATE is a giant data structure containing everything that might need to be displayed or calculated
- time-cur is incremented every animation step
- phase iterates through instructions | iti, chose, [catch, timeout, or] waiting, feedback | done
- parameters can be “tweaked” with url. see url-tweaks.cljs
- code path: enter in core.cljs and follow to loop.cljs/run-loop and display-state
- model updating with model.cljs/next-step and
- displayed with view.cljs/display-state
- EEG status channel TTL codes are generated with phase/gen-ttl
Using e.g. CIDER with figwheel-main:dev (C-c M-J in emacs on core.cljs)
- http://localhost:9500/ cards.html
- http://localhost:9500/figwheel-extra-main/cards
- http://localhost:9500/figwheel-extra-main/auto-testing
(swap! landscape.model/STATE assoc :well-list (landscape.model.timeline/gen-wells {:prob-low 100 :prob-high 100 :reps-each-side 1 :side-best :left}))
; go to the end and dont spam terminal with STATE
(do(swap! landscape.model/STATE assoc-in [:phase :name] :done) nil)
; use local psiclj. need to disable browser CORS
(set! landscape.http/HTTP-DEBUG "0.0.0.0:3001")
<2022-07-06 Wed> create iti-start-at key in well-list check that against start time if it exists instead of looking at duration need mr start and average walk
likely problem with current timing: timeout is same length as feedback. and there is no “walk” should implement phase tests that progress through each step (maybe with for loop at 30ms intervals?)
plays a speaker saying a word. word must be typed before continuing
- high prob well is far (yes/no).
- distribution of sides (high prob more freq?)
- +/- 4th devalue block
- +/- reversal
instructions step through individual actions (sprites, buckets, etc)
scanner will be given explicit onset targets
currently generated by model.timeline/gen-wells with fixed 20/50 probs
last event is the test of habit. the far well is no longer effect. can get always get reward from a closer well
POST requests are made before the transition from feedback to iti. intended to be picked up by psiclj
tool/server
NB. mturk /ad w/psiclj or psiturk uses a popup window
translation: scale(1.5)
works for content but does not scale background.
with lower wells, maybe less of a problem
bad idea for smaller screens?
https://gist.github.com/bigfive/4256993
document.body.style.MozTransform='scale(1.1)'
does not scale background
tiny block div that changes color at each phase.
- Block could be moved to a better location.
- color range should be imperially checked. have 4 phase alternating between ligth and dark. sensitivity might vary. might need to be bigger
works on wells and instruction button. BUT there is no indication that’s what happened.
this looks like it’d be hard to integrate
partially implemented. could still use math to make sure we don’t get to 100% until last trial (exp decay?) <2022-11-27 Sun> - okay with current setup. also have coin images that accumulate for ocean landscape
not necissary. maybe problematic. would be useful for debugging though debugging with probability text over well would be useful too
bar at bottom with color for success? X or O next to the well?
probably not needed. the buckets are enough of an indication
maybe css instead? colored?
also fixed a loop bug and stopped animation if active-at is 0hard coded sequence :step-sizes
in atom settings/current-settings
(previously defvar BOARD
)
currently have a bucket on active wells. could still use animations
have start of animation in wells.svg but crashes inkscape. not critical to task
maybe this isn’t needed
had up/down swapped inwhich-dir
. took forever to debug!
how fast to move? accepting keypress?
keypress injected directly into state
instead of restricting, keypress is cleared before we are in :chose:
and waiting for a keypress
useful to share. need .nojekyll
file to use index.html and friends.
copied cash and buz
water fill and sound
may want to change to grayed avatar
- maybe prefer chrome instead of firefox.
- maybe an image will be positioned better?
- might not need. depends on modeling
- shake the well for variable time before showing reward
- intermediate helper goes to the well instead. (bring bucket, drill, etc). can be disgruntled or happy
- POST to /finish. Display thank you/finished text
- add results to :record, might need to reorganize top level
- allow text box entry for non-MR (why pick well all at 100%, other thoughts)
still haven’t figured out. but animating for the instruction choice screen helped debug bad frames
need libuldaq and rtbox, see rtbox_seeg/readme.md