{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/69839206","id":69839206,"diff_hunk":"@@ -0,0 +1,178 @@\n+\"\"\"\n+.. _point_spread:\n+\n+Corrupt known signal with point spread\n+======================================\n+\n+The aim of this tutorial is to demonstrate how to put a known signal at a\n+desired location(s) in a :class:`mne.SourceEstimate` and then corrupt the\n+signal with point-spread by applying a forward and inverse solution.\n+\"\"\"\n+\n+import os.path as op\n+\n+import numpy as np\n+\n+import mne\n+from mne.datasets import sample\n+\n+from mne.minimum_norm import read_inverse_operator, apply_inverse\n+from mne.simulation import simulate_stc, simulate_evoked\n+\n+###############################################################################\n+# First, we set some parameters.\n+\n+seed = 42\n+\n+# parameters for inverse method\n+method = 'sLORETA'\n+snr = 3.\n+lambda2 = 1.0 / snr ** 2\n+\n+# signal simulation parameters\n+# do not add extra noise to the known signals\n+evoked_snr = np.inf\n+T = 100\n+times = np.linspace(0, 1, T)\n+dt = times[1] - times[0]\n+\n+# Paths to MEG data\n+data_path = sample.data_path()\n+subjects_dir = op.join(data_path, 'subjects')\n+fname_fwd = op.join(data_path, 'MEG', 'sample',\n+                    'sample_audvis-meg-oct-6-fwd.fif')\n+fname_inv = op.join(data_path, 'MEG', 'sample',\n+                    'sample_audvis-meg-oct-6-meg-fixed-inv.fif')\n+\n+fname_evoked = op.join(data_path, 'MEG', 'sample',\n+                       'sample_audvis-ave.fif')\n+\n+###############################################################################\n+# Load the MEG data\n+# -----------------\n+\n+fwd = mne.read_forward_solution(fname_fwd, force_fixed=True,\n+                                surf_ori=True)\n+fwd['info']['bads'] = []\n+inv_op = read_inverse_operator(fname_inv)\n+\n+raw = mne.io.RawFIF(op.join(data_path, 'MEG', 'sample',\n+                            'sample_audvis_raw.fif'))\n+events = mne.find_events(raw)\n+event_id = {'Auditory/Left': 1, 'Auditory/Right': 2}\n+epochs = mne.Epochs(raw, events, event_id, baseline=(None, 0), preload=True)\n+epochs.info['bads'] = []\n+evoked = epochs.average()\n+\n+labels = mne.read_labels_from_annot('sample', subjects_dir=subjects_dir)\n+label_names = [l.name for l in labels]\n+n_labels = len(labels)\n+\n+###############################################################################\n+# Estimate the background noise covariance from the baseline period\n+# -----------------------------------------------------------------\n+\n+cov = mne.compute_covariance(epochs, tmin=None, tmax=0.)\n+\n+###############################################################################\n+# Generate sinusoids in two spatially distant labels\n+# --------------------------------------------------\n+\n+# The known signal is all zero-s off of the two labels of interest\n+signal = np.zeros((n_labels, T))\n+idx = label_names.index('inferiorparietal-lh')\n+signal[idx, :] = 1e-7 * np.sin(5 * 2 * np.pi * times)\n+idx = label_names.index('rostralmiddlefrontal-lh')","path":"tutorials/plot_point_spread.py","position":85,"original_position":85,"commit_id":"7b4a351832faab05036801cf418609db3eec01f9","original_commit_id":"7b4a351832faab05036801cf418609db3eec01f9","user":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"body":"I would use `rostralmiddlefrontal-rh`, unless you're trying to show that it doesn't spread across the hemispheres (if so, mention it in the comments)","created_at":"2016-07-07T01:23:17Z","updated_at":"2016-07-07T01:23:18Z","html_url":"https://github.com/mne-tools/mne-python/pull/3350#discussion_r69839206","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/69839206"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/3350#discussion_r69839206"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350","id":75354106,"html_url":"https://github.com/mne-tools/mne-python/pull/3350","diff_url":"https://github.com/mne-tools/mne-python/pull/3350.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/3350.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3350","number":3350,"state":"open","locked":false,"title":"MRG: Tutorial on corrupting known source-space signals with point spread.","user":{"login":"nfoti","id":1437512,"avatar_url":"https://avatars.githubusercontent.com/u/1437512?v=3","gravatar_id":"","url":"https://api.github.com/users/nfoti","html_url":"https://github.com/nfoti","followers_url":"https://api.github.com/users/nfoti/followers","following_url":"https://api.github.com/users/nfoti/following{/other_user}","gists_url":"https://api.github.com/users/nfoti/gists{/gist_id}","starred_url":"https://api.github.com/users/nfoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfoti/subscriptions","organizations_url":"https://api.github.com/users/nfoti/orgs","repos_url":"https://api.github.com/users/nfoti/repos","events_url":"https://api.github.com/users/nfoti/events{/privacy}","received_events_url":"https://api.github.com/users/nfoti/received_events","type":"User","site_admin":false},"body":"This addresses #3308. Feedback on making the example more clear and concise is greatly appreciated. If there is something glaringly missing from the tutorial then I'm happy to add it, but I do think it should be focused on corrupting a signal with point spread, not how to apply further analysis to the resulting data.\r\n\r\nThanks.","created_at":"2016-06-27T18:04:24Z","updated_at":"2016-07-07T01:23:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f42a83eafefb3c30279da586a439f791eb04ad52","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mne-tools/mne-python/milestones/9","html_url":"https://github.com/mne-tools/mne-python/milestones/0.13","labels_url":"https://api.github.com/repos/mne-tools/mne-python/milestones/9/labels","id":1648503,"number":9,"title":"0.13","description":"","creator":{"login":"Eric89GXL","id":2365790,"avatar_url":"https://avatars.githubusercontent.com/u/2365790?v=3","gravatar_id":"","url":"https://api.github.com/users/Eric89GXL","html_url":"https://github.com/Eric89GXL","followers_url":"https://api.github.com/users/Eric89GXL/followers","following_url":"https://api.github.com/users/Eric89GXL/following{/other_user}","gists_url":"https://api.github.com/users/Eric89GXL/gists{/gist_id}","starred_url":"https://api.github.com/users/Eric89GXL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eric89GXL/subscriptions","organizations_url":"https://api.github.com/users/Eric89GXL/orgs","repos_url":"https://api.github.com/users/Eric89GXL/repos","events_url":"https://api.github.com/users/Eric89GXL/events{/privacy}","received_events_url":"https://api.github.com/users/Eric89GXL/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":51,"state":"open","created_at":"2016-03-16T17:14:08Z","updated_at":"2016-07-06T19:51:10Z","due_on":"2016-10-28T04:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350/comments","review_comment_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/3350/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/7b4a351832faab05036801cf418609db3eec01f9","head":{"label":"nfoti:point-spread-tutorial","ref":"point-spread-tutorial","sha":"7b4a351832faab05036801cf418609db3eec01f9","user":{"login":"nfoti","id":1437512,"avatar_url":"https://avatars.githubusercontent.com/u/1437512?v=3","gravatar_id":"","url":"https://api.github.com/users/nfoti","html_url":"https://github.com/nfoti","followers_url":"https://api.github.com/users/nfoti/followers","following_url":"https://api.github.com/users/nfoti/following{/other_user}","gists_url":"https://api.github.com/users/nfoti/gists{/gist_id}","starred_url":"https://api.github.com/users/nfoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfoti/subscriptions","organizations_url":"https://api.github.com/users/nfoti/orgs","repos_url":"https://api.github.com/users/nfoti/repos","events_url":"https://api.github.com/users/nfoti/events{/privacy}","received_events_url":"https://api.github.com/users/nfoti/received_events","type":"User","site_admin":false},"repo":{"id":61238128,"name":"mne-python","full_name":"nfoti/mne-python","owner":{"login":"nfoti","id":1437512,"avatar_url":"https://avatars.githubusercontent.com/u/1437512?v=3","gravatar_id":"","url":"https://api.github.com/users/nfoti","html_url":"https://github.com/nfoti","followers_url":"https://api.github.com/users/nfoti/followers","following_url":"https://api.github.com/users/nfoti/following{/other_user}","gists_url":"https://api.github.com/users/nfoti/gists{/gist_id}","starred_url":"https://api.github.com/users/nfoti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfoti/subscriptions","organizations_url":"https://api.github.com/users/nfoti/orgs","repos_url":"https://api.github.com/users/nfoti/repos","events_url":"https://api.github.com/users/nfoti/events{/privacy}","received_events_url":"https://api.github.com/users/nfoti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nfoti/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/nfoti/mne-python","forks_url":"https://api.github.com/repos/nfoti/mne-python/forks","keys_url":"https://api.github.com/repos/nfoti/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nfoti/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nfoti/mne-python/teams","hooks_url":"https://api.github.com/repos/nfoti/mne-python/hooks","issue_events_url":"https://api.github.com/repos/nfoti/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/nfoti/mne-python/events","assignees_url":"https://api.github.com/repos/nfoti/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/nfoti/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/nfoti/mne-python/tags","blobs_url":"https://api.github.com/repos/nfoti/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nfoti/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nfoti/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/nfoti/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nfoti/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/nfoti/mne-python/languages","stargazers_url":"https://api.github.com/repos/nfoti/mne-python/stargazers","contributors_url":"https://api.github.com/repos/nfoti/mne-python/contributors","subscribers_url":"https://api.github.com/repos/nfoti/mne-python/subscribers","subscription_url":"https://api.github.com/repos/nfoti/mne-python/subscription","commits_url":"https://api.github.com/repos/nfoti/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/nfoti/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/nfoti/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/nfoti/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/nfoti/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/nfoti/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nfoti/mne-python/merges","archive_url":"https://api.github.com/repos/nfoti/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nfoti/mne-python/downloads","issues_url":"https://api.github.com/repos/nfoti/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/nfoti/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/nfoti/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/nfoti/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nfoti/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/nfoti/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/nfoti/mne-python/deployments","created_at":"2016-06-15T20:17:30Z","updated_at":"2016-06-15T20:17:34Z","pushed_at":"2016-07-06T20:10:05Z","git_url":"git://github.com/nfoti/mne-python.git","ssh_url":"git@github.com:nfoti/mne-python.git","clone_url":"https://github.com/nfoti/mne-python.git","svn_url":"https://github.com/nfoti/mne-python","homepage":"http://martinos.org/mne/","size":87169,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mne-tools:master","ref":"master","sha":"8b4aa6731b828430453b6e36405313e1bea3d701","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"repo":{"id":1301584,"name":"mne-python","full_name":"mne-tools/mne-python","owner":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mne-tools/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":false,"url":"https://api.github.com/repos/mne-tools/mne-python","forks_url":"https://api.github.com/repos/mne-tools/mne-python/forks","keys_url":"https://api.github.com/repos/mne-tools/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mne-tools/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mne-tools/mne-python/teams","hooks_url":"https://api.github.com/repos/mne-tools/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mne-tools/mne-python/events","assignees_url":"https://api.github.com/repos/mne-tools/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mne-tools/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mne-tools/mne-python/tags","blobs_url":"https://api.github.com/repos/mne-tools/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mne-tools/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mne-tools/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mne-tools/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mne-tools/mne-python/languages","stargazers_url":"https://api.github.com/repos/mne-tools/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mne-tools/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mne-tools/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mne-tools/mne-python/subscription","commits_url":"https://api.github.com/repos/mne-tools/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mne-tools/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mne-tools/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mne-tools/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mne-tools/mne-python/merges","archive_url":"https://api.github.com/repos/mne-tools/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mne-tools/mne-python/downloads","issues_url":"https://api.github.com/repos/mne-tools/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mne-tools/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mne-tools/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mne-tools/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mne-tools/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mne-tools/mne-python/releases{/id}","deployments_url":"https://api.github.com/repos/mne-tools/mne-python/deployments","created_at":"2011-01-28T03:31:13Z","updated_at":"2016-07-06T19:43:53Z","pushed_at":"2016-07-07T01:19:31Z","git_url":"git://github.com/mne-tools/mne-python.git","ssh_url":"git@github.com:mne-tools/mne-python.git","clone_url":"https://github.com/mne-tools/mne-python.git","svn_url":"https://github.com/mne-tools/mne-python","homepage":"http://martinos.org/mne/","size":179449,"stargazers_count":214,"watchers_count":214,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":204,"mirror_url":null,"open_issues_count":195,"forks":204,"open_issues":195,"watchers":214,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/3350"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/3350"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/3350/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350/comments"},"review_comment":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/3350/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/7b4a351832faab05036801cf418609db3eec01f9"}}}}
{"actor":{"display_login":"Eric89GXL"}}