mne-tools / mne-tools/mne-python
Allow baseline time window selection from other events
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
Describe the new feature or enhancement
Currently, all of the baseline inputs (for example in the Epochs class) require a tuple of start and end times. This assumes you want to calculate your baseline with respect to the same event which you are epoching from.
Lets say I have two events: 'e1' and 'e2'. I want to create an epoch that goes from -1s to 2 seconds around 'e2' with a baseline correction from -0.5s to 0 with respect to 'e1'
events, event_id = mne.events_from_annotations(raw)
e2 = mne.Epochs(raw, events, event_id['e2'], tmin=-1, tmax=1.5, baseline=None)
baseline = mne.Epochs(raw, events, event_id['e1'], tmin=-0.5, tmax=0, baseline=None)
e2 is the time frame I'm interested in, and baseline is the data I'd like to use for baseline correction. Setting baseline=(-0.5,0) would only do so with respect to 'e2'.
Describe your proposed implementation
e2 = mne.Epochs(raw, events, event_id['e2'], tmin=-1, tmax=1.5, baseline={event_id['e1'] : (-0.5,0)})
Describe possible alternatives
e2 = mne.Epochs(raw, events, event_id['e2'], tmin=-1, tmax=1.5, baseline=(-0.5,0), baseline_event=event_id['e1'])
e2 = mne.Epochs(raw, events, event_id['e2'], tmin=-1, tmax=1.5, baseline=(event_id['e1'],-0.5,0))
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the mne.Epochs entry point and trace how its baseline argument is interpreted relative to selected events. Define the behavior for using e1 as the baseline while epoching around e2, including how the proposed input form should be validated and documented; the issue is complete when that workflow works reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100