{"action":"created","comment":{"url":"https://api.github.com/repos/Napari/napari-gui/pulls/comments/230634962","pull_request_review_id":171413627,"id":230634962,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDYzNDk2Mg==","diff_hunk":"@@ -52,7 +56,7 @@ def update_slider(self, axis, max_axis_length):\n         grid = self.layout()\n         row = self.viewer._axis_to_row(axis)\n \n-        slider = grid.itemAt(row)\n+        slider = grid.itemAt(row+1)","path":"gui/elements/qt/_viewer.py","position":30,"original_position":30,"commit_id":"c378ed9b143b05bddd036f1124c40cf5d3978398","original_commit_id":"c378ed9b143b05bddd036f1124c40cf5d3978398","user":{"login":"kne42","id":29165011,"node_id":"MDQ6VXNlcjI5MTY1MDEx","avatar_url":"https://avatars3.githubusercontent.com/u/29165011?v=4","gravatar_id":"","url":"https://api.github.com/users/kne42","html_url":"https://github.com/kne42","followers_url":"https://api.github.com/users/kne42/followers","following_url":"https://api.github.com/users/kne42/following{/other_user}","gists_url":"https://api.github.com/users/kne42/gists{/gist_id}","starred_url":"https://api.github.com/users/kne42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kne42/subscriptions","organizations_url":"https://api.github.com/users/kne42/orgs","repos_url":"https://api.github.com/users/kne42/repos","events_url":"https://api.github.com/users/kne42/events{/privacy}","received_events_url":"https://api.github.com/users/kne42/received_events","type":"User","site_admin":false},"body":"This should be changed in `viewer._axis_to_row` itself.","created_at":"2018-11-05T05:05:20Z","updated_at":"2018-11-05T05:46:42Z","html_url":"https://github.com/Napari/napari-gui/pull/41#discussion_r230634962","pull_request_url":"https://api.github.com/repos/Napari/napari-gui/pulls/41","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/comments/230634962"},"html":{"href":"https://github.com/Napari/napari-gui/pull/41#discussion_r230634962"},"pull_request":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/Napari/napari-gui/pulls/41","id":228238584,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MjM4NTg0","html_url":"https://github.com/Napari/napari-gui/pull/41","diff_url":"https://github.com/Napari/napari-gui/pull/41.diff","patch_url":"https://github.com/Napari/napari-gui/pull/41.patch","issue_url":"https://api.github.com/repos/Napari/napari-gui/issues/41","number":41,"state":"open","locked":false,"title":"Layer display","user":{"login":"sofroniewn","id":6531703,"node_id":"MDQ6VXNlcjY1MzE3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/6531703?v=4","gravatar_id":"","url":"https://api.github.com/users/sofroniewn","html_url":"https://github.com/sofroniewn","followers_url":"https://api.github.com/users/sofroniewn/followers","following_url":"https://api.github.com/users/sofroniewn/following{/other_user}","gists_url":"https://api.github.com/users/sofroniewn/gists{/gist_id}","starred_url":"https://api.github.com/users/sofroniewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofroniewn/subscriptions","organizations_url":"https://api.github.com/users/sofroniewn/orgs","repos_url":"https://api.github.com/users/sofroniewn/repos","events_url":"https://api.github.com/users/sofroniewn/events{/privacy}","received_events_url":"https://api.github.com/users/sofroniewn/received_events","type":"User","site_admin":false},"body":"# What does this PR do? Why are doing this? References?\r\nThis PR is a first attempt at implementing a layers panel that would allow you to control properties of individual layers (like their visibility, colormaps, and opacity) directly from the gui. This functionality will enable easier viewing and exploration of images directly from the gui.\r\n\r\nRight now it is a very early prototype that is not ready to be merged, but I thought I'd make the PR now to let people take a look at one possible approach and weigh in on some of the design decisions that will need to be made. Firstly, I have only made a single qt-layer widget that gets added whenever a new layer gets added. It right now has properties that are specific to image layers (like `colormaps`) but not present on other layers (like marker layers, which instead have a `facecolor` and `edgecolor`). Alternatively each layer type could define its own layer widget customized to its features, and maybe inheriting from some base class defining a prototype layer widget. I think this direction makes sense, but wanted to get others input before pressing on. In the current PR using the `add_markers` function will throw an error as markers do not have a colormap that the layer-widget is looking for.\r\n\r\nAnother major question is how to bidirectionally link the state of the layer-widget in the gui and the settings of layers that are accessible from the notebook. Right now interacting with the layer-widget in the gui will update the displayed image and the settings of the layer, but directly setting a layer property from the notebook (like the `opacity`) will cause the image to update, but not the opacity slider in the widget. The only ways I could see to do this right now might have created some weird circularity where updating the gui updated the property which in turn sent a signal to update the gui. This seemed undesirable.\r\n\r\nAnother major question is how should the layer widgets be added / removed / rearranged when the corresponding layers are added / removed / rearranged from the notebook? Right now adding layers will add layer-widgets, but removing layers won't remove them, nor will rearranging them.\r\n\r\nFinally, I added a `name` property to a layer and made it add a number that autoincrements through an additional property `total` on the `layerList` so that each layer can be given a numbered name when it is created. There might be better ways to do this, and additionally the layer name should be settable when a new layer is created. Updating the layer name in the notebook should also update the layer name in the gui.\r\n\r\nThere are some more minor issues at play as well - like it would be nice to have the layer name editable in the gui. It would be nice to be able to select the layer-widgets and rearrange them in the gui, and have that cause a rearrangement in the `layerList`. Right now if you keep adding layers they eventually will overflow the screen - it would be nice if it was somehow able to generate a scroll bar to accommodate a long list. It would be nice to be able to select a layer to make it active so that the clims and gamma sliders will operate on that layer and that layer only. Finally right now I'm unable to get the name of the vispy colormap from the `colormap` property of the layer, which will make updating the list in the gui harder. Also the colormap feature doesn't apply to an rgb image, making it unclear what the drop-down menu should do in that case.\r\n\r\n\r\n## Type of change\r\n[Please delete options that are not relevant.]\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)\r\n- [ ] This change requires a documentation update\r\n\r\n## How Has This Been Tested?\r\n[Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.]\r\n- [x] TestCase using the ./demo/layers.ipynb file you can preview what the layers look like with multiple images added, and multidimensional images. See below for a screenshot of the gui after 3 layers have been added.\r\n\r\n![image](https://user-images.githubusercontent.com/6531703/47977988-0767c400-e070-11e8-8ae7-8b31045a392a.png)\r\n\r\n- [x] TestCase using the ./demo/demo_markers.ipynb will now give you an error message as this PR does not yet handle add_markers.\r\n\r\n## Final Checklist:\r\n- [x] My PR is the possible minimum work for the desired functionality\r\n- [ ] I have commented my code, particularly in hard-to-understand areas\r\n- [ ] I have made corresponding changes to the documentation\r\n- [ ] I have added tests that prove my fix is effective or that my feature works","created_at":"2018-11-05T04:34:57Z","updated_at":"2018-11-05T05:46:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a4267e7a06272b0075afed77a5a38c24e226429","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1022379513,"node_id":"MDU6TGFiZWwxMDIyMzc5NTEz","url":"https://api.github.com/repos/Napari/napari-gui/labels/feature","name":"feature","color":"a2eeef","default":false},{"id":1116231270,"node_id":"MDU6TGFiZWwxMTE2MjMxMjcw","url":"https://api.github.com/repos/Napari/napari-gui/labels/in-progress","name":"in-progress","color":"bbf2f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Napari/napari-gui/pulls/41/commits","review_comments_url":"https://api.github.com/repos/Napari/napari-gui/pulls/41/comments","review_comment_url":"https://api.github.com/repos/Napari/napari-gui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Napari/napari-gui/issues/41/comments","statuses_url":"https://api.github.com/repos/Napari/napari-gui/statuses/c378ed9b143b05bddd036f1124c40cf5d3978398","head":{"label":"sofroniewn:layer_display","ref":"layer_display","sha":"c378ed9b143b05bddd036f1124c40cf5d3978398","user":{"login":"sofroniewn","id":6531703,"node_id":"MDQ6VXNlcjY1MzE3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/6531703?v=4","gravatar_id":"","url":"https://api.github.com/users/sofroniewn","html_url":"https://github.com/sofroniewn","followers_url":"https://api.github.com/users/sofroniewn/followers","following_url":"https://api.github.com/users/sofroniewn/following{/other_user}","gists_url":"https://api.github.com/users/sofroniewn/gists{/gist_id}","starred_url":"https://api.github.com/users/sofroniewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofroniewn/subscriptions","organizations_url":"https://api.github.com/users/sofroniewn/orgs","repos_url":"https://api.github.com/users/sofroniewn/repos","events_url":"https://api.github.com/users/sofroniewn/events{/privacy}","received_events_url":"https://api.github.com/users/sofroniewn/received_events","type":"User","site_admin":false},"repo":{"id":154751137,"node_id":"MDEwOlJlcG9zaXRvcnkxNTQ3NTExMzc=","name":"napari-gui","full_name":"sofroniewn/napari-gui","private":false,"owner":{"login":"sofroniewn","id":6531703,"node_id":"MDQ6VXNlcjY1MzE3MDM=","avatar_url":"https://avatars1.githubusercontent.com/u/6531703?v=4","gravatar_id":"","url":"https://api.github.com/users/sofroniewn","html_url":"https://github.com/sofroniewn","followers_url":"https://api.github.com/users/sofroniewn/followers","following_url":"https://api.github.com/users/sofroniewn/following{/other_user}","gists_url":"https://api.github.com/users/sofroniewn/gists{/gist_id}","starred_url":"https://api.github.com/users/sofroniewn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofroniewn/subscriptions","organizations_url":"https://api.github.com/users/sofroniewn/orgs","repos_url":"https://api.github.com/users/sofroniewn/repos","events_url":"https://api.github.com/users/sofroniewn/events{/privacy}","received_events_url":"https://api.github.com/users/sofroniewn/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sofroniewn/napari-gui","description":"Napari PyQt5 and VisPy based GUI plugin","fork":true,"url":"https://api.github.com/repos/sofroniewn/napari-gui","forks_url":"https://api.github.com/repos/sofroniewn/napari-gui/forks","keys_url":"https://api.github.com/repos/sofroniewn/napari-gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sofroniewn/napari-gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sofroniewn/napari-gui/teams","hooks_url":"https://api.github.com/repos/sofroniewn/napari-gui/hooks","issue_events_url":"https://api.github.com/repos/sofroniewn/napari-gui/issues/events{/number}","events_url":"https://api.github.com/repos/sofroniewn/napari-gui/events","assignees_url":"https://api.github.com/repos/sofroniewn/napari-gui/assignees{/user}","branches_url":"https://api.github.com/repos/sofroniewn/napari-gui/branches{/branch}","tags_url":"https://api.github.com/repos/sofroniewn/napari-gui/tags","blobs_url":"https://api.github.com/repos/sofroniewn/napari-gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sofroniewn/napari-gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sofroniewn/napari-gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/sofroniewn/napari-gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sofroniewn/napari-gui/statuses/{sha}","languages_url":"https://api.github.com/repos/sofroniewn/napari-gui/languages","stargazers_url":"https://api.github.com/repos/sofroniewn/napari-gui/stargazers","contributors_url":"https://api.github.com/repos/sofroniewn/napari-gui/contributors","subscribers_url":"https://api.github.com/repos/sofroniewn/napari-gui/subscribers","subscription_url":"https://api.github.com/repos/sofroniewn/napari-gui/subscription","commits_url":"https://api.github.com/repos/sofroniewn/napari-gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/sofroniewn/napari-gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/sofroniewn/napari-gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/sofroniewn/napari-gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/sofroniewn/napari-gui/contents/{+path}","compare_url":"https://api.github.com/repos/sofroniewn/napari-gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sofroniewn/napari-gui/merges","archive_url":"https://api.github.com/repos/sofroniewn/napari-gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sofroniewn/napari-gui/downloads","issues_url":"https://api.github.com/repos/sofroniewn/napari-gui/issues{/number}","pulls_url":"https://api.github.com/repos/sofroniewn/napari-gui/pulls{/number}","milestones_url":"https://api.github.com/repos/sofroniewn/napari-gui/milestones{/number}","notifications_url":"https://api.github.com/repos/sofroniewn/napari-gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sofroniewn/napari-gui/labels{/name}","releases_url":"https://api.github.com/repos/sofroniewn/napari-gui/releases{/id}","deployments_url":"https://api.github.com/repos/sofroniewn/napari-gui/deployments","created_at":"2018-10-25T23:43:01Z","updated_at":"2018-11-03T21:21:11Z","pushed_at":"2018-11-05T04:31:18Z","git_url":"git://github.com/sofroniewn/napari-gui.git","ssh_url":"git@github.com:sofroniewn/napari-gui.git","clone_url":"https://github.com/sofroniewn/napari-gui.git","svn_url":"https://github.com/sofroniewn/napari-gui","homepage":"","size":122,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Napari:master","ref":"master","sha":"1ed7a17696bce5955e1cb3ca7b7532aa0e843b40","user":{"login":"Napari","id":39813916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5ODEzOTE2","avatar_url":"https://avatars3.githubusercontent.com/u/39813916?v=4","gravatar_id":"","url":"https://api.github.com/users/Napari","html_url":"https://github.com/Napari","followers_url":"https://api.github.com/users/Napari/followers","following_url":"https://api.github.com/users/Napari/following{/other_user}","gists_url":"https://api.github.com/users/Napari/gists{/gist_id}","starred_url":"https://api.github.com/users/Napari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Napari/subscriptions","organizations_url":"https://api.github.com/users/Napari/orgs","repos_url":"https://api.github.com/users/Napari/repos","events_url":"https://api.github.com/users/Napari/events{/privacy}","received_events_url":"https://api.github.com/users/Napari/received_events","type":"Organization","site_admin":false},"repo":{"id":144513571,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ1MTM1NzE=","name":"napari-gui","full_name":"Napari/napari-gui","private":false,"owner":{"login":"Napari","id":39813916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5ODEzOTE2","avatar_url":"https://avatars3.githubusercontent.com/u/39813916?v=4","gravatar_id":"","url":"https://api.github.com/users/Napari","html_url":"https://github.com/Napari","followers_url":"https://api.github.com/users/Napari/followers","following_url":"https://api.github.com/users/Napari/following{/other_user}","gists_url":"https://api.github.com/users/Napari/gists{/gist_id}","starred_url":"https://api.github.com/users/Napari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Napari/subscriptions","organizations_url":"https://api.github.com/users/Napari/orgs","repos_url":"https://api.github.com/users/Napari/repos","events_url":"https://api.github.com/users/Napari/events{/privacy}","received_events_url":"https://api.github.com/users/Napari/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Napari/napari-gui","description":"Napari PyQt5 and VisPy based GUI plugin","fork":false,"url":"https://api.github.com/repos/Napari/napari-gui","forks_url":"https://api.github.com/repos/Napari/napari-gui/forks","keys_url":"https://api.github.com/repos/Napari/napari-gui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Napari/napari-gui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Napari/napari-gui/teams","hooks_url":"https://api.github.com/repos/Napari/napari-gui/hooks","issue_events_url":"https://api.github.com/repos/Napari/napari-gui/issues/events{/number}","events_url":"https://api.github.com/repos/Napari/napari-gui/events","assignees_url":"https://api.github.com/repos/Napari/napari-gui/assignees{/user}","branches_url":"https://api.github.com/repos/Napari/napari-gui/branches{/branch}","tags_url":"https://api.github.com/repos/Napari/napari-gui/tags","blobs_url":"https://api.github.com/repos/Napari/napari-gui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Napari/napari-gui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Napari/napari-gui/git/refs{/sha}","trees_url":"https://api.github.com/repos/Napari/napari-gui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Napari/napari-gui/statuses/{sha}","languages_url":"https://api.github.com/repos/Napari/napari-gui/languages","stargazers_url":"https://api.github.com/repos/Napari/napari-gui/stargazers","contributors_url":"https://api.github.com/repos/Napari/napari-gui/contributors","subscribers_url":"https://api.github.com/repos/Napari/napari-gui/subscribers","subscription_url":"https://api.github.com/repos/Napari/napari-gui/subscription","commits_url":"https://api.github.com/repos/Napari/napari-gui/commits{/sha}","git_commits_url":"https://api.github.com/repos/Napari/napari-gui/git/commits{/sha}","comments_url":"https://api.github.com/repos/Napari/napari-gui/comments{/number}","issue_comment_url":"https://api.github.com/repos/Napari/napari-gui/issues/comments{/number}","contents_url":"https://api.github.com/repos/Napari/napari-gui/contents/{+path}","compare_url":"https://api.github.com/repos/Napari/napari-gui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Napari/napari-gui/merges","archive_url":"https://api.github.com/repos/Napari/napari-gui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Napari/napari-gui/downloads","issues_url":"https://api.github.com/repos/Napari/napari-gui/issues{/number}","pulls_url":"https://api.github.com/repos/Napari/napari-gui/pulls{/number}","milestones_url":"https://api.github.com/repos/Napari/napari-gui/milestones{/number}","notifications_url":"https://api.github.com/repos/Napari/napari-gui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Napari/napari-gui/labels{/name}","releases_url":"https://api.github.com/repos/Napari/napari-gui/releases{/id}","deployments_url":"https://api.github.com/repos/Napari/napari-gui/deployments","created_at":"2018-08-13T01:12:28Z","updated_at":"2018-11-02T23:58:35Z","pushed_at":"2018-11-05T04:34:58Z","git_url":"git://github.com/Napari/napari-gui.git","ssh_url":"git@github.com:Napari/napari-gui.git","clone_url":"https://github.com/Napari/napari-gui.git","svn_url":"https://github.com/Napari/napari-gui","homepage":"","size":130,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":5,"open_issues":19,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/41"},"html":{"href":"https://github.com/Napari/napari-gui/pull/41"},"issue":{"href":"https://api.github.com/repos/Napari/napari-gui/issues/41"},"comments":{"href":"https://api.github.com/repos/Napari/napari-gui/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Napari/napari-gui/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/Napari/napari-gui/statuses/c378ed9b143b05bddd036f1124c40cf5d3978398"}},"author_association":"NONE"}}
{"actor":{"display_login":"kne42"}}