{"action":"created","issue":{"url":"https://api.github.com/repos/mne-tools/mne-python/issues/3757","repository_url":"https://api.github.com/repos/mne-tools/mne-python","labels_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3757/labels{/name}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3757/comments","events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3757/events","html_url":"https://github.com/mne-tools/mne-python/issues/3757","id":188520524,"number":3757,"title":"[Question] remove EOG / ECG artifacts from EEG signal","user":{"login":"ppasler","id":6583084,"avatar_url":"https://avatars.githubusercontent.com/u/6583084?v=3","gravatar_id":"","url":"https://api.github.com/users/ppasler","html_url":"https://github.com/ppasler","followers_url":"https://api.github.com/users/ppasler/followers","following_url":"https://api.github.com/users/ppasler/following{/other_user}","gists_url":"https://api.github.com/users/ppasler/gists{/gist_id}","starred_url":"https://api.github.com/users/ppasler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppasler/subscriptions","organizations_url":"https://api.github.com/users/ppasler/orgs","repos_url":"https://api.github.com/users/ppasler/repos","events_url":"https://api.github.com/users/ppasler/events{/privacy}","received_events_url":"https://api.github.com/users/ppasler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-10T14:22:20Z","updated_at":"2016-11-11T10:13:24Z","closed_at":null,"body":"Hi there,\r\n\r\nI tried to run the tutorial [Compute ICA on MEG data and remove artifacts](https://martinos.org/mne/stable/auto_tutorials/plot_ica_from_raw.html) with my own data.\r\n\r\nI have several problems with it:\r\n* `ica.fit()` Adding `eeg=40e-6` to `reject` dict leads to \"No clean segment found\"\r\nAre my data wrong?\r\n* `create_ecg_epochs` Produces a ValueError: Unable to generate artificial ECG channel\r\nWhat can I do to find the ECG channel?\r\n* `find_bads_eog` returns `[] [-0.94519416 -0.00985051  0.15899545  0.27077895 -0.00273687]`\r\nSo this means that no eog information was found?\r\nIs \"AF3\" a good pick as `ch_name`? I assume it should be a sensor near the eye.\r\n\r\nAny tips or hints will be appreciated - tanks in advance,\r\npaul\r\n\r\n\r\nThis is how I load my own data:\r\n```python\r\ndef createInfo(filePath):\r\n    with open(filePath, 'rb') as f:\r\n        ch_names = f.readline().strip().split(\",\")\r\n    ch_types = [\"eeg\"] * len(ch_names)\r\n    sfreq = 128\r\n    montage = mne.channels.read_montage(\"standard_1020\")\r\n    info = mne.create_info(ch_names, sfreq, ch_types, montage)\r\n    return info\r\n\r\ndef createRawObject(filePath):\r\n    info = createInfo(filePath)\r\n    data = np.swapaxes(np.delete(np.genfromtxt(filePath, dtype=float, delimiter=\",\"), 0, 0),0,1)\r\n    return mne.io.RawArray(data, info)\r\n\r\nfilePath = \"test_data.txt\"\r\nraw = createRawObject(filePath)\r\nraw.filter(1, 45, n_jobs=1, l_trans_bandwidth=0.5, h_trans_bandwidth=0.5,\r\n           filter_length='10s', phase='zero-double')\r\n```\r\n[test_data.txt](https://github.com/mne-tools/mne-python/files/583523/test_data.txt)"},"comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments/259925564","html_url":"https://github.com/mne-tools/mne-python/issues/3757#issuecomment-259925564","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3757","id":259925564,"user":{"login":"dengemann","id":1908618,"avatar_url":"https://avatars.githubusercontent.com/u/1908618?v=3","gravatar_id":"","url":"https://api.github.com/users/dengemann","html_url":"https://github.com/dengemann","followers_url":"https://api.github.com/users/dengemann/followers","following_url":"https://api.github.com/users/dengemann/following{/other_user}","gists_url":"https://api.github.com/users/dengemann/gists{/gist_id}","starred_url":"https://api.github.com/users/dengemann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dengemann/subscriptions","organizations_url":"https://api.github.com/users/dengemann/orgs","repos_url":"https://api.github.com/users/dengemann/repos","events_url":"https://api.github.com/users/dengemann/events{/privacy}","received_events_url":"https://api.github.com/users/dengemann/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T10:13:24Z","updated_at":"2016-11-11T10:13:24Z","body":">*Do you have a tip which EEG channels are useful to create \"synthetic\" EOG\n/ ECG channels?*\n\nHi there, this should probably be changed to give a more informative error\nmessage for EEG only inputs. Currently we extract the ECG by averaging\nmagnetometers if we find any. This of course only works if you have MEG.\n\nOn Fri, Nov 11, 2016 at 10:05 AM ppasler <notifications@github.com> wrote:\n\nHey @mmagnuski <https://github.com/mmagnuski>,\nthanks for clearing things a bit.\n\n   1. I will try to figure out a good threshold.\n   2. I don't have a ecg channel. I thought create_ecg_epochs creates a\n   synthetic channel, but the documentation sais ...a synthetic ECG channel\n   is created from cross channel average. Synthetic channel can only be\n   created from ‘meg’ channels. As I only have EEG channels, this will not\n   work.\n   3. Thanks for the link, I missed this one...\n\n*Do you have a tip which EEG channels are useful to create \"synthetic\" EOG\n/ ECG channels?*\n\n—\nYou are receiving this because you are subscribed to this thread.\nReply to this email directly, view it on GitHub\n<https://github.com/mne-tools/mne-python/issues/3757#issuecomment-259912954>,\nor mute the thread\n<https://github.com/notifications/unsubscribe-auth/AB0fis54EewF97CtA4-jeVyNer6zR_Cnks5q9C_egaJpZM4Kutn4>\n.\n"}}
{"actor":{"display_login":"dengemann"}}