Repository navigation
Store missing BIDS channel coordinates as empty arrays - #589
Conversation
pop_load_frombids replaces coordinates left empty by eeg_checkchanlocs with the empty numeric value used for a cleared channel. A channel with no electrodes.tsv row keeps those empty values through save and reload. Co-authored-by: Suraj Ranganath <[email protected]>
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 @suraj-ranganath's task in 58s —— View job Code review
BlockingNone. ImportantNone. Nits
Test gapsNone. The new test covers both cases: a channel with coordinates and a channel missing from EEGLAB parity notesNone. Empty Checked: correctness of the |
| edf_path = eeg_dir / "sub-01_task-x_eeg.edf" | ||
| writer = pyedflib.EdfWriter(str(edf_path), len(names), file_type=pyedflib.FILETYPE_EDFPLUS) | ||
| writer.setSignalHeaders( | ||
| [ | ||
| { | ||
| "label": name, | ||
| "dimension": "uV", | ||
| "sample_frequency": 250, | ||
| "physical_min": -500, | ||
| "physical_max": 500, | ||
| "digital_min": -32768, | ||
| "digital_max": 32767, | ||
| "transducer": "", | ||
| "prefilter": "", | ||
| } | ||
| for name in names | ||
| ] | ||
| ) | ||
| writer.writeSamples(list(np.random.default_rng(0).standard_normal((len(names), 250)) * 20)) |
There was a problem hiding this comment.
Nit: This writes the EDF+ file by hand, but the same file already has a helper for it: _write_edf_family / _signal_headers (
eegprep/tests/test_bids_load_frombids_helpers.py
Lines 305 to 323 in 90757c0
tests/fixtures.py or local helpers already present in the relevant test file."
Suggested fix: replace this block with:
_write_edf_family(
edf_path,
list(np.random.default_rng(0).standard_normal((len(names), 250)) * 20),
labels=names,
srate=250,
file_type=pyedflib.FILETYPE_EDFPLUS,
digital_min=-32768,
digital_max=32767,
)The helper's physical range is ±100 µV, and that still covers the ~N(0, 20) signal.
There was a problem hiding this comment.
🤖
The test now writes the EDF with _write_edf_family.
The round-trip test writes its recording with the shared EDF helper. Co-authored-by: Suraj Ranganath <[email protected]>
|
I'll analyze this and get back to you. |
|
Claude finished @suraj-ranganath's task in 37s —— View job Code review
BlockingNone. ImportantNone. NitsNone. The earlier nit about writing the EDF file by hand is fixed: the test now uses Test gapsNone.
EEGLAB parity notesNone. EEGLAB stores a channel without a location as empty Checked for:
I couldn't run the test or |
|
🤖 |

Missing electrode coordinates from pop_load_frombids are empty arrays, the same value used when a channel location is cleared. Saving that dataset and loading it again keeps the empty coordinates.
Fixes #538