{"action":"created","comment":{"url":"https://api.github.com/repos/napari/napari/pulls/comments/314368780","pull_request_review_id":275505181,"id":314368780,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNDM2ODc4MA==","diff_hunk":"@@ -166,46 +174,47 @@ def top_left(self, top_left):\n \n     def _slice_data(self):\n         \"\"\"Determine the slice of image from the indices.\"\"\"\n-        indices = list(self.indices)\n-        top_image = self.data[-1]\n-        top_image_shape = self.level_shapes[-1][:-2]\n-        # TODO: Change dims selection when dims model changes\n-        rescale = self.level_downsamples[-1, :-2]\n-        indices[:-2] = np.round(indices[:-2] / rescale).astype(int)\n-        indices[:-2] = np.clip(\n-            indices[:-2], 0, np.subtract(top_image_shape, 1)\n-        )\n-        self._data_thumbnail = np.asarray(top_image[tuple(indices)])\n-\n-        indices = list(self.indices)\n-        # TODO: Change dims selection when dims model changes\n-        rescale = self.level_downsamples[self.data_level, :-2]\n-        indices[:-2] = np.round(indices[:-2] / rescale).astype(int)\n-        indices[:-2] = np.clip(\n-            indices[:-2],\n-            0,\n-            np.subtract(self.level_shapes[self.data_level][:-2], 1),\n-        )\n-        if np.any(\n-            self.level_shapes[self.data_level][-2:] > self._max_tile_shape\n-        ):\n-            slices = [\n-                slice(\n+        nd = self.dims.not_displayed\n+\n+        if self.multichannel:\n+            order = self.dims.displayed_order + (self.dims.ndisplay,)","path":"napari/layers/pyramid/pyramid.py","position":112,"original_position":109,"commit_id":"3bf90491039c1eebc5b5b84f12a3976a07a7c634","original_commit_id":"a07ecd2878a5f3ffa422614fe1b3e6f44411f1c1","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":"thanks for making an issue #481 ","created_at":"2019-08-15T15:36:20Z","updated_at":"2019-08-15T15:36:20Z","html_url":"https://github.com/napari/napari/pull/451#discussion_r314368780","pull_request_url":"https://api.github.com/repos/napari/napari/pulls/451","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/napari/napari/pulls/comments/314368780"},"html":{"href":"https://github.com/napari/napari/pull/451#discussion_r314368780"},"pull_request":{"href":"https://api.github.com/repos/napari/napari/pulls/451"}},"in_reply_to_id":312888300},"pull_request":{"url":"https://api.github.com/repos/napari/napari/pulls/451","id":302136145,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAyMTM2MTQ1","html_url":"https://github.com/napari/napari/pull/451","diff_url":"https://github.com/napari/napari/pull/451.diff","patch_url":"https://github.com/napari/napari/pull/451.patch","issue_url":"https://api.github.com/repos/napari/napari/issues/451","number":451,"state":"open","locked":false,"title":"Swappable dimensions","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":"# Description\r\nThis PR superseeds #450 by attaching a `Dims` model to each layer and then synchronizing them with a global `Dims` model in the `ViewerModel`. This will result in less duplicate code and a much easier time keeping track of all our dims variables. It will ultimately enable much more complex features like combining 2D and 3D layers, which the vispy scene graph supports - but that is not planned for this PR.\r\n\r\nRight now support has been extended to `Image` and `Labels` layers. It will be quick to add support for `Points`, `Pyramid`, `Volume`, and `Vectors`. This PR will also enable `Volume` to be merged with `Image` in the not too distant future.\r\n\r\nIt will be a little more effort to support `Shapes` but it is probably worth doing before merging as otherwise we'll have only partially implemented functionality.\r\n\r\n## Type of change\r\n<!-- Please delete options that are not relevant. -->\r\n- [x] New feature (non-breaking change which adds functionality)\r\n\r\n# How has this been tested?\r\n<!-- Please describe the tests that you ran to verify your changes. -->\r\n- [x] `examples/swap_dims.py`\r\n\r\n## Final checklist:\r\n- [ ] My PR is the minimum possible 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\r\n","created_at":"2019-07-29T16:04:46Z","updated_at":"2019-08-15T15:36:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cdc11c9dc8e3b5efeecd50394f61982b7781974","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1022379513,"node_id":"MDU6TGFiZWwxMDIyMzc5NTEz","url":"https://api.github.com/repos/napari/napari/labels/feature","name":"feature","color":"a2eeef","default":false}],"milestone":{"url":"https://api.github.com/repos/napari/napari/milestones/2","html_url":"https://github.com/napari/napari/milestone/2","labels_url":"https://api.github.com/repos/napari/napari/milestones/2/labels","id":4298206,"node_id":"MDk6TWlsZXN0b25lNDI5ODIwNg==","number":2,"title":"0.2.0","description":"This milestone marks the addition of new features that will enable a large number of workflows within napari, including support for rapidly switching the displayed dimensions and projection type, support for 3D rendering, and support for multiple linked canvases. The aim is to have these features completed for the Bioimage Informatics Oct 2-4 2019 where napari will be featured in a software demo and talk.","creator":{"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},"open_issues":49,"closed_issues":11,"state":"open","created_at":"2019-05-09T01:17:28Z","updated_at":"2019-08-15T15:28:42Z","due_on":"2019-10-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/napari/napari/pulls/451/commits","review_comments_url":"https://api.github.com/repos/napari/napari/pulls/451/comments","review_comment_url":"https://api.github.com/repos/napari/napari/pulls/comments{/number}","comments_url":"https://api.github.com/repos/napari/napari/issues/451/comments","statuses_url":"https://api.github.com/repos/napari/napari/statuses/3bf90491039c1eebc5b5b84f12a3976a07a7c634","head":{"label":"sofroniewn:layer_dims","ref":"layer_dims","sha":"3bf90491039c1eebc5b5b84f12a3976a07a7c634","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","full_name":"sofroniewn/napari","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","description":"Napari PyQt5 and VisPy based GUI plugin","fork":true,"url":"https://api.github.com/repos/sofroniewn/napari","forks_url":"https://api.github.com/repos/sofroniewn/napari/forks","keys_url":"https://api.github.com/repos/sofroniewn/napari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sofroniewn/napari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sofroniewn/napari/teams","hooks_url":"https://api.github.com/repos/sofroniewn/napari/hooks","issue_events_url":"https://api.github.com/repos/sofroniewn/napari/issues/events{/number}","events_url":"https://api.github.com/repos/sofroniewn/napari/events","assignees_url":"https://api.github.com/repos/sofroniewn/napari/assignees{/user}","branches_url":"https://api.github.com/repos/sofroniewn/napari/branches{/branch}","tags_url":"https://api.github.com/repos/sofroniewn/napari/tags","blobs_url":"https://api.github.com/repos/sofroniewn/napari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sofroniewn/napari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sofroniewn/napari/git/refs{/sha}","trees_url":"https://api.github.com/repos/sofroniewn/napari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sofroniewn/napari/statuses/{sha}","languages_url":"https://api.github.com/repos/sofroniewn/napari/languages","stargazers_url":"https://api.github.com/repos/sofroniewn/napari/stargazers","contributors_url":"https://api.github.com/repos/sofroniewn/napari/contributors","subscribers_url":"https://api.github.com/repos/sofroniewn/napari/subscribers","subscription_url":"https://api.github.com/repos/sofroniewn/napari/subscription","commits_url":"https://api.github.com/repos/sofroniewn/napari/commits{/sha}","git_commits_url":"https://api.github.com/repos/sofroniewn/napari/git/commits{/sha}","comments_url":"https://api.github.com/repos/sofroniewn/napari/comments{/number}","issue_comment_url":"https://api.github.com/repos/sofroniewn/napari/issues/comments{/number}","contents_url":"https://api.github.com/repos/sofroniewn/napari/contents/{+path}","compare_url":"https://api.github.com/repos/sofroniewn/napari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sofroniewn/napari/merges","archive_url":"https://api.github.com/repos/sofroniewn/napari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sofroniewn/napari/downloads","issues_url":"https://api.github.com/repos/sofroniewn/napari/issues{/number}","pulls_url":"https://api.github.com/repos/sofroniewn/napari/pulls{/number}","milestones_url":"https://api.github.com/repos/sofroniewn/napari/milestones{/number}","notifications_url":"https://api.github.com/repos/sofroniewn/napari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sofroniewn/napari/labels{/name}","releases_url":"https://api.github.com/repos/sofroniewn/napari/releases{/id}","deployments_url":"https://api.github.com/repos/sofroniewn/napari/deployments","created_at":"2018-10-25T23:43:01Z","updated_at":"2019-08-07T16:22:38Z","pushed_at":"2019-08-15T00:20:22Z","git_url":"git://github.com/sofroniewn/napari.git","ssh_url":"git@github.com:sofroniewn/napari.git","clone_url":"https://github.com/sofroniewn/napari.git","svn_url":"https://github.com/sofroniewn/napari","homepage":"","size":41672,"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":1,"mirror_url":null,"archived":false,"disabled":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":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"napari:master","ref":"master","sha":"ebc5474a59a89496c99c43129b65e63afa7cc662","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","full_name":"napari/napari","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","description":"napari: a Qt- and VisPy-based ndarray visualization tool","fork":false,"url":"https://api.github.com/repos/napari/napari","forks_url":"https://api.github.com/repos/napari/napari/forks","keys_url":"https://api.github.com/repos/napari/napari/keys{/key_id}","collaborators_url":"https://api.github.com/repos/napari/napari/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/napari/napari/teams","hooks_url":"https://api.github.com/repos/napari/napari/hooks","issue_events_url":"https://api.github.com/repos/napari/napari/issues/events{/number}","events_url":"https://api.github.com/repos/napari/napari/events","assignees_url":"https://api.github.com/repos/napari/napari/assignees{/user}","branches_url":"https://api.github.com/repos/napari/napari/branches{/branch}","tags_url":"https://api.github.com/repos/napari/napari/tags","blobs_url":"https://api.github.com/repos/napari/napari/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/napari/napari/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/napari/napari/git/refs{/sha}","trees_url":"https://api.github.com/repos/napari/napari/git/trees{/sha}","statuses_url":"https://api.github.com/repos/napari/napari/statuses/{sha}","languages_url":"https://api.github.com/repos/napari/napari/languages","stargazers_url":"https://api.github.com/repos/napari/napari/stargazers","contributors_url":"https://api.github.com/repos/napari/napari/contributors","subscribers_url":"https://api.github.com/repos/napari/napari/subscribers","subscription_url":"https://api.github.com/repos/napari/napari/subscription","commits_url":"https://api.github.com/repos/napari/napari/commits{/sha}","git_commits_url":"https://api.github.com/repos/napari/napari/git/commits{/sha}","comments_url":"https://api.github.com/repos/napari/napari/comments{/number}","issue_comment_url":"https://api.github.com/repos/napari/napari/issues/comments{/number}","contents_url":"https://api.github.com/repos/napari/napari/contents/{+path}","compare_url":"https://api.github.com/repos/napari/napari/compare/{base}...{head}","merges_url":"https://api.github.com/repos/napari/napari/merges","archive_url":"https://api.github.com/repos/napari/napari/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/napari/napari/downloads","issues_url":"https://api.github.com/repos/napari/napari/issues{/number}","pulls_url":"https://api.github.com/repos/napari/napari/pulls{/number}","milestones_url":"https://api.github.com/repos/napari/napari/milestones{/number}","notifications_url":"https://api.github.com/repos/napari/napari/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/napari/napari/labels{/name}","releases_url":"https://api.github.com/repos/napari/napari/releases{/id}","deployments_url":"https://api.github.com/repos/napari/napari/deployments","created_at":"2018-08-13T01:12:28Z","updated_at":"2019-08-13T00:28:12Z","pushed_at":"2019-08-15T00:20:24Z","git_url":"git://github.com/napari/napari.git","ssh_url":"git@github.com:napari/napari.git","clone_url":"https://github.com/napari/napari.git","svn_url":"https://github.com/napari/napari","homepage":"","size":14604,"stargazers_count":78,"watchers_count":78,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":95,"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":30,"open_issues":95,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/napari/napari/pulls/451"},"html":{"href":"https://github.com/napari/napari/pull/451"},"issue":{"href":"https://api.github.com/repos/napari/napari/issues/451"},"comments":{"href":"https://api.github.com/repos/napari/napari/issues/451/comments"},"review_comments":{"href":"https://api.github.com/repos/napari/napari/pulls/451/comments"},"review_comment":{"href":"https://api.github.com/repos/napari/napari/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/napari/napari/pulls/451/commits"},"statuses":{"href":"https://api.github.com/repos/napari/napari/statuses/3bf90491039c1eebc5b5b84f12a3976a07a7c634"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sofroniewn"}}