{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments/26001172","id":26001172,"diff_hunk":"@@ -463,3 +463,28 @@ def adjust_sigmoid(image, cutoff=0.5, gain=10, inv=False):\n \n     out = (1 / (1 + np.exp(gain * (cutoff - image / scale)))) * scale\n     return dtype(out)\n+\n+\n+def is_low_contrast(image, threshold_percent=0.5, lower_bound=1,\n+                    upper_bound=99, method='linear'):\n+    \"\"\"Detemine if an image is low contrast.\n+\n+    Parameters\n+    ----------\n+    image : array-like\n+        The image under test.\n+    threshold_percent : float, optional\n+        The low contrast threshold in percent.\n+    lower_bound : float, optional\n+        The lower bound percentile of the image to use.\n+    upper_bound : float, optional\n+        The upper bound percentile of the image to use.\n+    method : str, optional\n+        The contrast determination method.  Right now the only available\n+        option is \"linear\".\n+    \"\"\"","path":"skimage/exposure/exposure.py","position":23,"original_position":23,"commit_id":"80ad51898481e4537b7fbd0a03f741f10cb8a7fd","original_commit_id":"80ad51898481e4537b7fbd0a03f741f10cb8a7fd","user":{"login":"jni","id":492549,"avatar_url":"https://avatars.githubusercontent.com/u/492549?v=3","gravatar_id":"","url":"https://api.github.com/users/jni","html_url":"https://github.com/jni","followers_url":"https://api.github.com/users/jni/followers","following_url":"https://api.github.com/users/jni/following{/other_user}","gists_url":"https://api.github.com/users/jni/gists{/gist_id}","starred_url":"https://api.github.com/users/jni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jni/subscriptions","organizations_url":"https://api.github.com/users/jni/orgs","repos_url":"https://api.github.com/users/jni/repos","events_url":"https://api.github.com/users/jni/events{/privacy}","received_events_url":"https://api.github.com/users/jni/received_events","type":"User","site_admin":false},"body":"Also, a couple of simple doctests (using \"images\" generated with `np.arange` or `np.linspace`) might be really good here to illustrate the parameters. e.g. you can have an image that's np.linspace(0, 0.04, 100), then set image[-1] = 1, and see how the result of `is_low_contrast` changes when changing `upper_percentile` from 99 to 100.","created_at":"2015-03-08T00:53:24Z","updated_at":"2015-03-08T00:53:24Z","html_url":"https://github.com/scikit-image/scikit-image/pull/1412#discussion_r26001172","pull_request_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412","_links":{"self":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments/26001172"},"html":{"href":"https://github.com/scikit-image/scikit-image/pull/1412#discussion_r26001172"},"pull_request":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412","id":30704266,"html_url":"https://github.com/scikit-image/scikit-image/pull/1412","diff_url":"https://github.com/scikit-image/scikit-image/pull/1412.diff","patch_url":"https://github.com/scikit-image/scikit-image/pull/1412.patch","issue_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1412","number":1412,"state":"open","locked":false,"title":"Contrast check function","user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"body":"Fix for #1403.  Adds function in `exposure` to check for a low contrast image, and uses the function in `imsave` and matplotlib's `imshow`.","created_at":"2015-03-07T15:31:42Z","updated_at":"2015-03-08T00:53:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ee0458c81363d12067f76006f52e8ad0328f3c29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412/commits","review_comments_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412/comments","review_comment_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/1412/comments","statuses_url":"https://api.github.com/repos/scikit-image/scikit-image/statuses/80ad51898481e4537b7fbd0a03f741f10cb8a7fd","head":{"label":"blink1073:contrast-check-function","ref":"contrast-check-function","sha":"80ad51898481e4537b7fbd0a03f741f10cb8a7fd","user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"repo":{"id":5300173,"name":"scikit-image","full_name":"blink1073/scikit-image","owner":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blink1073/scikit-image","description":"Image Processing SciKit (Toolbox for SciPy)","fork":true,"url":"https://api.github.com/repos/blink1073/scikit-image","forks_url":"https://api.github.com/repos/blink1073/scikit-image/forks","keys_url":"https://api.github.com/repos/blink1073/scikit-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blink1073/scikit-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blink1073/scikit-image/teams","hooks_url":"https://api.github.com/repos/blink1073/scikit-image/hooks","issue_events_url":"https://api.github.com/repos/blink1073/scikit-image/issues/events{/number}","events_url":"https://api.github.com/repos/blink1073/scikit-image/events","assignees_url":"https://api.github.com/repos/blink1073/scikit-image/assignees{/user}","branches_url":"https://api.github.com/repos/blink1073/scikit-image/branches{/branch}","tags_url":"https://api.github.com/repos/blink1073/scikit-image/tags","blobs_url":"https://api.github.com/repos/blink1073/scikit-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blink1073/scikit-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blink1073/scikit-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/blink1073/scikit-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blink1073/scikit-image/statuses/{sha}","languages_url":"https://api.github.com/repos/blink1073/scikit-image/languages","stargazers_url":"https://api.github.com/repos/blink1073/scikit-image/stargazers","contributors_url":"https://api.github.com/repos/blink1073/scikit-image/contributors","subscribers_url":"https://api.github.com/repos/blink1073/scikit-image/subscribers","subscription_url":"https://api.github.com/repos/blink1073/scikit-image/subscription","commits_url":"https://api.github.com/repos/blink1073/scikit-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/blink1073/scikit-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/blink1073/scikit-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/blink1073/scikit-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/blink1073/scikit-image/contents/{+path}","compare_url":"https://api.github.com/repos/blink1073/scikit-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blink1073/scikit-image/merges","archive_url":"https://api.github.com/repos/blink1073/scikit-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blink1073/scikit-image/downloads","issues_url":"https://api.github.com/repos/blink1073/scikit-image/issues{/number}","pulls_url":"https://api.github.com/repos/blink1073/scikit-image/pulls{/number}","milestones_url":"https://api.github.com/repos/blink1073/scikit-image/milestones{/number}","notifications_url":"https://api.github.com/repos/blink1073/scikit-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blink1073/scikit-image/labels{/name}","releases_url":"https://api.github.com/repos/blink1073/scikit-image/releases{/id}","created_at":"2012-08-05T01:31:30Z","updated_at":"2015-02-26T14:20:02Z","pushed_at":"2015-03-07T15:30:39Z","git_url":"git://github.com/blink1073/scikit-image.git","ssh_url":"git@github.com:blink1073/scikit-image.git","clone_url":"https://github.com/blink1073/scikit-image.git","svn_url":"https://github.com/blink1073/scikit-image","homepage":"http://scikit-image.org","size":39158,"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":"scikit-image:master","ref":"master","sha":"f997ef64e9ad49169f4de2afd215aee00aae551b","user":{"login":"scikit-image","id":897180,"avatar_url":"https://avatars.githubusercontent.com/u/897180?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-image","html_url":"https://github.com/scikit-image","followers_url":"https://api.github.com/users/scikit-image/followers","following_url":"https://api.github.com/users/scikit-image/following{/other_user}","gists_url":"https://api.github.com/users/scikit-image/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-image/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-image/subscriptions","organizations_url":"https://api.github.com/users/scikit-image/orgs","repos_url":"https://api.github.com/users/scikit-image/repos","events_url":"https://api.github.com/users/scikit-image/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-image/received_events","type":"Organization","site_admin":false},"repo":{"id":2014929,"name":"scikit-image","full_name":"scikit-image/scikit-image","owner":{"login":"scikit-image","id":897180,"avatar_url":"https://avatars.githubusercontent.com/u/897180?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-image","html_url":"https://github.com/scikit-image","followers_url":"https://api.github.com/users/scikit-image/followers","following_url":"https://api.github.com/users/scikit-image/following{/other_user}","gists_url":"https://api.github.com/users/scikit-image/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-image/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-image/subscriptions","organizations_url":"https://api.github.com/users/scikit-image/orgs","repos_url":"https://api.github.com/users/scikit-image/repos","events_url":"https://api.github.com/users/scikit-image/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-image/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-image/scikit-image","description":"Image Processing SciKit (Toolbox for SciPy)","fork":false,"url":"https://api.github.com/repos/scikit-image/scikit-image","forks_url":"https://api.github.com/repos/scikit-image/scikit-image/forks","keys_url":"https://api.github.com/repos/scikit-image/scikit-image/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-image/scikit-image/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-image/scikit-image/teams","hooks_url":"https://api.github.com/repos/scikit-image/scikit-image/hooks","issue_events_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-image/scikit-image/events","assignees_url":"https://api.github.com/repos/scikit-image/scikit-image/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-image/scikit-image/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-image/scikit-image/tags","blobs_url":"https://api.github.com/repos/scikit-image/scikit-image/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-image/scikit-image/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-image/scikit-image/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-image/scikit-image/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-image/scikit-image/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-image/scikit-image/languages","stargazers_url":"https://api.github.com/repos/scikit-image/scikit-image/stargazers","contributors_url":"https://api.github.com/repos/scikit-image/scikit-image/contributors","subscribers_url":"https://api.github.com/repos/scikit-image/scikit-image/subscribers","subscription_url":"https://api.github.com/repos/scikit-image/scikit-image/subscription","commits_url":"https://api.github.com/repos/scikit-image/scikit-image/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-image/scikit-image/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-image/scikit-image/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-image/scikit-image/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-image/scikit-image/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-image/scikit-image/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-image/scikit-image/merges","archive_url":"https://api.github.com/repos/scikit-image/scikit-image/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-image/scikit-image/downloads","issues_url":"https://api.github.com/repos/scikit-image/scikit-image/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-image/scikit-image/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-image/scikit-image/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-image/scikit-image/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-image/scikit-image/labels{/name}","releases_url":"https://api.github.com/repos/scikit-image/scikit-image/releases{/id}","created_at":"2011-07-07T22:07:20Z","updated_at":"2015-03-07T16:58:55Z","pushed_at":"2015-03-06T09:19:11Z","git_url":"git://github.com/scikit-image/scikit-image.git","ssh_url":"git@github.com:scikit-image/scikit-image.git","clone_url":"https://github.com/scikit-image/scikit-image.git","svn_url":"https://github.com/scikit-image/scikit-image","homepage":"http://scikit-image.org","size":64153,"stargazers_count":619,"watchers_count":619,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":317,"mirror_url":null,"open_issues_count":144,"forks":317,"open_issues":144,"watchers":619,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412"},"html":{"href":"https://github.com/scikit-image/scikit-image/pull/1412"},"issue":{"href":"https://api.github.com/repos/scikit-image/scikit-image/issues/1412"},"comments":{"href":"https://api.github.com/repos/scikit-image/scikit-image/issues/1412/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-image/scikit-image/pulls/1412/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-image/scikit-image/statuses/80ad51898481e4537b7fbd0a03f741f10cb8a7fd"}}}}