{"action":"created","comment":{"url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/comments/46087988","id":46087988,"diff_hunk":"@@ -0,0 +1,46 @@\n+from __future__ import print_function\n+from __future__ import division\n+import json\n+import nibabel as nib\n+import numpy as np\n+import sys\n+from os.path import exists\n+\n+DATA_PATHS = json.load(open('../../data/data_path.json'))\n+\n+CONCATENATE_RUNS_ARG_ERROR_MESSAGE = 'Invalid argument: alignment in concatenate_runs'\n+PREPROCESS_ARG_ERROR_MESSAGE = 'preprocess.py must be provided with alignment argument'\n+\n+\n+def concatenate_runs(alignment='linear'):\n+    if alignment == 'linear':\n+        pass\n+    elif alignment == 'non_linear':\n+        pass\n+    elif alignment == 'rcds':\n+        for i, subject in enumerate(DATA_PATHS['subjects']):\n+            nii_file_name = 'sub{0}_{1}'.format(i + 1, alignment)\n+            if not exists(nii_file_name):\n+                run_data = []\n+                for j, run in enumerate(subject['runs']):\n+                    task_path = run['rcds']['path']\n+                    img = nib.load('../../' + task_path)\n+                    data = img.get_data()\n+                    if j == 0:\n+                        run_data.append(data[..., :-4])\n+                    elif j >= 1 and j <= 6:\n+                        run_data.append(data[..., 4:-4])\n+                    else:\n+                        run_data.append(data[..., 4:])\n+                concatenated_run_data = np.concatenate(run_data, axis=3)\n+                concatenated_img = nib.Nifti1Image(concatenated_run_data,\n+                                                   np.eye(4))","path":"code/reproduction/preprocess.py","position":37,"original_position":37,"commit_id":"146cb07fe647b898cb62e472cf9d4360b4924446","original_commit_id":"146cb07fe647b898cb62e472cf9d4360b4924446","user":{"login":"lisaannyu","id":14011627,"avatar_url":"https://avatars.githubusercontent.com/u/14011627?v=3","gravatar_id":"","url":"https://api.github.com/users/lisaannyu","html_url":"https://github.com/lisaannyu","followers_url":"https://api.github.com/users/lisaannyu/followers","following_url":"https://api.github.com/users/lisaannyu/following{/other_user}","gists_url":"https://api.github.com/users/lisaannyu/gists{/gist_id}","starred_url":"https://api.github.com/users/lisaannyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lisaannyu/subscriptions","organizations_url":"https://api.github.com/users/lisaannyu/orgs","repos_url":"https://api.github.com/users/lisaannyu/repos","events_url":"https://api.github.com/users/lisaannyu/events{/privacy}","received_events_url":"https://api.github.com/users/lisaannyu/received_events","type":"User","site_admin":false},"body":"maybe this is a good place to apply the gaussian filter\r\nsee \"More Notes\" under Lectures\r\n\r\nfrom scipy.ndimage import gaussian_filter\r\n# Smooth by 2 voxel SD in all three spatial dimensions\r\nsmooth_data = gaussian_filter(data, [2, 2, 2, 0])","created_at":"2015-11-29T05:49:34Z","updated_at":"2015-11-29T05:49:34Z","html_url":"https://github.com/berkeley-stat159/project-lambda/pull/31#discussion_r46087988","pull_request_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/comments/46087988"},"html":{"href":"https://github.com/berkeley-stat159/project-lambda/pull/31#discussion_r46087988"},"pull_request":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31","id":51628647,"html_url":"https://github.com/berkeley-stat159/project-lambda/pull/31","diff_url":"https://github.com/berkeley-stat159/project-lambda/pull/31.diff","patch_url":"https://github.com/berkeley-stat159/project-lambda/pull/31.patch","issue_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/31","number":31,"state":"open","locked":false,"title":"Wrote preprocessing script for reproduction of paper analysis","user":{"login":"AlonDaks","id":1865239,"avatar_url":"https://avatars.githubusercontent.com/u/1865239?v=3","gravatar_id":"","url":"https://api.github.com/users/AlonDaks","html_url":"https://github.com/AlonDaks","followers_url":"https://api.github.com/users/AlonDaks/followers","following_url":"https://api.github.com/users/AlonDaks/following{/other_user}","gists_url":"https://api.github.com/users/AlonDaks/gists{/gist_id}","starred_url":"https://api.github.com/users/AlonDaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlonDaks/subscriptions","organizations_url":"https://api.github.com/users/AlonDaks/orgs","repos_url":"https://api.github.com/users/AlonDaks/repos","events_url":"https://api.github.com/users/AlonDaks/events{/privacy}","received_events_url":"https://api.github.com/users/AlonDaks/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-24T08:17:46Z","updated_at":"2015-11-29T05:49:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78b559418c5a2911dcb803a794c9775ddc30e510","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31/commits","review_comments_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31/comments","review_comment_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/31/comments","statuses_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/statuses/146cb07fe647b898cb62e472cf9d4360b4924446","head":{"label":"AlonDaks:alon-dev","ref":"alon-dev","sha":"146cb07fe647b898cb62e472cf9d4360b4924446","user":{"login":"AlonDaks","id":1865239,"avatar_url":"https://avatars.githubusercontent.com/u/1865239?v=3","gravatar_id":"","url":"https://api.github.com/users/AlonDaks","html_url":"https://github.com/AlonDaks","followers_url":"https://api.github.com/users/AlonDaks/followers","following_url":"https://api.github.com/users/AlonDaks/following{/other_user}","gists_url":"https://api.github.com/users/AlonDaks/gists{/gist_id}","starred_url":"https://api.github.com/users/AlonDaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlonDaks/subscriptions","organizations_url":"https://api.github.com/users/AlonDaks/orgs","repos_url":"https://api.github.com/users/AlonDaks/repos","events_url":"https://api.github.com/users/AlonDaks/events{/privacy}","received_events_url":"https://api.github.com/users/AlonDaks/received_events","type":"User","site_admin":false},"repo":{"id":45058129,"name":"project-lambda","full_name":"AlonDaks/project-lambda","owner":{"login":"AlonDaks","id":1865239,"avatar_url":"https://avatars.githubusercontent.com/u/1865239?v=3","gravatar_id":"","url":"https://api.github.com/users/AlonDaks","html_url":"https://github.com/AlonDaks","followers_url":"https://api.github.com/users/AlonDaks/followers","following_url":"https://api.github.com/users/AlonDaks/following{/other_user}","gists_url":"https://api.github.com/users/AlonDaks/gists{/gist_id}","starred_url":"https://api.github.com/users/AlonDaks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlonDaks/subscriptions","organizations_url":"https://api.github.com/users/AlonDaks/orgs","repos_url":"https://api.github.com/users/AlonDaks/repos","events_url":"https://api.github.com/users/AlonDaks/events{/privacy}","received_events_url":"https://api.github.com/users/AlonDaks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlonDaks/project-lambda","description":"","fork":true,"url":"https://api.github.com/repos/AlonDaks/project-lambda","forks_url":"https://api.github.com/repos/AlonDaks/project-lambda/forks","keys_url":"https://api.github.com/repos/AlonDaks/project-lambda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlonDaks/project-lambda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlonDaks/project-lambda/teams","hooks_url":"https://api.github.com/repos/AlonDaks/project-lambda/hooks","issue_events_url":"https://api.github.com/repos/AlonDaks/project-lambda/issues/events{/number}","events_url":"https://api.github.com/repos/AlonDaks/project-lambda/events","assignees_url":"https://api.github.com/repos/AlonDaks/project-lambda/assignees{/user}","branches_url":"https://api.github.com/repos/AlonDaks/project-lambda/branches{/branch}","tags_url":"https://api.github.com/repos/AlonDaks/project-lambda/tags","blobs_url":"https://api.github.com/repos/AlonDaks/project-lambda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlonDaks/project-lambda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlonDaks/project-lambda/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlonDaks/project-lambda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlonDaks/project-lambda/statuses/{sha}","languages_url":"https://api.github.com/repos/AlonDaks/project-lambda/languages","stargazers_url":"https://api.github.com/repos/AlonDaks/project-lambda/stargazers","contributors_url":"https://api.github.com/repos/AlonDaks/project-lambda/contributors","subscribers_url":"https://api.github.com/repos/AlonDaks/project-lambda/subscribers","subscription_url":"https://api.github.com/repos/AlonDaks/project-lambda/subscription","commits_url":"https://api.github.com/repos/AlonDaks/project-lambda/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlonDaks/project-lambda/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlonDaks/project-lambda/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlonDaks/project-lambda/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlonDaks/project-lambda/contents/{+path}","compare_url":"https://api.github.com/repos/AlonDaks/project-lambda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlonDaks/project-lambda/merges","archive_url":"https://api.github.com/repos/AlonDaks/project-lambda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlonDaks/project-lambda/downloads","issues_url":"https://api.github.com/repos/AlonDaks/project-lambda/issues{/number}","pulls_url":"https://api.github.com/repos/AlonDaks/project-lambda/pulls{/number}","milestones_url":"https://api.github.com/repos/AlonDaks/project-lambda/milestones{/number}","notifications_url":"https://api.github.com/repos/AlonDaks/project-lambda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlonDaks/project-lambda/labels{/name}","releases_url":"https://api.github.com/repos/AlonDaks/project-lambda/releases{/id}","created_at":"2015-10-27T17:31:42Z","updated_at":"2015-10-27T17:31:43Z","pushed_at":"2015-11-24T08:16:13Z","git_url":"git://github.com/AlonDaks/project-lambda.git","ssh_url":"git@github.com:AlonDaks/project-lambda.git","clone_url":"https://github.com/AlonDaks/project-lambda.git","svn_url":"https://github.com/AlonDaks/project-lambda","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"TeX","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":"berkeley-stat159:master","ref":"master","sha":"ae27c19a73974b194eb9130b72fad0ef26f17ac9","user":{"login":"berkeley-stat159","id":11684434,"avatar_url":"https://avatars.githubusercontent.com/u/11684434?v=3","gravatar_id":"","url":"https://api.github.com/users/berkeley-stat159","html_url":"https://github.com/berkeley-stat159","followers_url":"https://api.github.com/users/berkeley-stat159/followers","following_url":"https://api.github.com/users/berkeley-stat159/following{/other_user}","gists_url":"https://api.github.com/users/berkeley-stat159/gists{/gist_id}","starred_url":"https://api.github.com/users/berkeley-stat159/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkeley-stat159/subscriptions","organizations_url":"https://api.github.com/users/berkeley-stat159/orgs","repos_url":"https://api.github.com/users/berkeley-stat159/repos","events_url":"https://api.github.com/users/berkeley-stat159/events{/privacy}","received_events_url":"https://api.github.com/users/berkeley-stat159/received_events","type":"Organization","site_admin":false},"repo":{"id":43347781,"name":"project-lambda","full_name":"berkeley-stat159/project-lambda","owner":{"login":"berkeley-stat159","id":11684434,"avatar_url":"https://avatars.githubusercontent.com/u/11684434?v=3","gravatar_id":"","url":"https://api.github.com/users/berkeley-stat159","html_url":"https://github.com/berkeley-stat159","followers_url":"https://api.github.com/users/berkeley-stat159/followers","following_url":"https://api.github.com/users/berkeley-stat159/following{/other_user}","gists_url":"https://api.github.com/users/berkeley-stat159/gists{/gist_id}","starred_url":"https://api.github.com/users/berkeley-stat159/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berkeley-stat159/subscriptions","organizations_url":"https://api.github.com/users/berkeley-stat159/orgs","repos_url":"https://api.github.com/users/berkeley-stat159/repos","events_url":"https://api.github.com/users/berkeley-stat159/events{/privacy}","received_events_url":"https://api.github.com/users/berkeley-stat159/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/berkeley-stat159/project-lambda","description":"","fork":false,"url":"https://api.github.com/repos/berkeley-stat159/project-lambda","forks_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/forks","keys_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/teams","hooks_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/hooks","issue_events_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/events{/number}","events_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/events","assignees_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/assignees{/user}","branches_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/branches{/branch}","tags_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/tags","blobs_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/git/refs{/sha}","trees_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/statuses/{sha}","languages_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/languages","stargazers_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/stargazers","contributors_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/contributors","subscribers_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/subscribers","subscription_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/subscription","commits_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/commits{/sha}","git_commits_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/git/commits{/sha}","comments_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/comments{/number}","issue_comment_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/comments{/number}","contents_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/contents/{+path}","compare_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/merges","archive_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/downloads","issues_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues{/number}","pulls_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls{/number}","milestones_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/milestones{/number}","notifications_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/labels{/name}","releases_url":"https://api.github.com/repos/berkeley-stat159/project-lambda/releases{/id}","created_at":"2015-09-29T05:51:47Z","updated_at":"2015-11-19T18:48:15Z","pushed_at":"2015-11-28T04:42:39Z","git_url":"git://github.com/berkeley-stat159/project-lambda.git","ssh_url":"git@github.com:berkeley-stat159/project-lambda.git","clone_url":"https://github.com/berkeley-stat159/project-lambda.git","svn_url":"https://github.com/berkeley-stat159/project-lambda","homepage":null,"size":563,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31"},"html":{"href":"https://github.com/berkeley-stat159/project-lambda/pull/31"},"issue":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/31"},"comments":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/berkeley-stat159/project-lambda/statuses/146cb07fe647b898cb62e472cf9d4360b4924446"}}}}