Specify an Alternate Event Files in Functions Like mne.io.read_raw_nirx
See original GitHub issueLike many other labs I’m sure, our triggers were not originally set up correctly to record in NIRStar all of the events that PsychoPy has intended, and so I’ve gone and generated (from the PsychoPy output) a new custom .evt file. I’d like to be able to read in these events using mne.read_events, but this function does not accommodate for NIRx systems or .evt style files, which the NIRx io function is reading. It is trivial to replace the old .evt files, except I would like to keep the original .evt files as well, side by side.
This could be accomplished with an optional keyword parameter in mne.io.read_nirx, which, when set, replaces the line expecting the filename prior to “.evt” to the custom parameter setting.
On this page: https://github.com/mne-tools/mne-python/blob/maint/1.0/mne/io/nirx/nirx.py#L26-L51
we would include:
- optional parameter in read_raw_nirx,
alt_evt=None - pass the param to RawNIRX ?
- under the comment “read triggers from event file” line ~ 441:
if alt_evt is not None:files['tri'] = alt_evt+".evt"
This alone should accomplish this feature.
Describe possible alternatives
If you’ve suggested an implementation above, list here any alternative implementations you can think of, and brief comments explaining why the chosen implementation is better.
The alternative solution would be to build out the read_events file to accommodate .evt style files. This may be beneficial, but from the documentation it appears that they only accept .fif currently, a changing format that might be hard to stay compatible with.
Open to other alternative solutions!
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
So far the way we’ve handled “optional/other annotation-like files” for other readers is by making
read_annotationssupport reading those files, then letting people doraw.set_annotationsorraw.annotations.append(...). Since the.evtshow up as Annotations in the raw data, I think it makes sense to live inread_annotations.Ultimately, @larsoner this is preferable! I’m going to start work on a fork now to try to implement this.