{"action":"created","comment":{"url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments/52183013","id":52183013,"diff_hunk":"@@ -0,0 +1,106 @@\n+# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project\n+# All rights reserved.\n+#\n+# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>\n+#\n+# Redistribution and use in source and binary forms, with or without\n+# modification, are permitted provided that the following conditions are met:\n+#\n+#     1. Redistributions of source code must retain the above copyright\n+#        notice, this list of conditions and the following disclaimer.\n+#     2. Redistributions in binary form must reproduce the above copyright\n+#        notice, this list of conditions and the following disclaimer in the\n+#        documentation and/or other materials provided with the distribution.\n+#     3. Neither the name of the copyright holder nor the names of\n+#        its contributors may be used to endorse or promote products\n+#        derived from this software without specific prior written permission.\n+#\n+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY\n+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+\n+'''Module for the comparison of the morphometrics between two sets of trees.'''\n+\n+import numpy as np\n+from neurom.core import iter_neurites\n+\n+from neurom import triplets as tri\n+from neurom import segments as seg\n+from neurom import bifurcations as bif\n+from neurom import sections as sec\n+\n+feature_map = {'Meander_angle': tri.meander_angle,\n+               'Segment_length': seg.length,\n+               'Bif_angles': bif.local_angle,\n+               'Section_path_length': sec.end_point_path_length,\n+               'Section_area': sec.area,\n+               'Section_length': sec.length}\n+\n+features = ('Meander_angle',\n+            'Segment_length',\n+            'Bif_angles',\n+            'Section_path_length',\n+            'Section_area',\n+            'Section_length',)\n+\n+\n+def get_features(object1, object2, flist=features):\n+    '''Computes features from module mod'''\n+    collect_all = []\n+\n+    for feat in flist:\n+\n+        feature_pop = np.array([l for l in iter_neurites(object1, feature_map[feat])])\n+        feature_neu = np.array([l for l in iter_neurites(object2, feature_map[feat])])\n+\n+        # Standardization of data: (data - mean(data))/ std(data)\n+        m = np.mean(feature_pop)\n+        st = np.std(feature_pop)\n+\n+        collect_all.append([(feature_pop - m) / st, (feature_neu - m) / st])","path":"examples/comparison.py","position":67,"original_position":67,"commit_id":"c65e679a98baf435ae00f1243f475452d5f7e0ea","original_commit_id":"c65e679a98baf435ae00f1243f475452d5f7e0ea","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"body":"I will let @chalimou confirm the previous, if what I describe is understandable. ","created_at":"2016-02-08T15:34:49Z","updated_at":"2016-02-08T15:34:49Z","html_url":"https://github.com/BlueBrain/NeuroM/pull/243#discussion_r52183013","pull_request_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243","_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments/52183013"},"html":{"href":"https://github.com/BlueBrain/NeuroM/pull/243#discussion_r52183013"},"pull_request":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243"}}},"pull_request":{"url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243","id":56873228,"html_url":"https://github.com/BlueBrain/NeuroM/pull/243","diff_url":"https://github.com/BlueBrain/NeuroM/pull/243.diff","patch_url":"https://github.com/BlueBrain/NeuroM/pull/243.patch","issue_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/243","number":243,"state":"open","locked":false,"title":"Script to compare the morphometrics of two sets of trees","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"body":"This will be used in BigNeuron Hackathon for comparison between different algorithms of automatic reconstruction.\r\n\r\nMore features will be added gradually.","created_at":"2016-01-22T10:55:22Z","updated_at":"2016-02-08T15:34:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e03b7db9e81ddef494d148384f1e697378827f2b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243/commits","review_comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243/comments","review_comment_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/243/comments","statuses_url":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/c65e679a98baf435ae00f1243f475452d5f7e0ea","head":{"label":"lidakanari:master","ref":"master","sha":"c65e679a98baf435ae00f1243f475452d5f7e0ea","user":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"repo":{"id":43776839,"name":"NeuroM","full_name":"lidakanari/NeuroM","owner":{"login":"lidakanari","id":14071443,"avatar_url":"https://avatars.githubusercontent.com/u/14071443?v=3","gravatar_id":"","url":"https://api.github.com/users/lidakanari","html_url":"https://github.com/lidakanari","followers_url":"https://api.github.com/users/lidakanari/followers","following_url":"https://api.github.com/users/lidakanari/following{/other_user}","gists_url":"https://api.github.com/users/lidakanari/gists{/gist_id}","starred_url":"https://api.github.com/users/lidakanari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lidakanari/subscriptions","organizations_url":"https://api.github.com/users/lidakanari/orgs","repos_url":"https://api.github.com/users/lidakanari/repos","events_url":"https://api.github.com/users/lidakanari/events{/privacy}","received_events_url":"https://api.github.com/users/lidakanari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lidakanari/NeuroM","description":"Neuronal Morphology Viewing and Analysis Tool","fork":true,"url":"https://api.github.com/repos/lidakanari/NeuroM","forks_url":"https://api.github.com/repos/lidakanari/NeuroM/forks","keys_url":"https://api.github.com/repos/lidakanari/NeuroM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lidakanari/NeuroM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lidakanari/NeuroM/teams","hooks_url":"https://api.github.com/repos/lidakanari/NeuroM/hooks","issue_events_url":"https://api.github.com/repos/lidakanari/NeuroM/issues/events{/number}","events_url":"https://api.github.com/repos/lidakanari/NeuroM/events","assignees_url":"https://api.github.com/repos/lidakanari/NeuroM/assignees{/user}","branches_url":"https://api.github.com/repos/lidakanari/NeuroM/branches{/branch}","tags_url":"https://api.github.com/repos/lidakanari/NeuroM/tags","blobs_url":"https://api.github.com/repos/lidakanari/NeuroM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lidakanari/NeuroM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lidakanari/NeuroM/git/refs{/sha}","trees_url":"https://api.github.com/repos/lidakanari/NeuroM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lidakanari/NeuroM/statuses/{sha}","languages_url":"https://api.github.com/repos/lidakanari/NeuroM/languages","stargazers_url":"https://api.github.com/repos/lidakanari/NeuroM/stargazers","contributors_url":"https://api.github.com/repos/lidakanari/NeuroM/contributors","subscribers_url":"https://api.github.com/repos/lidakanari/NeuroM/subscribers","subscription_url":"https://api.github.com/repos/lidakanari/NeuroM/subscription","commits_url":"https://api.github.com/repos/lidakanari/NeuroM/commits{/sha}","git_commits_url":"https://api.github.com/repos/lidakanari/NeuroM/git/commits{/sha}","comments_url":"https://api.github.com/repos/lidakanari/NeuroM/comments{/number}","issue_comment_url":"https://api.github.com/repos/lidakanari/NeuroM/issues/comments{/number}","contents_url":"https://api.github.com/repos/lidakanari/NeuroM/contents/{+path}","compare_url":"https://api.github.com/repos/lidakanari/NeuroM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lidakanari/NeuroM/merges","archive_url":"https://api.github.com/repos/lidakanari/NeuroM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lidakanari/NeuroM/downloads","issues_url":"https://api.github.com/repos/lidakanari/NeuroM/issues{/number}","pulls_url":"https://api.github.com/repos/lidakanari/NeuroM/pulls{/number}","milestones_url":"https://api.github.com/repos/lidakanari/NeuroM/milestones{/number}","notifications_url":"https://api.github.com/repos/lidakanari/NeuroM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lidakanari/NeuroM/labels{/name}","releases_url":"https://api.github.com/repos/lidakanari/NeuroM/releases{/id}","deployments_url":"https://api.github.com/repos/lidakanari/NeuroM/deployments","created_at":"2015-10-06T20:32:37Z","updated_at":"2016-01-14T15:16:26Z","pushed_at":"2016-02-08T14:29:51Z","git_url":"git://github.com/lidakanari/NeuroM.git","ssh_url":"git@github.com:lidakanari/NeuroM.git","clone_url":"https://github.com/lidakanari/NeuroM.git","svn_url":"https://github.com/lidakanari/NeuroM","homepage":null,"size":2595,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"BlueBrain:master","ref":"master","sha":"c0ca776fbcbb95771877722c2b898e3acc593b28","user":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"repo":{"id":34906350,"name":"NeuroM","full_name":"BlueBrain/NeuroM","owner":{"login":"BlueBrain","id":1479142,"avatar_url":"https://avatars.githubusercontent.com/u/1479142?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueBrain","html_url":"https://github.com/BlueBrain","followers_url":"https://api.github.com/users/BlueBrain/followers","following_url":"https://api.github.com/users/BlueBrain/following{/other_user}","gists_url":"https://api.github.com/users/BlueBrain/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueBrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueBrain/subscriptions","organizations_url":"https://api.github.com/users/BlueBrain/orgs","repos_url":"https://api.github.com/users/BlueBrain/repos","events_url":"https://api.github.com/users/BlueBrain/events{/privacy}","received_events_url":"https://api.github.com/users/BlueBrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BlueBrain/NeuroM","description":"Neuronal Morphology Viewing and Analysis Tool","fork":false,"url":"https://api.github.com/repos/BlueBrain/NeuroM","forks_url":"https://api.github.com/repos/BlueBrain/NeuroM/forks","keys_url":"https://api.github.com/repos/BlueBrain/NeuroM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlueBrain/NeuroM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlueBrain/NeuroM/teams","hooks_url":"https://api.github.com/repos/BlueBrain/NeuroM/hooks","issue_events_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/events{/number}","events_url":"https://api.github.com/repos/BlueBrain/NeuroM/events","assignees_url":"https://api.github.com/repos/BlueBrain/NeuroM/assignees{/user}","branches_url":"https://api.github.com/repos/BlueBrain/NeuroM/branches{/branch}","tags_url":"https://api.github.com/repos/BlueBrain/NeuroM/tags","blobs_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/{sha}","languages_url":"https://api.github.com/repos/BlueBrain/NeuroM/languages","stargazers_url":"https://api.github.com/repos/BlueBrain/NeuroM/stargazers","contributors_url":"https://api.github.com/repos/BlueBrain/NeuroM/contributors","subscribers_url":"https://api.github.com/repos/BlueBrain/NeuroM/subscribers","subscription_url":"https://api.github.com/repos/BlueBrain/NeuroM/subscription","commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlueBrain/NeuroM/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlueBrain/NeuroM/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlueBrain/NeuroM/contents/{+path}","compare_url":"https://api.github.com/repos/BlueBrain/NeuroM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlueBrain/NeuroM/merges","archive_url":"https://api.github.com/repos/BlueBrain/NeuroM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlueBrain/NeuroM/downloads","issues_url":"https://api.github.com/repos/BlueBrain/NeuroM/issues{/number}","pulls_url":"https://api.github.com/repos/BlueBrain/NeuroM/pulls{/number}","milestones_url":"https://api.github.com/repos/BlueBrain/NeuroM/milestones{/number}","notifications_url":"https://api.github.com/repos/BlueBrain/NeuroM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlueBrain/NeuroM/labels{/name}","releases_url":"https://api.github.com/repos/BlueBrain/NeuroM/releases{/id}","deployments_url":"https://api.github.com/repos/BlueBrain/NeuroM/deployments","created_at":"2015-05-01T14:21:43Z","updated_at":"2016-02-03T01:39:35Z","pushed_at":"2016-02-08T14:29:51Z","git_url":"git://github.com/BlueBrain/NeuroM.git","ssh_url":"git@github.com:BlueBrain/NeuroM.git","clone_url":"https://github.com/BlueBrain/NeuroM.git","svn_url":"https://github.com/BlueBrain/NeuroM","homepage":null,"size":2615,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":11,"forks":10,"open_issues":11,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243"},"html":{"href":"https://github.com/BlueBrain/NeuroM/pull/243"},"issue":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/issues/243"},"comments":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/issues/243/comments"},"review_comments":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243/comments"},"review_comment":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/pulls/243/commits"},"statuses":{"href":"https://api.github.com/repos/BlueBrain/NeuroM/statuses/c65e679a98baf435ae00f1243f475452d5f7e0ea"}}}}