question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] remove EOG / ECG artifacts from EEG signal

See original GitHub issue

Hi there,

I tried to run the tutorial Compute ICA on MEG data and remove artifacts with my own data.

I have several problems with it:

  • ica.fit() Adding eeg=40e-6 to reject dict leads to “No clean segment found” Are my data wrong?
  • create_ecg_epochs Produces a ValueError: Unable to generate artificial ECG channel What can I do to find the ECG channel?
  • find_bads_eog returns [] [-0.94519416 -0.00985051 0.15899545 0.27077895 -0.00273687] So this means that no eog information was found? Is “AF3” a good pick as ch_name? I assume it should be a sensor near the eye.

Any tips or hints will be appreciated - tanks in advance, paul

This is how I load my own data:

def createInfo(filePath):
    with open(filePath, 'rb') as f:
        ch_names = f.readline().strip().split(",")
    ch_types = ["eeg"] * len(ch_names)
    sfreq = 128
    montage = mne.channels.read_montage("standard_1020")
    info = mne.create_info(ch_names, sfreq, ch_types, montage)
    return info

def createRawObject(filePath):
    info = createInfo(filePath)
    data = np.swapaxes(np.delete(np.genfromtxt(filePath, dtype=float, delimiter=","), 0, 0),0,1)
    return mne.io.RawArray(data, info)

filePath = "test_data.txt"
raw = createRawObject(filePath)
raw.filter(1, 45, n_jobs=1, l_trans_bandwidth=0.5, h_trans_bandwidth=0.5,
           filter_length='10s', phase='zero-double')

test_data.txt

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:33 (33 by maintainers)

github_iconTop GitHub Comments

1reaction
ppaslercommented, Nov 24, 2016

Thanks guys, your answer cleared many things 😃 The images helped and I would appreciate any further information (especially made for noobs). To exclude #3755 I could install the bugfix branch and try it again?

I’ll have a look at the interactive mode and record some “clear blinks” to have a reference (Maybe also some with ear-blinks…). Good hint with the bad channels, I’ll check that first.

After getting my stuff to work, I will suggest some things that were unclear for me in the tutorial.

0reactions
mmagnuskicommented, Nov 30, 2016

@jona-sassenhagen not really bored now 😁 (although being back to Poland the lack of sun is even more painful 🌨️ ☁️ ). I’ll try to take a closer look into it in not so distant future (along with other mne todos that I have gathered lately).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removal of Artifacts from EEG Signals: A Review - PMC - NCBI
This paper tends to review the current artifact removal of various contaminations. We first discuss the characteristics of EEG data and the ...
Read more >
Methods for removal of artifacts from EEG signal - IOPscience
The fundamental process for eliminating unwanted signals in EEG is the regression method [7]. This method described the amplitude relation of reference and ......
Read more >
Effective EEG Artifact Removal from EEG Signal - IntechOpen
Artifact correction—This method is used for the removal of artifacts from EEG signals while keeping and maintaining the pure EEG signal. 1.6.1 Artifact...
Read more >
(PDF) Automatic ECG Artefact Removal from EEG Signals
ICA technique has been successfully implemented in identifying and removal of noise and artifacts from ECG signals. Cleaned ECG signals are obtained using ......
Read more >
Automatic ECG Artefact Removal from EEG Signals - Sciendo
requires manual inspection or the use of reference channels (EOG, EMG, ECG). ... to reconstruct the EEG data with ECG artefacts removed. A....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found