Skip to content
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

Pyprep drops eog channels from mne.info #27

Closed
SebastianSpeer opened this issue May 28, 2020 · 4 comments
Closed

Pyprep drops eog channels from mne.info #27

SebastianSpeer opened this issue May 28, 2020 · 4 comments

Comments

@SebastianSpeer
Copy link

Dear pyprep-team,

I've used pyprep for preprocessing my EEG data and now want to do additional preprocessing steps including ICA. For ICA I want to use the EOG channel as a reference channel to select ICA components. Unfortunately, during preprocessing the eog channels were dropped from the info structure and it does not seem to be possible to add the back. Is this an issue with the pyprep pipeline or is there a simple workaround?

Before pyprep:

`<Info | 8 non-empty values
bads: []
ch_names: Fp1, AF7, AF3, F1, F3, F5, F7, FT7, FC5, FC3, FC1, C1, C3, C5, ...
chs: 64 EEG, 4 EOG
custom_ref_applied: False
dig: 67 items (3 Cardinal, 64 EEG)
highpass: 0.0 Hz
lowpass: 104.0 Hz
meas_date: 2018-04-06 09:34:26 UTC
nchan: 68
projs: []
sfreq: 512.0 Hz

`

After pyprep:

`<Info | 8 non-empty values
bads: []
ch_names: Fp1, AF7, AF3, F1, F3, F5, F7, FT7, FC5, FC3, FC1, C1, C3, C5, ...
chs: 64 EEG
custom_ref_applied: False
dig: 67 items (3 Cardinal, 64 EEG)
highpass: 0.0 Hz
lowpass: 50.0 Hz
meas_date: 2018-04-06 09:34:26 UTC
nchan: 64
projs: []
sfreq: 100.0 Hz

`

@sappelhoff
Copy link
Owner

Hi @SebastianSpeer can you post that part of the code where you call pyprep?

Markdown tip:

If you want to format code over multiple lines, you need to use three backticks at the start, and at the end:

like this:

```
#code goes here
```

To also add coloring to your code snippet, you can add the language to be used for coloring to the top line, e.g.

```Python
def my_python_func(a,b):
    return a**b
```

for code on a single line, you can use single backticks, like you did: hello this is code

@yjmantilla
Copy link
Collaborator

I think you should be able to copy the eog channels to another object (in example copying the raw object and then dropping all but eog); then add them back to the raw object thats preprocessed with raw.add_channels().

Now there may be problems with the times (ie the array length)? Im not sure, I think there should not be problems. But thats one thing to try, never done it though.

The dropping inside pyprep is indeed done in the constructor of the PrepPipeline class. Incidentally maybe inside prep we should do that to not lose the eog channels when we return the preprocessed object.

@yjmantilla
Copy link
Collaborator

@SebastianSpeer did you make another comment here? Because in my email notifications it seems like you commented something else but here is nowhere to be found.

@SebastianSpeer
Copy link
Author

@yjmantilla I initially commented something, but then I figured it out myself. Your suggestion worked fine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants