{"action":"created","comment":{"url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/comments/143649900","pull_request_review_id":68189145,"id":143649900,"diff_hunk":"@@ -36,20 +38,45 @@ def predict(dicom_path, centroids):\n         dict: Dictionary containing path to serialized binary masks and\n             volumes per centroid with form::\n             {'binary_mask_path': str,\n-             'volumes': list[float]}\n+             'volumes': list[float]\n+             'diameters': list[float]}\n     \"\"\"\n-    load_ct(dicom_path)\n-    segment_path = os.path.join(os.path.dirname(__file__),\n-                                'assets', 'test_mask.npy')\n-    volumes = calculate_volume(segment_path, centroids)\n+\n+    reader = sitk.ImageSeriesReader()\n+    reader.SetFileNames(reader.GetGDCMSeriesFileNames(dicom_path))\n+    image = reader.Execute()\n+\n+    binary_mask = np.zeros_like(sitk.GetArrayFromImage(image), dtype=bool)\n+\n+    volumes = []\n+    diameters = []\n+    for nodule in centroids:\n+        mask, diameter, volume = levelset_segment.segment_nodule(image, nodule)\n+        volumes.append(volume)\n+        diameters.append(diameter)\n+        binary_mask |= sitk.GetArrayFromImage(mask).astype(bool)\n+\n+    segment_path = tempfile.NamedTemporaryFile(suffix='.npy')\n+    _FILES.append(segment_path)","path":"prediction/src/algorithms/segment/trained_model.py","position":null,"original_position":46,"commit_id":"29ffd7d949d44dc73304e07888a043c589ec588c","original_commit_id":"cf295ced5aa586c4ff421a15d60666ab187c04fa","user":{"login":"dchansen","id":5627428,"avatar_url":"https://avatars0.githubusercontent.com/u/5627428?v=4","gravatar_id":"","url":"https://api.github.com/users/dchansen","html_url":"https://github.com/dchansen","followers_url":"https://api.github.com/users/dchansen/followers","following_url":"https://api.github.com/users/dchansen/following{/other_user}","gists_url":"https://api.github.com/users/dchansen/gists{/gist_id}","starred_url":"https://api.github.com/users/dchansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchansen/subscriptions","organizations_url":"https://api.github.com/users/dchansen/orgs","repos_url":"https://api.github.com/users/dchansen/repos","events_url":"https://api.github.com/users/dchansen/events{/privacy}","received_events_url":"https://api.github.com/users/dchansen/received_events","type":"User","site_admin":false},"body":"Ok. Moved the functionality into utils. I think this is a reasonable solution?","created_at":"2017-10-10T07:42:33Z","updated_at":"2017-10-10T07:42:33Z","html_url":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142#discussion_r143649900","pull_request_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/comments/143649900"},"html":{"href":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142#discussion_r143649900"},"pull_request":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142"}},"in_reply_to_id":143128445},"pull_request":{"url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142","id":143892834,"html_url":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142","diff_url":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142.diff","patch_url":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142.patch","issue_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/142","number":142,"state":"open","locked":false,"title":"Implemented simple nodule segmentation algorithm","user":{"login":"dchansen","id":5627428,"avatar_url":"https://avatars0.githubusercontent.com/u/5627428?v=4","gravatar_id":"","url":"https://api.github.com/users/dchansen","html_url":"https://github.com/dchansen","followers_url":"https://api.github.com/users/dchansen/followers","following_url":"https://api.github.com/users/dchansen/following{/other_user}","gists_url":"https://api.github.com/users/dchansen/gists{/gist_id}","starred_url":"https://api.github.com/users/dchansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchansen/subscriptions","organizations_url":"https://api.github.com/users/dchansen/orgs","repos_url":"https://api.github.com/users/dchansen/repos","events_url":"https://api.github.com/users/dchansen/events{/privacy}","received_events_url":"https://api.github.com/users/dchansen/received_events","type":"User","site_admin":false},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\nThis pull request implements a simple level-set based segmentation algorithm for nodule segmentation.\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\nThis implements a simple segmentation algorithm based on SITK, and returns binary mask, diameter and volume.\r\n\r\n## Reference to official issue\r\n<!--- If fixing a bug, there should be an existing issue describing it with steps to reproduce -->\r\n<!--- Please link to the issue here: -->\r\n#3 \r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If adding a new feature or making improvements not already reflected in an official issue, please reference the relevant sections of the design doc -->\r\nPart of minimal viable product.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\nThe segmentation has been tested manually on a few LIDC images. A better approach would be a test based on pylidc and report dice values.\r\n\r\n## Screenshots (if appropriate):\r\n![Nodule Segmentation](https://i.imgur.com/QBwqU2D.png)\r\n\r\n## CLA\r\n- [x] I have signed the CLA; if other committers are in the commit history, they have signed the CLA as well","created_at":"2017-09-29T13:47:46Z","updated_at":"2017-10-10T07:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd031a6ecf79a7f01abe82113201ac581aac356d","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142/commits","review_comments_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142/comments","review_comment_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/142/comments","statuses_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/statuses/29ffd7d949d44dc73304e07888a043c589ec588c","head":{"label":"dchansen:nodule_segmentation","ref":"nodule_segmentation","sha":"29ffd7d949d44dc73304e07888a043c589ec588c","user":{"login":"dchansen","id":5627428,"avatar_url":"https://avatars0.githubusercontent.com/u/5627428?v=4","gravatar_id":"","url":"https://api.github.com/users/dchansen","html_url":"https://github.com/dchansen","followers_url":"https://api.github.com/users/dchansen/followers","following_url":"https://api.github.com/users/dchansen/following{/other_user}","gists_url":"https://api.github.com/users/dchansen/gists{/gist_id}","starred_url":"https://api.github.com/users/dchansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchansen/subscriptions","organizations_url":"https://api.github.com/users/dchansen/orgs","repos_url":"https://api.github.com/users/dchansen/repos","events_url":"https://api.github.com/users/dchansen/events{/privacy}","received_events_url":"https://api.github.com/users/dchansen/received_events","type":"User","site_admin":false},"repo":{"id":101176634,"name":"concept-to-clinic","full_name":"dchansen/concept-to-clinic","owner":{"login":"dchansen","id":5627428,"avatar_url":"https://avatars0.githubusercontent.com/u/5627428?v=4","gravatar_id":"","url":"https://api.github.com/users/dchansen","html_url":"https://github.com/dchansen","followers_url":"https://api.github.com/users/dchansen/followers","following_url":"https://api.github.com/users/dchansen/following{/other_user}","gists_url":"https://api.github.com/users/dchansen/gists{/gist_id}","starred_url":"https://api.github.com/users/dchansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchansen/subscriptions","organizations_url":"https://api.github.com/users/dchansen/orgs","repos_url":"https://api.github.com/users/dchansen/repos","events_url":"https://api.github.com/users/dchansen/events{/privacy}","received_events_url":"https://api.github.com/users/dchansen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dchansen/concept-to-clinic","description":"ALCF Concept to Clinic Challenge","fork":true,"url":"https://api.github.com/repos/dchansen/concept-to-clinic","forks_url":"https://api.github.com/repos/dchansen/concept-to-clinic/forks","keys_url":"https://api.github.com/repos/dchansen/concept-to-clinic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dchansen/concept-to-clinic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dchansen/concept-to-clinic/teams","hooks_url":"https://api.github.com/repos/dchansen/concept-to-clinic/hooks","issue_events_url":"https://api.github.com/repos/dchansen/concept-to-clinic/issues/events{/number}","events_url":"https://api.github.com/repos/dchansen/concept-to-clinic/events","assignees_url":"https://api.github.com/repos/dchansen/concept-to-clinic/assignees{/user}","branches_url":"https://api.github.com/repos/dchansen/concept-to-clinic/branches{/branch}","tags_url":"https://api.github.com/repos/dchansen/concept-to-clinic/tags","blobs_url":"https://api.github.com/repos/dchansen/concept-to-clinic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dchansen/concept-to-clinic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dchansen/concept-to-clinic/git/refs{/sha}","trees_url":"https://api.github.com/repos/dchansen/concept-to-clinic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dchansen/concept-to-clinic/statuses/{sha}","languages_url":"https://api.github.com/repos/dchansen/concept-to-clinic/languages","stargazers_url":"https://api.github.com/repos/dchansen/concept-to-clinic/stargazers","contributors_url":"https://api.github.com/repos/dchansen/concept-to-clinic/contributors","subscribers_url":"https://api.github.com/repos/dchansen/concept-to-clinic/subscribers","subscription_url":"https://api.github.com/repos/dchansen/concept-to-clinic/subscription","commits_url":"https://api.github.com/repos/dchansen/concept-to-clinic/commits{/sha}","git_commits_url":"https://api.github.com/repos/dchansen/concept-to-clinic/git/commits{/sha}","comments_url":"https://api.github.com/repos/dchansen/concept-to-clinic/comments{/number}","issue_comment_url":"https://api.github.com/repos/dchansen/concept-to-clinic/issues/comments{/number}","contents_url":"https://api.github.com/repos/dchansen/concept-to-clinic/contents/{+path}","compare_url":"https://api.github.com/repos/dchansen/concept-to-clinic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dchansen/concept-to-clinic/merges","archive_url":"https://api.github.com/repos/dchansen/concept-to-clinic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dchansen/concept-to-clinic/downloads","issues_url":"https://api.github.com/repos/dchansen/concept-to-clinic/issues{/number}","pulls_url":"https://api.github.com/repos/dchansen/concept-to-clinic/pulls{/number}","milestones_url":"https://api.github.com/repos/dchansen/concept-to-clinic/milestones{/number}","notifications_url":"https://api.github.com/repos/dchansen/concept-to-clinic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dchansen/concept-to-clinic/labels{/name}","releases_url":"https://api.github.com/repos/dchansen/concept-to-clinic/releases{/id}","deployments_url":"https://api.github.com/repos/dchansen/concept-to-clinic/deployments","created_at":"2017-08-23T12:18:21Z","updated_at":"2017-08-23T12:18:23Z","pushed_at":"2017-10-10T07:41:55Z","git_url":"git://github.com/dchansen/concept-to-clinic.git","ssh_url":"git@github.com:dchansen/concept-to-clinic.git","clone_url":"https://github.com/dchansen/concept-to-clinic.git","svn_url":"https://github.com/dchansen/concept-to-clinic","homepage":"https://concepttoclinic.drivendata.org/","size":136936,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"concept-to-clinic:master","ref":"master","sha":"29003464d42878d28c65294b8b3c7a00df022c82","user":{"login":"concept-to-clinic","id":29073492,"avatar_url":"https://avatars3.githubusercontent.com/u/29073492?v=4","gravatar_id":"","url":"https://api.github.com/users/concept-to-clinic","html_url":"https://github.com/concept-to-clinic","followers_url":"https://api.github.com/users/concept-to-clinic/followers","following_url":"https://api.github.com/users/concept-to-clinic/following{/other_user}","gists_url":"https://api.github.com/users/concept-to-clinic/gists{/gist_id}","starred_url":"https://api.github.com/users/concept-to-clinic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concept-to-clinic/subscriptions","organizations_url":"https://api.github.com/users/concept-to-clinic/orgs","repos_url":"https://api.github.com/users/concept-to-clinic/repos","events_url":"https://api.github.com/users/concept-to-clinic/events{/privacy}","received_events_url":"https://api.github.com/users/concept-to-clinic/received_events","type":"Organization","site_admin":false},"repo":{"id":98559363,"name":"concept-to-clinic","full_name":"concept-to-clinic/concept-to-clinic","owner":{"login":"concept-to-clinic","id":29073492,"avatar_url":"https://avatars3.githubusercontent.com/u/29073492?v=4","gravatar_id":"","url":"https://api.github.com/users/concept-to-clinic","html_url":"https://github.com/concept-to-clinic","followers_url":"https://api.github.com/users/concept-to-clinic/followers","following_url":"https://api.github.com/users/concept-to-clinic/following{/other_user}","gists_url":"https://api.github.com/users/concept-to-clinic/gists{/gist_id}","starred_url":"https://api.github.com/users/concept-to-clinic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/concept-to-clinic/subscriptions","organizations_url":"https://api.github.com/users/concept-to-clinic/orgs","repos_url":"https://api.github.com/users/concept-to-clinic/repos","events_url":"https://api.github.com/users/concept-to-clinic/events{/privacy}","received_events_url":"https://api.github.com/users/concept-to-clinic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/concept-to-clinic/concept-to-clinic","description":"ALCF Concept to Clinic Challenge","fork":false,"url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic","forks_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/forks","keys_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/teams","hooks_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/hooks","issue_events_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/events{/number}","events_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/events","assignees_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/assignees{/user}","branches_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/branches{/branch}","tags_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/tags","blobs_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/git/refs{/sha}","trees_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/statuses/{sha}","languages_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/languages","stargazers_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/stargazers","contributors_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/contributors","subscribers_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/subscribers","subscription_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/subscription","commits_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/commits{/sha}","git_commits_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/git/commits{/sha}","comments_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/comments{/number}","issue_comment_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/comments{/number}","contents_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/contents/{+path}","compare_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/merges","archive_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/downloads","issues_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues{/number}","pulls_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls{/number}","milestones_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/milestones{/number}","notifications_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/labels{/name}","releases_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/releases{/id}","deployments_url":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/deployments","created_at":"2017-07-27T16:37:37Z","updated_at":"2017-10-09T17:04:36Z","pushed_at":"2017-10-10T07:41:58Z","git_url":"git://github.com/concept-to-clinic/concept-to-clinic.git","ssh_url":"git@github.com:concept-to-clinic/concept-to-clinic.git","clone_url":"https://github.com/concept-to-clinic/concept-to-clinic.git","svn_url":"https://github.com/concept-to-clinic/concept-to-clinic","homepage":"https://concepttoclinic.drivendata.org/","size":136938,"stargazers_count":212,"watchers_count":212,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":92,"mirror_url":null,"open_issues_count":20,"forks":92,"open_issues":20,"watchers":212,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142"},"html":{"href":"https://github.com/concept-to-clinic/concept-to-clinic/pull/142"},"issue":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/142"},"comments":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/concept-to-clinic/concept-to-clinic/statuses/29ffd7d949d44dc73304e07888a043c589ec588c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dchansen"}}