{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/204247715","pull_request_review_id":139292470,"id":204247715,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDI0NzcxNQ==","diff_hunk":"@@ -513,6 +513,137 @@ def compute_multi_background_mask(data_imgs, border_size=2, upper_cutoff=0.85,\n     return mask\n \n \n+def compute_gray_matter_mask(target_img, threshold=.5,\n+                             connected=True, opening=2, memory=None,\n+                             verbose=0):\n+    \"\"\" Compute a mask corresponding to the gray matter part of the brain.\n+    The gray matter part is calculated through the resampling of MNI152\n+    template Gray Matter mask onto the image\n+\n+    Parameters\n+    ----------\n+    target_img: Niimg-like object\n+        See http://nilearn.github.io/manipulating_images/input_output.html\n+        Images used to compute the mask. 3D and 4D images are accepted.\n+        Only the shape and affine of target_img will be used here.\n+\n+    threshold: float, optional","path":"nilearn/masking.py","position":18,"original_position":18,"commit_id":"3057488ead7b95330c7532f2214ff0d46e8302aa","original_commit_id":"3057488ead7b95330c7532f2214ff0d46e8302aa","user":{"login":"KamalakerDadi","id":11410385,"node_id":"MDQ6VXNlcjExNDEwMzg1","avatar_url":"https://avatars2.githubusercontent.com/u/11410385?v=4","gravatar_id":"","url":"https://api.github.com/users/KamalakerDadi","html_url":"https://github.com/KamalakerDadi","followers_url":"https://api.github.com/users/KamalakerDadi/followers","following_url":"https://api.github.com/users/KamalakerDadi/following{/other_user}","gists_url":"https://api.github.com/users/KamalakerDadi/gists{/gist_id}","starred_url":"https://api.github.com/users/KamalakerDadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamalakerDadi/subscriptions","organizations_url":"https://api.github.com/users/KamalakerDadi/orgs","repos_url":"https://api.github.com/users/KamalakerDadi/repos","events_url":"https://api.github.com/users/KamalakerDadi/events{/privacy}","received_events_url":"https://api.github.com/users/KamalakerDadi/received_events","type":"User","site_admin":false},"body":"Please add the default here.","created_at":"2018-07-22T17:25:27Z","updated_at":"2018-07-22T17:51:06Z","html_url":"https://github.com/nilearn/nilearn/pull/1682#discussion_r204247715","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/1682","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/204247715"},"html":{"href":"https://github.com/nilearn/nilearn/pull/1682#discussion_r204247715"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/1682"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/1682","id":200637719,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNjM3NzE5","html_url":"https://github.com/nilearn/nilearn/pull/1682","diff_url":"https://github.com/nilearn/nilearn/pull/1682.diff","patch_url":"https://github.com/nilearn/nilearn/pull/1682.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/1682","number":1682,"state":"open","locked":false,"title":"ENH: MNI canonical mask in NiftiMasker","user":{"login":"SylvainLan","id":23078199,"node_id":"MDQ6VXNlcjIzMDc4MTk5","avatar_url":"https://avatars3.githubusercontent.com/u/23078199?v=4","gravatar_id":"","url":"https://api.github.com/users/SylvainLan","html_url":"https://github.com/SylvainLan","followers_url":"https://api.github.com/users/SylvainLan/followers","following_url":"https://api.github.com/users/SylvainLan/following{/other_user}","gists_url":"https://api.github.com/users/SylvainLan/gists{/gist_id}","starred_url":"https://api.github.com/users/SylvainLan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SylvainLan/subscriptions","organizations_url":"https://api.github.com/users/SylvainLan/orgs","repos_url":"https://api.github.com/users/SylvainLan/repos","events_url":"https://api.github.com/users/SylvainLan/events{/privacy}","received_events_url":"https://api.github.com/users/SylvainLan/received_events","type":"User","site_admin":false},"body":"This PR is done to solve #1549 \r\n\r\nI chose to use resample_to_img and not compute_mean as it's done for the other masking strategies for there will always be one single template image resampled to the target_img.\r\nFor the same reason I did not see the interest to keep the cache, but I may be wrong\r\n\r\nAbout the interpolation I chose nearest to be the default mode but linear might be a good option too. continuous does not appear to be a good strategy however and may need a proper Warning\r\n\r\nI copied the connected and opening arguments from the other strategies","created_at":"2018-07-11T09:25:07Z","updated_at":"2018-07-22T17:51:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33c4da45fb853852f9f4ac3cd0191626728a28bc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/1682/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/1682/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/1682/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/3057488ead7b95330c7532f2214ff0d46e8302aa","head":{"label":"SylvainLan:i1549","ref":"i1549","sha":"3057488ead7b95330c7532f2214ff0d46e8302aa","user":{"login":"SylvainLan","id":23078199,"node_id":"MDQ6VXNlcjIzMDc4MTk5","avatar_url":"https://avatars3.githubusercontent.com/u/23078199?v=4","gravatar_id":"","url":"https://api.github.com/users/SylvainLan","html_url":"https://github.com/SylvainLan","followers_url":"https://api.github.com/users/SylvainLan/followers","following_url":"https://api.github.com/users/SylvainLan/following{/other_user}","gists_url":"https://api.github.com/users/SylvainLan/gists{/gist_id}","starred_url":"https://api.github.com/users/SylvainLan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SylvainLan/subscriptions","organizations_url":"https://api.github.com/users/SylvainLan/orgs","repos_url":"https://api.github.com/users/SylvainLan/repos","events_url":"https://api.github.com/users/SylvainLan/events{/privacy}","received_events_url":"https://api.github.com/users/SylvainLan/received_events","type":"User","site_admin":false},"repo":{"id":87074042,"node_id":"MDEwOlJlcG9zaXRvcnk4NzA3NDA0Mg==","name":"nilearn","full_name":"SylvainLan/nilearn","owner":{"login":"SylvainLan","id":23078199,"node_id":"MDQ6VXNlcjIzMDc4MTk5","avatar_url":"https://avatars3.githubusercontent.com/u/23078199?v=4","gravatar_id":"","url":"https://api.github.com/users/SylvainLan","html_url":"https://github.com/SylvainLan","followers_url":"https://api.github.com/users/SylvainLan/followers","following_url":"https://api.github.com/users/SylvainLan/following{/other_user}","gists_url":"https://api.github.com/users/SylvainLan/gists{/gist_id}","starred_url":"https://api.github.com/users/SylvainLan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SylvainLan/subscriptions","organizations_url":"https://api.github.com/users/SylvainLan/orgs","repos_url":"https://api.github.com/users/SylvainLan/repos","events_url":"https://api.github.com/users/SylvainLan/events{/privacy}","received_events_url":"https://api.github.com/users/SylvainLan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SylvainLan/nilearn","description":"Machine learning for NeuroImaging in Python","fork":true,"url":"https://api.github.com/repos/SylvainLan/nilearn","forks_url":"https://api.github.com/repos/SylvainLan/nilearn/forks","keys_url":"https://api.github.com/repos/SylvainLan/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SylvainLan/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SylvainLan/nilearn/teams","hooks_url":"https://api.github.com/repos/SylvainLan/nilearn/hooks","issue_events_url":"https://api.github.com/repos/SylvainLan/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/SylvainLan/nilearn/events","assignees_url":"https://api.github.com/repos/SylvainLan/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/SylvainLan/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/SylvainLan/nilearn/tags","blobs_url":"https://api.github.com/repos/SylvainLan/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SylvainLan/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SylvainLan/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/SylvainLan/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SylvainLan/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/SylvainLan/nilearn/languages","stargazers_url":"https://api.github.com/repos/SylvainLan/nilearn/stargazers","contributors_url":"https://api.github.com/repos/SylvainLan/nilearn/contributors","subscribers_url":"https://api.github.com/repos/SylvainLan/nilearn/subscribers","subscription_url":"https://api.github.com/repos/SylvainLan/nilearn/subscription","commits_url":"https://api.github.com/repos/SylvainLan/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/SylvainLan/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/SylvainLan/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/SylvainLan/nilearn/issues/comments{/number}","contents_url":"https://api.github.com/repos/SylvainLan/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/SylvainLan/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SylvainLan/nilearn/merges","archive_url":"https://api.github.com/repos/SylvainLan/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SylvainLan/nilearn/downloads","issues_url":"https://api.github.com/repos/SylvainLan/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/SylvainLan/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/SylvainLan/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/SylvainLan/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SylvainLan/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/SylvainLan/nilearn/releases{/id}","deployments_url":"https://api.github.com/repos/SylvainLan/nilearn/deployments","created_at":"2017-04-03T12:56:10Z","updated_at":"2018-07-19T09:17:58Z","pushed_at":"2018-07-20T09:19:43Z","git_url":"git://github.com/SylvainLan/nilearn.git","ssh_url":"git@github.com:SylvainLan/nilearn.git","clone_url":"https://github.com/SylvainLan/nilearn.git","svn_url":"https://github.com/SylvainLan/nilearn","homepage":"http://nilearn.github.io","size":11889,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nilearn:master","ref":"master","sha":"a38485cf0a60445ecb0111c5b3d6acdd0d6943b0","user":{"login":"nilearn","id":4646912,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2NDY5MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/4646912?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnkxMjM1NzQw","name":"nilearn","full_name":"nilearn/nilearn","owner":{"login":"nilearn","id":4646912,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2NDY5MTI=","avatar_url":"https://avatars3.githubusercontent.com/u/4646912?v=4","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}","deployments_url":"https://api.github.com/repos/nilearn/nilearn/deployments","created_at":"2011-01-09T19:02:23Z","updated_at":"2018-07-19T17:32:44Z","pushed_at":"2018-07-20T09:19:45Z","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":11847,"stargazers_count":421,"watchers_count":421,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":273,"mirror_url":null,"archived":false,"open_issues_count":262,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":273,"open_issues":262,"watchers":421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/1682"},"html":{"href":"https://github.com/nilearn/nilearn/pull/1682"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/1682"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/1682/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/1682/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/1682/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/3057488ead7b95330c7532f2214ff0d46e8302aa"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"KamalakerDadi"}}