{"action":"created","comment":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/26803267","id":26803267,"diff_hunk":"@@ -237,66 +286,45 @@ def check_niimgs(niimgs, accept_3d=False, return_iterator=False):\n \n     Notes\n     -----\n-    This function is the equivalent to check_niimg() for Niimg-like objects\n+    This function is the equivalent to check_niimg_3d() for Niimg-like objects\n     with a session level.\n \n     Its application is idempotent.\n     \"\"\"\n-    # Initialization:\n-    # If given data is a list, we count the number of levels to check\n-    # dimensionality and make a consistent error message.\n-    depth = 0\n-    first_img = niimgs\n-    if accept_3d and (isinstance(first_img, string_types)\n-                      or not isinstance(first_img, collections.Iterable)):\n-        niimg = check_niimg(niimgs)\n-        if len(niimg.shape) == 3:\n-            niimg = new_img_like(niimg, niimg.get_data()[..., np.newaxis],\n-                            niimg.get_affine())\n-        return niimg\n+    # Two types of input:\n+    # * 4D nifti image\n+    # * list of 3D niimgs\n \n+    # We get rid of the 4D nifti image case, as it is the simplest case\n     # Use hasattr() instead of isinstance to workaround a Python 2.6/2.7 bug\n     # See http://bugs.python.org/issue7624\n-    while hasattr(first_img, \"__iter__\") \\\n-            and not isinstance(first_img, string_types):\n-        if hasattr(first_img, '__len__') and len(first_img) == 0:\n-            raise TypeError('An empty object - %r - was passed instead of an '\n-                            'image or a list of images' % niimgs)\n-        first_img = next(iter(first_img))\n-        depth += 1","path":"nilearn/_utils/niimg_conversions.py","position":285,"original_position":285,"commit_id":"24f3aba8d0ac3dbe9a34d0dfdfde0019c40fd92c","original_commit_id":"06fca49c57d7302773474d60cb0dd707bb860910","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":":rage2: I will be back","created_at":"2015-03-19T22:14:08Z","updated_at":"2015-03-19T22:14:08Z","html_url":"https://github.com/nilearn/nilearn/pull/505#discussion_r26803267","pull_request_url":"https://api.github.com/repos/nilearn/nilearn/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments/26803267"},"html":{"href":"https://github.com/nilearn/nilearn/pull/505#discussion_r26803267"},"pull_request":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/nilearn/nilearn/pulls/505","id":31438854,"html_url":"https://github.com/nilearn/nilearn/pull/505","diff_url":"https://github.com/nilearn/nilearn/pull/505.diff","patch_url":"https://github.com/nilearn/nilearn/pull/505.patch","issue_url":"https://api.github.com/repos/nilearn/nilearn/issues/505","number":505,"state":"open","locked":false,"title":"Refactor check niimg ","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":"This PR restore the original behavior of check_niimg and check_niimgs:\r\n* check_niimg loads 3D niimages\r\n* check_niimgs loads 4D niimages\r\n\r\nThis is a first step toward cleaner file loading in nilearn.","created_at":"2015-03-18T15:19:31Z","updated_at":"2015-03-19T22:14:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae72a5b945346ba4d321685ea0f582332d008dbd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nilearn/nilearn/pulls/505/commits","review_comments_url":"https://api.github.com/repos/nilearn/nilearn/pulls/505/comments","review_comment_url":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nilearn/nilearn/issues/505/comments","statuses_url":"https://api.github.com/repos/nilearn/nilearn/statuses/24f3aba8d0ac3dbe9a34d0dfdfde0019c40fd92c","head":{"label":"AlexandreAbraham:refactor_check_niimg_","ref":"refactor_check_niimg_","sha":"24f3aba8d0ac3dbe9a34d0dfdfde0019c40fd92c","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-03-18T15:01:13Z","pushed_at":"2015-03-19T13:49:11Z","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":7326,"stargazers_count":4,"watchers_count":4,"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":4,"default_branch":"master"}},"base":{"label":"nilearn:master","ref":"master","sha":"10b583bbd2e2d26900a0d75540312726c29bb833","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-03-19T17:20:32Z","pushed_at":"2015-03-19T17:20:32Z","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":12473,"stargazers_count":74,"watchers_count":74,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":75,"forks":57,"open_issues":75,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/505"},"html":{"href":"https://github.com/nilearn/nilearn/pull/505"},"issue":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/505"},"comments":{"href":"https://api.github.com/repos/nilearn/nilearn/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nilearn/nilearn/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/nilearn/nilearn/statuses/24f3aba8d0ac3dbe9a34d0dfdfde0019c40fd92c"}}}}