Repository navigation
[GUI] Edit BIDS event field mappings in the public metadata table - #1050
arnodelorme wants to merge 3 commits into
Conversation
|
🤖 Review before taking this out of draft. State. The updated parent (#1048) is merged in ( What I checked. The event table has the eight columns of Finding that matters for the merge. This also changes the files that are written: Verdict: ready for review. |
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @arnodelorme's task in 1m 25s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notes
I posted the two Important findings as inline comments as well. |
| defaults = { | ||
| "onset": ("From sample", "Event onset", "Time from the start of the recording to the event onset.", "second"), | ||
| "duration": ("duration", "Event duration", "Duration of the event in seconds.", "second"), | ||
| "sample": ("latency", "Sample", "Sample at which the event starts.", ""), | ||
| "value": ("type", "Event marker", "Marker value associated with the event.", ""), | ||
| } |
There was a problem hiding this comment.
Important: pressing Ok without edits now changes the exported events.json.
_write_events_json starts from its own defaults: onset/duration "Units": "s", and sample "1-based sample index of the event onset". It then replaces each key with whatever is stored. Before this PR, pressing Ok left these four keys unstored. Now these defaults are stored, so the sidecar gets:
"Units": "second"for onset and duration. BIDS asks for CMIXF symbols, so this should bes."EEGLABField": "From sample"for onset. That is a GUI label, not anEEG.eventfield.- a sample description without the 1-based note.
Fix: match the exporter's defaults ("s", the 1-based wording) and leave onset's eeglab_field empty. Better still, define the four core defaults once and import them in both modules.
| result = _read_table(table, _EVENT_COLUMNS) | ||
| for row in result: | ||
| prefix = row.pop("UnitPrefix", "") | ||
| if prefix and row.get("Units"): | ||
| row["Units"] = prefix + row["Units"] | ||
| return result |
There was a problem hiding this comment.
Important: the prefix does not survive a round trip.
- It is joined into
Unitshere. When the table is reopened, Unit Prefix is empty and Unit Name shows the joined string. - A prefix entered without a unit name is silently dropped.
- The join happens only in the Qt path, so
event_fields=[{"UnitPrefix": ...}]loses the prefix entirely:_event_field_mapnever reads it.
Fix: keep UnitPrefix in _event_field_map and in the stored dict, and do the join only in _write_events_json.
The public event editor opens the metadata table for a single recording and for a dataset collection. Add and remove custom event fields, edit unit names and prefixes, and retain terminology URLs in exported sidecars. The standard event fields are protected from removal. Stacked on #1048 (
agent/issue-875-file-taskinfo).Measurements and verification
Native client dimensions on jamming were 800.0 × 500.0 px in MATLAB, 278 × 244 before and 824 × 480 after. Native MATLAB is 800 × 500 pixels. The actual Qt table went from 278 × 244 to 824 × 480 pixels. Three submitted GUI cases stored exactly the entered event descriptions in both programs. Levels remain editable inline in EEGPrep. The two File/BIDS suites passed 114 tests with 5 deselected. The Qt capture used the guarded checkout on PYTHONPATH.
Closes #1051. Part of #875.
Full inventory report for the project team. pop_eventinfo (p. 13). PDF · Editable Word.