{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/30750817","id":30750817,"diff_hunk":"@@ -0,0 +1,69 @@\n+\"\"\"\n+Extracting brain signal from spheres\n+====================================\n+\n+This example extract brain signals from spheres described by the coordinates\n+of their center in MNI space and a given radius in millimeters. In particular,\n+this example extracts signals from Default Mode Network regions and compute a\n+connectome from them.\n+\n+\"\"\"\n+\n+# Fetching datasets ###########################################################\n+from nilearn import datasets\n+adhd_dataset = datasets.fetch_adhd(n_subjects=1)\n+\n+# print basic information on the dataset\n+print('First subject functional nifti image (4D) is at: %s' %\n+      adhd_dataset.func[0])  # 4D data\n+\n+\n+# Extracting region signals ###################################################\n+from nilearn import input_data\n+\n+\n+# Coordinates of Default Mode Network\n+dmn_coords = [(0, -52, 18), (-46, -68, 32), (46, -68, 32), (0, 50, -5)]\n+labels = [\n+    'Posterior Cingulate Cortex',\n+    'Left Temporoparietal junction',\n+    'Right Temporoparietal junction',\n+    'Medial prefrontal cortex'\n+]\n+\n+masker = input_data.NiftiSpheresMasker(\n+    dmn_coords, radius=8,\n+    detrend=True, standardize=True,\n+    low_pass=0.1, high_pass=0.01, t_r=2.5,\n+    memory='nilearn_cache', memory_level=1, verbose=2)\n+\n+func_filename = adhd_dataset.func[0]\n+confound_filename = adhd_dataset.confounds[0]\n+\n+time_series = masker.fit_transform(func_filename,\n+                             confounds=[confound_filename])\n+\n+\n+# Computing group-sparse precision matrices ###################################\n+from sklearn.covariance import LedoitWolf\n+cve = LedoitWolf()\n+cve.fit(time_series)\n+\n+# Displaying results ##########################################################\n+import matplotlib.pyplot as plt\n+from nilearn import plotting\n+\n+# Display time series\n+for time_serie, label in zip(time_series.T, labels):\n+    plt.plot(time_serie, label=label)\n+\n+plt.title('Default Mode Network Time Series')\n+plt.xlabel('Time')","path":"examples/connectivity/plot_adhd_spheres.py","position":61,"original_position":61,"commit_id":"e75633db1076394ec1048ca7eb5419ccad4427ad","original_commit_id":"e75633db1076394ec1048ca7eb5419ccad4427ad","user":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexandreAbraham","html_url":"https://github.com/AlexandreAbraham","followers_url":"https://api.github.com/users/AlexandreAbraham/followers","following_url":"https://api.github.com/users/AlexandreAbraham/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreAbraham/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreAbraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreAbraham/subscriptions","organizations_url":"https://api.github.com/users/AlexandreAbraham/orgs","repos_url":"https://api.github.com/users/AlexandreAbraham/repos","events_url":"https://api.github.com/users/AlexandreAbraham/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreAbraham/received_events","type":"User","site_admin":false},"body":"Fixed. I put 'TR'.","created_at":"2015-05-20T21:21:50Z","updated_at":"2015-05-20T21:21:50Z","html_url":"https://github.com/nilearn/nilearn/pull/430#discussion_r30750817","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/430","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/30750817"},"html":{"href":"https://github.com/nilearn/nilearn/pull/430#discussion_r30750817"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/430"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/430","id":29338196,"html_url":"https://github.com/nilearn/nilearn/pull/430","diff_url":"https://github.com/nilearn/nilearn/pull/430.diff","patch_url":"https://github.com/nilearn/nilearn/pull/430.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/430","number":430,"state":"open","locked":false,"title":"[MRG] Nifti spheres masker","user":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexandreAbraham","html_url":"https://github.com/AlexandreAbraham","followers_url":"https://api.github.com/users/AlexandreAbraham/followers","following_url":"https://api.github.com/users/AlexandreAbraham/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreAbraham/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreAbraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreAbraham/subscriptions","organizations_url":"https://api.github.com/users/AlexandreAbraham/orgs","repos_url":"https://api.github.com/users/AlexandreAbraham/repos","events_url":"https://api.github.com/users/AlexandreAbraham/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreAbraham/received_events","type":"User","site_admin":false},"body":"Addresses #353.\r\n\r\nWhat is left to do:\r\n- [x] Improve code coverage if possible\r\n- [x] Decide what to do if seed is outside of fov (ATM, it will select the closest voxel, meaning one valid voxel on the edge). Suggested behavior: if the seed is too far from the edge, raise an error.\r\n- [x] Edit: add mask handling. If some voxels are in a ball but outside of the mask, they shouldn't be considered.\r\n- [x] Decide what to do in case of duplicate in the seeds (this can be an unwanted behavior if two seeds are close and the resolution of the data is low)\r\n- [x] Open issue about documentation\r\n- [x] Add example","created_at":"2015-02-15T17:59:01Z","updated_at":"2015-05-20T21:21:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c70c4d1db5c10d0c83ba5e8106778330d446969","assignee":null,"milestone":{"url":"https://api.github.com/repos/nilearn/nilearn/milestones/10","html_url":"https://github.com/nilearn/nilearn/milestones/0.1.4","labels_url":"https://api.github.com/repos/nilearn/nilearn/milestones/10/labels","id":1071796,"number":10,"title":"0.1.4","description":"Since 0.1.3 will mainly be a bugfix, this release contains the new features that will come before 2.0","creator":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexandreAbraham","html_url":"https://github.com/AlexandreAbraham","followers_url":"https://api.github.com/users/AlexandreAbraham/followers","following_url":"https://api.github.com/users/AlexandreAbraham/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreAbraham/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreAbraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreAbraham/subscriptions","organizations_url":"https://api.github.com/users/AlexandreAbraham/orgs","repos_url":"https://api.github.com/users/AlexandreAbraham/repos","events_url":"https://api.github.com/users/AlexandreAbraham/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreAbraham/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":2,"state":"open","created_at":"2015-04-17T07:22:57Z","updated_at":"2015-05-19T07:44:31Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/430/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/430/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/430/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/e75633db1076394ec1048ca7eb5419ccad4427ad","head":{"label":"AlexandreAbraham:nifti_spheres_masker","ref":"nifti_spheres_masker","sha":"e75633db1076394ec1048ca7eb5419ccad4427ad","user":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexandreAbraham","html_url":"https://github.com/AlexandreAbraham","followers_url":"https://api.github.com/users/AlexandreAbraham/followers","following_url":"https://api.github.com/users/AlexandreAbraham/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreAbraham/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreAbraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreAbraham/subscriptions","organizations_url":"https://api.github.com/users/AlexandreAbraham/orgs","repos_url":"https://api.github.com/users/AlexandreAbraham/repos","events_url":"https://api.github.com/users/AlexandreAbraham/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreAbraham/received_events","type":"User","site_admin":false},"repo":{"id":4038777,"name":"nilearn","full_name":"AlexandreAbraham/nilearn","owner":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexandreAbraham","html_url":"https://github.com/AlexandreAbraham","followers_url":"https://api.github.com/users/AlexandreAbraham/followers","following_url":"https://api.github.com/users/AlexandreAbraham/following{/other_user}","gists_url":"https://api.github.com/users/AlexandreAbraham/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexandreAbraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexandreAbraham/subscriptions","organizations_url":"https://api.github.com/users/AlexandreAbraham/orgs","repos_url":"https://api.github.com/users/AlexandreAbraham/repos","events_url":"https://api.github.com/users/AlexandreAbraham/events{/privacy}","received_events_url":"https://api.github.com/users/AlexandreAbraham/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexandreAbraham/nilearn","description":"NeuroImaging with the Scikit-learn: fMRI inverse inference tutorial","fork":true,"url":"https://api.github.com/repos/AlexandreAbraham/nilearn","forks_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/forks","keys_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/teams","hooks_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/hooks","issue_events_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/events","assignees_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/tags","blobs_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/languages","stargazers_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/stargazers","contributors_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/contributors","subscribers_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/subscribers","subscription_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/subscription","commits_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/merges","archive_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/downloads","issues_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/AlexandreAbraham/nilearn/releases{/id}","created_at":"2012-04-16T08:08:33Z","updated_at":"2015-05-07T07:53:54Z","pushed_at":"2015-05-13T12:14:02Z","git_url":"git://github.com/AlexandreAbraham/nilearn.git","ssh_url":"git@github.com:AlexandreAbraham/nilearn.git","clone_url":"https://github.com/AlexandreAbraham/nilearn.git","svn_url":"https://github.com/AlexandreAbraham/nilearn","homepage":"http://nisl.github.com/","size":7775,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":6,"forks":1,"open_issues":6,"watchers":5,"default_branch":"master"}},"base":{"label":"nilearn:master","ref":"master","sha":"9fa8d941998169db0f46181cc0e0eb349fa6d568","user":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"repo":{"id":1235740,"name":"nilearn","full_name":"nilearn/nilearn","owner":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?v=3","gravatar_id":"","url":"https://api.github.com/users/nilearn","html_url":"https://github.com/nilearn","followers_url":"https://api.github.com/users/nilearn/followers","following_url":"https://api.github.com/users/nilearn/following{/other_user}","gists_url":"https://api.github.com/users/nilearn/gists{/gist_id}","starred_url":"https://api.github.com/users/nilearn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilearn/subscriptions","organizations_url":"https://api.github.com/users/nilearn/orgs","repos_url":"https://api.github.com/users/nilearn/repos","events_url":"https://api.github.com/users/nilearn/events{/privacy}","received_events_url":"https://api.github.com/users/nilearn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nilearn/nilearn","description":"Machine learning for NeuroImaging in Python","fork":false,"url":"https://api.github.com/repos/nilearn/nilearn","forks_url":"https://api.github.com/repos/nilearn/nilearn/forks","keys_url":"https://api.github.com/repos/nilearn/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilearn/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilearn/nilearn/teams","hooks_url":"https://api.github.com/repos/nilearn/nilearn/hooks","issue_events_url":"https://api.github.com/repos/nilearn/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/nilearn/nilearn/events","assignees_url":"https://api.github.com/repos/nilearn/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/nilearn/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/nilearn/nilearn/tags","blobs_url":"https://api.github.com/repos/nilearn/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilearn/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilearn/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilearn/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/nilearn/nilearn/languages","stargazers_url":"https://api.github.com/repos/nilearn/nilearn/stargazers","contributors_url":"https://api.github.com/repos/nilearn/nilearn/contributors","subscribers_url":"https://api.github.com/repos/nilearn/nilearn/subscribers","subscription_url":"https://api.github.com/repos/nilearn/nilearn/subscription","commits_url":"https://api.github.com/repos/nilearn/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilearn/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilearn/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilearn/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilearn/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/nilearn/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilearn/nilearn/merges","archive_url":"https://api.github.com/repos/nilearn/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilearn/nilearn/downloads","issues_url":"https://api.github.com/repos/nilearn/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/nilearn/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/nilearn/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/nilearn/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilearn/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/nilearn/nilearn/releases{/id}","created_at":"2011-01-09T19:02:23Z","updated_at":"2015-05-12T19:21:26Z","pushed_at":"2015-05-20T18:02:47Z","git_url":"git://github.com/nilearn/nilearn.git","ssh_url":"git@github.com:nilearn/nilearn.git","clone_url":"https://github.com/nilearn/nilearn.git","svn_url":"https://github.com/nilearn/nilearn","homepage":"http://nilearn.github.io","size":13795,"stargazers_count":81,"watchers_count":81,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":66,"forks":62,"open_issues":66,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/430"},"html":{"href":"https://github.com/nilearn/nilearn/pull/430"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/430"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/430/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/430/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/430/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/e75633db1076394ec1048ca7eb5419ccad4427ad"}}}}