MRG: Allow tmin and tmax in mne.epochs.make_metadata() to accept strings#12462
MRG: Allow tmin and tmax in mne.epochs.make_metadata() to accept strings#12462larsoner merged 9 commits intomne-tools:mainfrom
tmin and tmax in mne.epochs.make_metadata() to accept strings#12462Conversation
1b81c96 to
d2dd467
Compare
…ings This makes it possible to auto-generate metadata in time windows of varying duration, e.g., from a stimulus cue to a participant's response. Here, the response might occur at different times in every epoch. Now, one could specify `tmax="response"` in this case, and capture all events from `tmin` until the response for metadata generation.
d2dd467 to
9d7eb8a
Compare
|
Do we have some example/tutorial where you could show this in action? |
|
I was considering amending the existing auto-metadata tutorial but it's way too big already ... i could add another, smaller one or an example script! |
|
Also, the code is a mess. It was already bad before I started this PR and the changes here don't make it better. Without a debugger and stepping through it line by line, I wouldn't have been able to make these amendments. This will need a serious refactoring sometime in the future. For now, I tried to provide good test coverage so we don't accidentally break stuff even if we don't always fully understand how it works |
agramfort
left a comment
There was a problem hiding this comment.
did not review the code in details but the new example is cool and a convincing usecase !
tmin and tmax in mne.epochs.make_metadata() to accept stringstmin and tmax in mne.epochs.make_metadata() to accept strings
|
Thanks @hoechenberger @SophieHerbst ! |
…t strings (mne-tools#12462) Co-authored-by: Sophie Herbst <ksherbst@gmail.com>
This makes it possible to auto-generate metadata in time windows of varying duration, e.g., from a stimulus cue to a participant's response. Here, the response might occur at different times in every epoch. Now, one can specify
tmax="response"in this case, and capture all events fromtminuntil the response for metadata generation. I imagine this to be particularly useful for MNE-BIDS-Pipeline (in fact, I'm already using this feature in my personal pipeline branch)