{"id":17151816,"url":"https://github.com/mulimoen/eegportcodes","last_synced_at":"2025-03-24T12:27:31.219Z","repository":{"id":102521412,"uuid":"183692853","full_name":"mulimoen/EEGportcodes","owner":"mulimoen","description":"Send portcodes/triggger codes from display computer to EEG recorder","archived":false,"fork":false,"pushed_at":"2019-04-26T21:00:34.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T17:44:37.714Z","etag":null,"topics":["brainproducts","eeg","portcodes","triggercodes"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mulimoen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-26T20:53:38.000Z","updated_at":"2022-11-11T16:06:18.000Z","dependencies_parsed_at":"2023-04-20T21:02:42.912Z","dependency_job_id":null,"html_url":"https://github.com/mulimoen/EEGportcodes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulimoen%2FEEGportcodes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulimoen%2FEEGportcodes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulimoen%2FEEGportcodes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mulimoen%2FEEGportcodes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mulimoen","download_url":"https://codeload.github.com/mulimoen/EEGportcodes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245268954,"owners_count":20587698,"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":["brainproducts","eeg","portcodes","triggercodes"],"created_at":"2024-10-14T21:38:57.151Z","updated_at":"2025-03-24T12:27:31.199Z","avatar_url":"https://github.com/mulimoen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EEGportcodes\n\nThis program gives the user the possibility of sending trigger codes (portcodes) to to an EEG machine. This can be used in conjunction with for example BrainProducts EEG.\n\n\n## Background\nAn EEG (Electroencephalogram) experiment often consists of two machines, a display computer and an EEG recorder, separated for latency reasons. The display computer must communicate with the EEG recorder to synchronise stimulus presentation and trigger codes. This communication can be done over the parallel port, which modern machines are not usually equpped with. The parallel port can be emulated over a serial port, and this program treats the serial port as a parallel port, only allowing one signal (byte) at a time.\n\n\n## Usage\nThe main program ([portcode.py](portcode.py)) can be import in a program with\n```python3\nimport PortCodeHandler\n\npch = PortCodeHandler()\n\n# Stimulus, emit code:\npch.send_portcode(2)\n\n# Do other stuff\n\n# Signal new stimulus\npch.send_portcode(4)\n\n# Done sending portcodes, must close the handle\npch.close()\n```\nA testing program can executed by running portcode.py directly. BrainProducts EEG expects the portcodes to be powers of two, which gives 8 unique signals (1, 2, 4, 8, 16, 32, 64, 128). This will show up as triggers on the EEG recordings.\n\n## Dependencies\nThis program requires python3 and [pySerial](https://pythonhosted.org/pyserial/)\n\n## Technical details\nThe program spawns a background thread to read portcodes from the caller (stimulus machine) and send over the wire to the EEG recorder. Using this background thread ensures the stimulus machine does not skip a frame, while the signal will be sent properly.\n\nThe program supports sending multiple codes simultaneously, and will multiplex them, by bitwise of of the input codes. If 0 is sent, this will act as a flush, waiting until all signals have been sent before processing new codes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulimoen%2Feegportcodes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulimoen%2Feegportcodes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulimoen%2Feegportcodes/lists"}