-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH, MRG] Add interpolation per epoch #12334
Conversation
I like the idea to save a couple of Epochs, but I'm -1 on adding an extra method specifically for this. It is simple, but will further congest the API and creating the input It's definitely more work, but I think it would be worth in the long run. |
Really good points I hadn't considered. If we change the I think if It might be a lot of work to store the bad channels per epoch in |
Agreed I don't think modifying I think a tractable way forward is with channel-specific annotations, as these exist in |
I actually checked and it wasn't too crazy to make |
I don't object to |
Hmmm @larsoner that all sounds reasonable but it sounds like a GSoC project or something, it's even more broad in scope than what @mscheltienne was suggesting. Perhaps we can live with a simple overload of That all sounds very complicated with tagging bad epochs and channels with specific strings by the way, I'm not sure that will be implemented as such, it would make more sense to me to have a matrix with bad/interpolate entries like |
We have built / are building tools around channel-specific EDIT: annotations (not epochs), so I don't see that as a problem. Then the mapping from the bad annotations to which channels to interpolate in which time intervals of which epochs is like a two-level loop or similar (< 10 lines probably). Where do you see the complication specifically? Note that what I propose is also more general in the sense that it doesn't have to be specific to Epochs, though it would work thenre. You build the interpolation logic once and it works almost as easily for Epochs as it does for Raw. That to me is a big advantage. Something like
Rather than sticking with this binary mask idea these labels could easily be converted to annotations on the epochs object, again with a few lines of code (we could even write a convenience function for it). Then in addition to interpolation with To me this interpolation stuff is way smaller scope than GSoC and fits within a more general framework if we conceptualize it the right way from the beginning. Using a binary mask like you suggest is the easiest way to do it perhaps but doesn't fit as nicely with existing tools/frameworks in MNE, so it misses out on some opportunities. |
That sounds very convincing and reasonable other than my ignorance of the internal working of I'll just leave this PR at this state (working with For notes/record, see d9b4b83 for modifying |
I hope you don't mind me saying this @alexrockhill but this is a great example of why we encourage all our contributors to open an issue first to discuss a proposed implementation before putting in the work to code it up. (I know you can code quite fast and for you this probably wasn't a ton of time lost, but I think it's still worth making the point; those lost minutes do add up!) |
I don't mind you saying it. I had already written the code for my own analysis so it was only a couple minutes extra work in this case and I was copying how Mainak did it in autoreject so I thought it would be pretty straightforward otherwise I would have opened an issue. I wasn't aware of the active development of annotations which would fit this so good to know and it ended up basically like an issue discussion but in the future I'll keep that in mind. |
Complementing the functionality of
autoreject
, it would be nice to interpolate channels only on some epochs. For instance, if youepochs.drop_bad
and notice that there are say 15 epochs all with a different bad channel, it could be just pops or other artifact that interpolation would save you an epoch and/or a channel.