mne-bids-pipeline
mne-bids-pipeline copied to clipboard
Making epochs optional
Hi,
Right now the way the pipeline is set-up, epoching is necessary.
I would however need to apply the ica on the raw recording instead of the epoched data. Is it planned for this pipeline to be able to do that? I will need to do it anyway, and I'll be happy to have my version of the code which does that, but it might be interesting to add this feature as a PR here.
Please let me know what you think
one issue with ICA on raw data is that it makes it harder to remove bad data segments that can seriously alter the results on non-Gaussian ICA (such as fastica or picard or infomax). Also for non-Gaussian ICA time structure does not matter. It takes time samples as independent observations.
note also that you can compute ICA on epochs an apply it on raw
one issue with ICA on raw data is that it makes it harder to remove bad data segments
You mean because if there's a bad segment, we get edge artifacts, whereas with epochs, we would drop the entire epoch?
one issue with ICA on raw data is that it makes it harder to remove bad data segments
You mean because if there's a bad segment, we get edge artifacts, whereas with epochs, we would drop the entire epoch?
you would need annotations to have ICA ignore crap segments with raw. There is no edge artifact issue for temporal ICA like we use here.
Ok so if I understand correctly the options are:
- Annotate bad segments in the raw data, then compute ICA on the raw data, ignoring bad segments.
- Compute the ICA on epoched data, and apply it on the raw data.
It seems to me that the second option would be easiest, but maybe not optimal, and I will likely need to annotate bad segments anyway. Would it be possible to arbitrarily segment the data into small epochs, and apply the rejection method from mne? Otherwise, would it be feasible to use SSP instead?
It seems to me that the second option would be easiest, but maybe not optimal, and I will likely need to annotate bad segments anyway. Would it be possible to arbitrarily segment the data into small epochs, and apply the rejection method from mne?
you mean use https://mne.tools/dev/generated/mne.make_fixed_length_epochs.html#mne.make_fixed_length_epochs
that's what is currently planned for rest data
yes that's what I meant.
If there's any way I can help with adding this to the pipeline, I'd be happy to because I will need it.
I would then suggest you take what you need in https://github.com/mne-tools/mne-bids-pipeline/pull/276/files and start a fresh PR. We'll rebase and clean https://github.com/mne-tools/mne-bids-pipeline/pull/276/files later once we have your improvements.
I'll get on it then
great !
Amazing!
I'll get on it then
I guess it will take some more time? :)
@moritz-gerster see WIP #296 and discussion there