GitHub PullRequestReviewCommentEvent at 2014-07-01 08:22:10
Repository: nilearn
Actor: AlexandreAbraham
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/14393111","id":14393111,"diff_hunk":"@@ -0,0 +1,233 @@\n+\"\"\"\n+Tools to find activations and cut on maps\n+\"\"\"\n+\n+# Author: Gael Varoquaux\n+# License: BSD\n+\n+import numpy as np\n+from scipy import ndimage\n+\n+import nibabel\n+\n+# Local imports\n+from .._utils.ndimage import largest_connected_component\n+from .._utils.fast_maths import fast_abs_percentile\n+from .._utils.numpy_conversions import as_ndarray\n+from ..image.resampling import get_mask_bounds, coord_transform\n+\n+################################################################################\n+# Functions for automatic choice of cuts coordinates\n+################################################################################\n+\n+\n+def find_xyz_cut_coords(map, mask=None, activation_threshold=None):\n+    \"\"\" Find the center of the largest activation connect component.\n+\n+        Parameters\n+        -----------\n+        map : 3D ndarray\n+            The activation map, as a 3D numpy array.\n+        mask : 3D ndarray, boolean, optional\n+            An optional brain mask.\n+        activation_threshold : float, optional\n+            The lower threshold to the positive activation. If None, the\n+            activation threshold is computed using find_activation.\n+\n+        Returns\n+        -------\n+        x: float\n+            the x coordinate in voxels.\n+        y: float\n+            the y coordinate in voxels.\n+        z: float\n+            the z coordinate in voxels.\n+    \"\"\"\n+    # To speed up computations, we work with partial views of the array,\n+    # and keep track of the offset","path":"nilearn/plotting/find_cuts.py","position":47,"original_position":47,"commit_id":"92937bd2ed0b96931acb95c6743c4bc5ba77b5ae","original_commit_id":"92937bd2ed0b96931acb95c6743c4bc5ba77b5ae","user":{"login":"AlexandreAbraham","id":1647301,"avatar_url":"https://avatars.githubusercontent.com/u/1647301?","gravatar_id":"2a8f3943c0be829d52e15fa24f13da0e","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":"Is it really necessary for a single image? I have the impression that we have some complicated code here to win a bunch of milliseconds.","created_at":"2014-07-01T08:22:10Z","updated_at":"2014-07-01T08:22:10Z","html_url":"https://github.com/nilearn/nilearn/pull/221#discussion_r14393111","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/221","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/14393111"},"html":{"href":"https://github.com/nilearn/nilearn/pull/221#discussion_r14393111"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/221"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/221","id":17788683,"html_url":"https://github.com/nilearn/nilearn/pull/221","diff_url":"https://github.com/nilearn/nilearn/pull/221.diff","patch_url":"https://github.com/nilearn/nilearn/pull/221.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/221","number":221,"state":"open","title":"Visualization code for nilearn","user":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?","gravatar_id":"5c9fb379c4e97b58960d74dcbfc5dee5","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"body":"Refresher of the visualization code.\r\n\r\nThis is not completely finished, but reviews and comments are most welcomed.","created_at":"2014-06-30T18:16:28Z","updated_at":"2014-07-01T08:22:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/221/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/221/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/{number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/221/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/92937bd2ed0b96931acb95c6743c4bc5ba77b5ae","head":{"label":"GaelVaroquaux:viz","ref":"viz","sha":"92937bd2ed0b96931acb95c6743c4bc5ba77b5ae","user":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?","gravatar_id":"5c9fb379c4e97b58960d74dcbfc5dee5","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"repo":{"id":2084934,"name":"nilearn","full_name":"GaelVaroquaux/nilearn","owner":{"login":"GaelVaroquaux","id":208217,"avatar_url":"https://avatars.githubusercontent.com/u/208217?","gravatar_id":"5c9fb379c4e97b58960d74dcbfc5dee5","url":"https://api.github.com/users/GaelVaroquaux","html_url":"https://github.com/GaelVaroquaux","followers_url":"https://api.github.com/users/GaelVaroquaux/followers","following_url":"https://api.github.com/users/GaelVaroquaux/following{/other_user}","gists_url":"https://api.github.com/users/GaelVaroquaux/gists{/gist_id}","starred_url":"https://api.github.com/users/GaelVaroquaux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GaelVaroquaux/subscriptions","organizations_url":"https://api.github.com/users/GaelVaroquaux/orgs","repos_url":"https://api.github.com/users/GaelVaroquaux/repos","events_url":"https://api.github.com/users/GaelVaroquaux/events{/privacy}","received_events_url":"https://api.github.com/users/GaelVaroquaux/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GaelVaroquaux/nilearn","description":"NeuroImaging with the Scikit-learn: fMRI inverse inference tutorial","fork":true,"url":"https://api.github.com/repos/GaelVaroquaux/nilearn","forks_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/forks","keys_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/teams","hooks_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/hooks","issue_events_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/issues/events{/number}","events_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/events","assignees_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/assignees{/user}","branches_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/branches{/branch}","tags_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/tags","blobs_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/git/refs{/sha}","trees_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/statuses/{sha}","languages_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/languages","stargazers_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/stargazers","contributors_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/contributors","subscribers_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/subscribers","subscription_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/subscription","commits_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/commits{/sha}","git_commits_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/git/commits{/sha}","comments_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/comments{/number}","issue_comment_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/issues/comments/{number}","contents_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/contents/{+path}","compare_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/merges","archive_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/downloads","issues_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/issues{/number}","pulls_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/pulls{/number}","milestones_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/milestones{/number}","notifications_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/labels{/name}","releases_url":"https://api.github.com/repos/GaelVaroquaux/nilearn/releases{/id}","created_at":"2011-07-21T18:19:33Z","updated_at":"2014-06-18T21:36:08Z","pushed_at":"2014-06-18T21:36:12Z","git_url":"git://github.com/GaelVaroquaux/nilearn.git","ssh_url":"git@github.com:GaelVaroquaux/nilearn.git","clone_url":"https://github.com/GaelVaroquaux/nilearn.git","svn_url":"https://github.com/GaelVaroquaux/nilearn","homepage":"http://nisl.github.com/","size":6055,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"nilearn:master","ref":"master","sha":"6e150c0b546139237c7a8094093f7d07dadadb9c","user":{"login":"nilearn","id":4646912,"avatar_url":"https://avatars.githubusercontent.com/u/4646912?","gravatar_id":"8b35c948467638a5527d0bad1de7880e","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?","gravatar_id":"8b35c948467638a5527d0bad1de7880e","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":"2014-06-23T09:01:53Z","pushed_at":"2014-06-23T09:01:50Z","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":7979,"stargazers_count":54,"watchers_count":54,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":40,"mirror_url":null,"open_issues_count":41,"forks":40,"open_issues":41,"watchers":54,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/221"},"html":{"href":"https://github.com/nilearn/nilearn/pull/221"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/221"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/221/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/221/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/221/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/92937bd2ed0b96931acb95c6743c4bc5ba77b5ae"}}}}