{"id":19902808,"url":"https://github.com/lmbooth/qt-nback_study","last_synced_at":"2026-01-29T01:13:37.093Z","repository":{"id":176914963,"uuid":"659735080","full_name":"LMBooth/QT-nback_study","owner":"LMBooth","description":"This folder holds source code to run a baseline, 1,2,3 and 4 step n-back study which generates relative LSL markers send for each trigger. All written in Python utilising PyQt5 as the GUI and timer. ","archived":false,"fork":false,"pushed_at":"2023-06-28T12:58:05.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-11T21:23:00.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LMBooth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-28T12:55:25.000Z","updated_at":"2023-06-28T12:55:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"9964572e-ab15-4c1f-898c-9f0addd5502f","html_url":"https://github.com/LMBooth/QT-nback_study","commit_stats":null,"previous_names":["lmbooth/qt-nback_study"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMBooth%2FQT-nback_study","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMBooth%2FQT-nback_study/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMBooth%2FQT-nback_study/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMBooth%2FQT-nback_study/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LMBooth","download_url":"https://codeload.github.com/LMBooth/QT-nback_study/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241329437,"owners_count":19944988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T20:19:40.435Z","updated_at":"2026-01-29T01:13:37.087Z","avatar_url":"https://github.com/LMBooth.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QT-nback_study\nPyQt5 n-back task (baseline, 1-4 back) that emits Lab Streaming Layer (LSL) marker strings for each trial. The repo also includes an XDF-to-BIDS conversion pipeline under `conversion_package/`.\n\n## Quickstart\n1. Create a virtual environment and install dependencies.\n2. Run the experiment from the repo root (or `n-back/`).\n\nCreate the venv:\n```bash\npython -m venv .venv\n```\n\nActivate it (pick your shell):\n```powershell\n.\\.venv\\Scripts\\Activate.ps1\n```\n```cmd\n.\\.venv\\Scripts\\activate.bat\n```\n```bash\nsource .venv/bin/activate\n```\n\nInstall requirements and run:\n```bash\npython -m pip install -r requirements.txt\npython n-back/mainExperiment.py\n```\n\nControls:\n- Space: respond to a match\n- Q: quit the experiment window\n\n## Data capture and conversion\n- The experiment emits LSL markers on the `n-backMarkers` stream; use Lab Recorder (or another LSL recorder) to save XDF files.\n- Store raw recordings under `nback_Data/sourcedata`.\n- The n-back BIDS conversion pipeline lives in `conversion_package/`; follow `conversion_package/README.md` to rebuild `bids_nback` from the XDFs and demographics.\n- The QC plotter is included in `conversion_package/qc` for inspecting EEG/ECG/pupil with event overlays after conversion; see `conversion_package/qc/README.md` for usage.\n\n## Requirements\n- Python 3.9+\n- OS: Windows (developed on Windows 11 Professional)\n- PyQt5, pylsl, numpy, playsound (see `requirements.txt`)\n- An LSL recorder/receiver if you want to capture markers\n- On some Linux setups, `pylsl` may require a separate `liblsl` install\n\n## Reproducibility notes\n- The stimulus sequence is randomized using `random` and `numpy`; set seeds if you need deterministic sequences.\n- This code does not save data to disk. Record markers with an LSL consumer if you need logs.\n\n## Marker format\nMarkers are single strings on the `n-backMarkers` LSL stream.\n- \"Started tutorial n-back\" and \"Started n-back\" are emitted at block start.\n- For each trial, the result marker is `Steps:\u003cN\u003e KeyPress:\u003cTrue|False\u003e Matched:\u003cTrue|False\u003e`.\n- \"Finished tutorial n-back\" and \"Finished n-back\" are emitted at block end.\n\n## Timing parameters\nTiming is defined in `n-back/mainExperiment.py` via `QTimer.singleShot` calls.\n- Tutorial starts with a 60 s fixation (\"x\") before the first instructions.\n- Experiment start uses a 1 s blank before the first instructions.\n- The \"Remember N steps back\" instruction screen shows for 6.0 s.\n- Each trial shows a letter for 1.0 s, then a 0.7 s blank before the next letter.\n- Between blocks there is a 1.0 s blank, then the next instruction screen.\n\n## Docker (optional)\nThe GUI requires a display server. On Linux hosts with X11:\n```bash\ndocker build -t qt-nback .\nxhost +local:docker\ndocker run --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix qt-nback\n```\n\n## Citation\nSee `CITATION.cff` for citation metadata. Update it with a DOI after creating the Zenodo record.\n\n## License\nThis repository is released under CC0 1.0 Universal. See `LICENSE`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmbooth%2Fqt-nback_study","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmbooth%2Fqt-nback_study","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmbooth%2Fqt-nback_study/lists"}