{"action":"created","comment":{"url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/comments/67200132","id":67200132,"diff_hunk":"@@ -0,0 +1,106 @@\n+import skimage.feature\n+import numpy as np\n+\n+\n+def FeatureExtractionHaralick(I, Dst=1, Ng=256):\n+    \"\"\"\n+    Calculates 26 Haralick features from an image\n+    Parameters\n+    ----------\n+    I : array_like\n+        An intensity image\n+    Dst : Distance of neighboring pixels in an image. Default value = 1.\n+    Ng : Number of gray level co-occurance matrix. Default value = 256.\n+    Returns\n+    -------\n+    H : array_like\n+        A matrix containing mean and ranges for 26 features\n+    References\n+    ----------\n+    .. [1] Haralick, et al. \"Textural features for image classification,\"\n+    IEEE Transactions on Systems, Man, and Cybernatics, vol. 6, pp: 610-621,\n+    1973.\n+    .. [2] Luis Pedro Coelho. \"Mahotas: Open source software for scriptable\n+    computer vision,\" Journal of Open Research Software, vol 1, 2013.\n+    \"\"\"\n+    # sets the number of angles: 0 45 90 135. this must not be modified.\n+    NumberofAngles = 4","path":"histomicstk/FeatureExtractionHaralick.py","position":null,"original_position":27,"commit_id":"14b7d4b12c2e68c668ab7105a9269bec6bb19f5c","original_commit_id":"94118cb2f9795ebda39a70694f9766502b615f47","user":{"login":"cdeepakroy","id":1923534,"avatar_url":"https://avatars.githubusercontent.com/u/1923534?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeepakroy","html_url":"https://github.com/cdeepakroy","followers_url":"https://api.github.com/users/cdeepakroy/followers","following_url":"https://api.github.com/users/cdeepakroy/following{/other_user}","gists_url":"https://api.github.com/users/cdeepakroy/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeepakroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeepakroy/subscriptions","organizations_url":"https://api.github.com/users/cdeepakroy/orgs","repos_url":"https://api.github.com/users/cdeepakroy/repos","events_url":"https://api.github.com/users/cdeepakroy/events{/privacy}","received_events_url":"https://api.github.com/users/cdeepakroy/received_events","type":"User","site_admin":false},"body":"@slee172 Maybe let us modeling the parameters similar to [matlab](http://www.mathworks.com/help/images/ref/graycomatrix.html).\r\n\r\nSee the GrayLimits, NumLevels, and Offset (this is probably the most general way to allow angle selection), and Symmetric parameters.","created_at":"2016-06-15T16:49:23Z","updated_at":"2016-06-15T16:49:23Z","html_url":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101#discussion_r67200132","pull_request_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/comments/67200132"},"html":{"href":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101#discussion_r67200132"},"pull_request":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101","id":72226757,"html_url":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101","diff_url":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101.diff","patch_url":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101.patch","issue_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/101","number":101,"state":"open","locked":false,"title":"Haralick Feature Extraction","user":{"login":"slee172","id":16363501,"avatar_url":"https://avatars.githubusercontent.com/u/16363501?v=3","gravatar_id":"","url":"https://api.github.com/users/slee172","html_url":"https://github.com/slee172","followers_url":"https://api.github.com/users/slee172/followers","following_url":"https://api.github.com/users/slee172/following{/other_user}","gists_url":"https://api.github.com/users/slee172/gists{/gist_id}","starred_url":"https://api.github.com/users/slee172/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slee172/subscriptions","organizations_url":"https://api.github.com/users/slee172/orgs","repos_url":"https://api.github.com/users/slee172/repos","events_url":"https://api.github.com/users/slee172/events{/privacy}","received_events_url":"https://api.github.com/users/slee172/received_events","type":"User","site_admin":false},"body":"Added Haralick feature extraction for 26 features.\r\n\r\nThe function receives an intensity image, distance of neighboring pixels (default 1 ), and number of gray level co-occurance matrix (defalut 256), and returns a 1 by 26 array indicating 26 features.\r\n \r\nTo first get a gray level co-occurance matrix from the intensity image, skimage.feature.greycomatrix is used, and then computed 13 features (Angular Second Moment, Contrast, Correlation, Sum of Squares, Inverse Difference Moment, Sum Average, Sum Variance, Sum Entropy, Entropy, Variance, Difference Entropy, Information Measures of Correlation 1 and 2) for each angle (0, 45, 90, and 135). And then, means and ranges of the 13 features for the angles are computed, thus generating 26 different features.\r\n\r\nThe calucation for the last feature named Maximal Correlation Coefficient was not added to the function because it could cause a computational instability. It is refered to MurphyLab (http://murphylab.web.cmu.edu/publications/boland/boland_node26.html)","created_at":"2016-06-01T18:11:13Z","updated_at":"2016-06-15T16:49:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9250b13f021d8afa3a8da6a4ea69ee43aed2dfa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101/commits","review_comments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101/comments","review_comment_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/101/comments","statuses_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/statuses/14b7d4b12c2e68c668ab7105a9269bec6bb19f5c","head":{"label":"DigitalSlideArchive:haralick","ref":"haralick","sha":"14b7d4b12c2e68c668ab7105a9269bec6bb19f5c","user":{"login":"DigitalSlideArchive","id":13769637,"avatar_url":"https://avatars.githubusercontent.com/u/13769637?v=3","gravatar_id":"","url":"https://api.github.com/users/DigitalSlideArchive","html_url":"https://github.com/DigitalSlideArchive","followers_url":"https://api.github.com/users/DigitalSlideArchive/followers","following_url":"https://api.github.com/users/DigitalSlideArchive/following{/other_user}","gists_url":"https://api.github.com/users/DigitalSlideArchive/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalSlideArchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalSlideArchive/subscriptions","organizations_url":"https://api.github.com/users/DigitalSlideArchive/orgs","repos_url":"https://api.github.com/users/DigitalSlideArchive/repos","events_url":"https://api.github.com/users/DigitalSlideArchive/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalSlideArchive/received_events","type":"Organization","site_admin":false},"repo":{"id":44324447,"name":"HistomicsTK","full_name":"DigitalSlideArchive/HistomicsTK","owner":{"login":"DigitalSlideArchive","id":13769637,"avatar_url":"https://avatars.githubusercontent.com/u/13769637?v=3","gravatar_id":"","url":"https://api.github.com/users/DigitalSlideArchive","html_url":"https://github.com/DigitalSlideArchive","followers_url":"https://api.github.com/users/DigitalSlideArchive/followers","following_url":"https://api.github.com/users/DigitalSlideArchive/following{/other_user}","gists_url":"https://api.github.com/users/DigitalSlideArchive/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalSlideArchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalSlideArchive/subscriptions","organizations_url":"https://api.github.com/users/DigitalSlideArchive/orgs","repos_url":"https://api.github.com/users/DigitalSlideArchive/repos","events_url":"https://api.github.com/users/DigitalSlideArchive/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalSlideArchive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DigitalSlideArchive/HistomicsTK","description":"A Python and REST API for Histopathology Image Analysis","fork":false,"url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK","forks_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/forks","keys_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/teams","hooks_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/hooks","issue_events_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/events{/number}","events_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/events","assignees_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/assignees{/user}","branches_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/branches{/branch}","tags_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/tags","blobs_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/refs{/sha}","trees_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/statuses/{sha}","languages_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/languages","stargazers_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/stargazers","contributors_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/contributors","subscribers_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/subscribers","subscription_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/subscription","commits_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/commits{/sha}","git_commits_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/commits{/sha}","comments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/comments{/number}","issue_comment_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/comments{/number}","contents_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/contents/{+path}","compare_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/merges","archive_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/downloads","issues_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues{/number}","pulls_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls{/number}","milestones_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/milestones{/number}","notifications_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/labels{/name}","releases_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/releases{/id}","deployments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/deployments","created_at":"2015-10-15T14:49:21Z","updated_at":"2016-06-13T11:27:03Z","pushed_at":"2016-06-15T14:44:22Z","git_url":"git://github.com/DigitalSlideArchive/HistomicsTK.git","ssh_url":"git@github.com:DigitalSlideArchive/HistomicsTK.git","clone_url":"https://github.com/DigitalSlideArchive/HistomicsTK.git","svn_url":"https://github.com/DigitalSlideArchive/HistomicsTK","homepage":"","size":535,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":6,"default_branch":"master"}},"base":{"label":"DigitalSlideArchive:master","ref":"master","sha":"cb056b130298d69b96a84f8172123e32e7e8cf19","user":{"login":"DigitalSlideArchive","id":13769637,"avatar_url":"https://avatars.githubusercontent.com/u/13769637?v=3","gravatar_id":"","url":"https://api.github.com/users/DigitalSlideArchive","html_url":"https://github.com/DigitalSlideArchive","followers_url":"https://api.github.com/users/DigitalSlideArchive/followers","following_url":"https://api.github.com/users/DigitalSlideArchive/following{/other_user}","gists_url":"https://api.github.com/users/DigitalSlideArchive/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalSlideArchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalSlideArchive/subscriptions","organizations_url":"https://api.github.com/users/DigitalSlideArchive/orgs","repos_url":"https://api.github.com/users/DigitalSlideArchive/repos","events_url":"https://api.github.com/users/DigitalSlideArchive/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalSlideArchive/received_events","type":"Organization","site_admin":false},"repo":{"id":44324447,"name":"HistomicsTK","full_name":"DigitalSlideArchive/HistomicsTK","owner":{"login":"DigitalSlideArchive","id":13769637,"avatar_url":"https://avatars.githubusercontent.com/u/13769637?v=3","gravatar_id":"","url":"https://api.github.com/users/DigitalSlideArchive","html_url":"https://github.com/DigitalSlideArchive","followers_url":"https://api.github.com/users/DigitalSlideArchive/followers","following_url":"https://api.github.com/users/DigitalSlideArchive/following{/other_user}","gists_url":"https://api.github.com/users/DigitalSlideArchive/gists{/gist_id}","starred_url":"https://api.github.com/users/DigitalSlideArchive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DigitalSlideArchive/subscriptions","organizations_url":"https://api.github.com/users/DigitalSlideArchive/orgs","repos_url":"https://api.github.com/users/DigitalSlideArchive/repos","events_url":"https://api.github.com/users/DigitalSlideArchive/events{/privacy}","received_events_url":"https://api.github.com/users/DigitalSlideArchive/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DigitalSlideArchive/HistomicsTK","description":"A Python and REST API for Histopathology Image Analysis","fork":false,"url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK","forks_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/forks","keys_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/teams","hooks_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/hooks","issue_events_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/events{/number}","events_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/events","assignees_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/assignees{/user}","branches_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/branches{/branch}","tags_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/tags","blobs_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/refs{/sha}","trees_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/statuses/{sha}","languages_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/languages","stargazers_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/stargazers","contributors_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/contributors","subscribers_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/subscribers","subscription_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/subscription","commits_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/commits{/sha}","git_commits_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/git/commits{/sha}","comments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/comments{/number}","issue_comment_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/comments{/number}","contents_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/contents/{+path}","compare_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/merges","archive_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/downloads","issues_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues{/number}","pulls_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls{/number}","milestones_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/milestones{/number}","notifications_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/labels{/name}","releases_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/releases{/id}","deployments_url":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/deployments","created_at":"2015-10-15T14:49:21Z","updated_at":"2016-06-13T11:27:03Z","pushed_at":"2016-06-15T14:44:22Z","git_url":"git://github.com/DigitalSlideArchive/HistomicsTK.git","ssh_url":"git@github.com:DigitalSlideArchive/HistomicsTK.git","clone_url":"https://github.com/DigitalSlideArchive/HistomicsTK.git","svn_url":"https://github.com/DigitalSlideArchive/HistomicsTK","homepage":"","size":535,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":15,"forks":2,"open_issues":15,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101"},"html":{"href":"https://github.com/DigitalSlideArchive/HistomicsTK/pull/101"},"issue":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/101"},"comments":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/DigitalSlideArchive/HistomicsTK/statuses/14b7d4b12c2e68c668ab7105a9269bec6bb19f5c"}}}}
{"actor":{"display_login":"cdeepakroy"}}