mne-bids-pipeline
mne-bids-pipeline copied to clipboard
WIP: ICA clean raw data
This code works for one dataset, on one subject. I will do the tests soon when I get the time.
I open this PR for feedback. Some ironing out will need to be done, this is very much still a work in progress.
I would suggest to remove all auto reject related code here and to focus on the rest. We can add auto reject in a next PR
If this is because the checks fail, I think it would be an easy fix, but it's probably best to keep autoreject separate for now. It work fine for me though, so it shouldn't be too hard to add later.
I looked at how mne handles the computation of the source PSD for raw data (mne.minimum_norm.compute_source_psd), and it appears that it just creates an Epoch instance with only 1 epoch which is the length of the raw recording, and calls the mne.minimum_norm.compute_source_psd_epochs function.
We could maybe take inspiration from this? I could adapt the PR
as soon as you have an epoch you're blocked to ignore/remove transient artifacts
yes that's true but that will be always be a problem anyway. If I can't epoch my data because I need long recordings, then there's not much I can about it either way, unless I missed something.
It would be nice to have mne functions on raw data that ignore transient artifacts based on annotations, but I don't think that's available yet? For instance if I want the compute the PSD on raw data, it does not take into account BAD annotations
yes that's true but that will be always be a problem anyway. If I can't epoch my data because I need long recordings, then there's not much I can about it either way, unless I missed something.
honestly I am wondering how realistic this is. If you take the full camcan data > 600 subjects how many subjects have a rest session with no artifacts beyond flux jumps?
as discussed last friday let's do one thing at a time.
first the annotate_flux_jump function in mne then a function to fix them by temporal interpolation then we see how to use this in the pipeline
As of #840 ICA (and SSP) are now also applied to raw data and saved to disk as proc-clean