Closed a-hurst closed 2 years ago
Continuing the conversation here.
About the experimental branch: See the changes of the experimental version: https://github.com/bnicenboim/eeguana/blob/experimental/NEWS.md I think it's stable (there are two more regular users of that branch that I'm aware of), the only thing that you need to be aware is that I'm changing the arguments of the functions to be more consistent, and that might break some of your code.
About the EDF+: Are you creating them with MNE? Could you create a version of one file with just a couple of samples so that I include it in my tests?
About the preprocessing: I'm just curious of what's missing to be able to do the entire thing here (for you of course).
1) Cool, I'll give it a shot!
2) Kind of, I had to hack together a pure-Python EDF+ exporter based on pyedf
because the C-based pyEDFlib
wouldn't export my data from MNE properly. I should be able to generate you a small test file for eeguana using it!
3) The big thing here I can't do yet in R is the PREP pipeline, which automatically and reproducibly a) removes line noise without applying a notch filter, using a sliding-window algorithm, b) performs robust average re-referencing on the data using a RANSAC-based algorithm to detect and ignore noisy/otherwise "bad" channels while calculating an average reference, and c) optionally reinterpolates channels still flagged as "bad" after referencing using data from the non-bad electrodes and a 3D spatial model of the good electrode locations. There's a WIP Python-based version by one of the MNE mantainers here which is what I'm using.
Theoretically all of 3) is possible in R, but I don't understand the inner workings of the pipeline well enough that I could imagine re-implementing any of it in R in any reasonable timeframe myself so I'm running it in Python and that passing it over to R using EDF as a go-between.
ok, I'm adding the PREP pipeline as an issue. I'll have an intern next year that might be able to give it a shot.
Regarding 2, if you do the MNE pipeline in a shared environment using reticulate, you might be able to transform the object into eeglist by using as_eeg_lst(python_obj)
. I have tried it after opening a file with brain vision in MNE, and it works. It might work also for EDF+, but I'm not sure to which extent.
Okay, rebased my previous PR on the experimental branch! Thankfully there weren't any merge conflicts.