{"action":"created","comment":{"url":"https://api.github.com/repos/planetarypy/pdsview/pulls/comments/38093061","id":38093061,"diff_hunk":"@@ -263,6 +576,369 @@ def display_image(self, next_image=False, previous_image=False):\n \n         self.setWindowTitle(self.image_set.current_image.file_name)\n \n+    def apply_parameters(self, image, view):\n+        \"\"\"Display image with the images parameters\"\"\"\n+        if image.sarr is None:\n+            pass\n+        else:\n+            view.get_rgbmap().set_sarr(image.sarr)\n+        if image.zoom is None:\n+            pass\n+        else:\n+            view.zoom_to(image.zoom)\n+        if image.rotation is None:\n+            pass\n+        else:\n+            view.rotate(image.rotation)\n+        if image.transforms is None:\n+            pass\n+        else:\n+            flip_x = image.transforms[0]\n+            flip_y = image.transforms[1]\n+            switch_xy = image.transforms[2]\n+            view.transform(flip_x, flip_y, switch_xy)\n+        if image.cuts is None:\n+            pass\n+        else:\n+            loval, hival = image.cuts\n+            view.cut_levels(loval, hival, True)\n+\n+    def restore(self):\n+        \"\"\"Restore image to the default settings\"\"\"\n+        self.pds_view.get_rgbmap().reset_sarr()\n+        self.pds_view.enable_autocuts('on')\n+        self.pds_view.auto_levels()\n+        self.pds_view.enable_autocuts('override')\n+        self.pds_view.rotate(0.0)\n+        # The default transform/rotation of the image will be image specific so\n+        # transform bools will change in the future\n+        self.pds_view.transform(False, False, False)\n+        self.pds_view.zoom_fit()\n+\n+    def start_ROI(self, pds_view, button, data_x, data_y):\n+        \"\"\"Ensure only one Region of Interest (ROI) exists at a time\n+\n+        Note\n+        ----\n+        This method is called when the right mouse button is pressed. Even\n+        though the arguments are not used, they are necessary to catch the\n+        right mouse button press event.\n+\n+        Parameters\n+        ----------\n+        pds_view : ImageViewCanvas object\n+            The view that displays the image\n+        button : Qt.RightButton\n+            The right mouse button\n+        data_x : float\n+            The x-value of the location of the right button\n+        data_y : float\n+            The y-value of the location of the right button\n+\n+        \"\"\"\n+\n+        if len(pds_view.objects) > 1:\n+            self.delete_ROI()\n+\n+    def stop_ROI(self, pds_view, button, data_x, data_y):\n+        \"\"\"Create a Region of Interest (ROI)\n+\n+        When drawing stops (release of the right mouse button), the ROI border\n+        snaps to inclusive pixel (see top_right_pixel_snap and\n+        bottom_left_pixel_snap). The ROI's information is set as an attributes\n+        of the current image (see calculate_ROI_info).\n+\n+        Note\n+        ----\n+        This method is called when the right mouse button is released. Even\n+        though only the pds_view argument is used, they are all necessary to\n+        catch the right mouse button release event.\n+\n+        Parameters\n+        ----------\n+        See start_ROI parameters\n+\n+        \"\"\"\n+\n+        # If there are no draw objects, stop\n+        if len(pds_view.objects) == 1:\n+            return","path":"pdsview/pdsview.py","position":523,"original_position":523,"commit_id":"73de31ed4e2888997dcda488a4d612a8f9472e2c","original_commit_id":"73de31ed4e2888997dcda488a4d612a8f9472e2c","user":{"login":"godber","id":1249,"avatar_url":"https://avatars.githubusercontent.com/u/1249?v=3","gravatar_id":"","url":"https://api.github.com/users/godber","html_url":"https://github.com/godber","followers_url":"https://api.github.com/users/godber/followers","following_url":"https://api.github.com/users/godber/following{/other_user}","gists_url":"https://api.github.com/users/godber/gists{/gist_id}","starred_url":"https://api.github.com/users/godber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godber/subscriptions","organizations_url":"https://api.github.com/users/godber/orgs","repos_url":"https://api.github.com/users/godber/repos","events_url":"https://api.github.com/users/godber/events{/privacy}","received_events_url":"https://api.github.com/users/godber/received_events","type":"User","site_admin":false},"body":"Is there some known condition that makes this possible?","created_at":"2015-08-27T13:14:35Z","updated_at":"2015-08-27T13:14:35Z","html_url":"https://github.com/planetarypy/pdsview/pull/26#discussion_r38093061","pull_request_url":"https://api.github.com/repos/planetarypy/pdsview/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/comments/38093061"},"html":{"href":"https://github.com/planetarypy/pdsview/pull/26#discussion_r38093061"},"pull_request":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/planetarypy/pdsview/pulls/26","id":42611522,"html_url":"https://github.com/planetarypy/pdsview/pull/26","diff_url":"https://github.com/planetarypy/pdsview/pull/26.diff","patch_url":"https://github.com/planetarypy/pdsview/pull/26.patch","issue_url":"https://api.github.com/repos/planetarypy/pdsview/issues/26","number":26,"state":"open","locked":false,"title":"Region of interest","user":{"login":"pbvarga1","id":12278722,"avatar_url":"https://avatars.githubusercontent.com/u/12278722?v=3","gravatar_id":"","url":"https://api.github.com/users/pbvarga1","html_url":"https://github.com/pbvarga1","followers_url":"https://api.github.com/users/pbvarga1/followers","following_url":"https://api.github.com/users/pbvarga1/following{/other_user}","gists_url":"https://api.github.com/users/pbvarga1/gists{/gist_id}","starred_url":"https://api.github.com/users/pbvarga1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbvarga1/subscriptions","organizations_url":"https://api.github.com/users/pbvarga1/orgs","repos_url":"https://api.github.com/users/pbvarga1/repos","events_url":"https://api.github.com/users/pbvarga1/events{/privacy}","received_events_url":"https://api.github.com/users/pbvarga1/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-17T17:14:08Z","updated_at":"2015-08-27T13:14:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f21f51754df29eeea6d69ebb4c3aeb6ea8594a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/planetarypy/pdsview/pulls/26/commits","review_comments_url":"https://api.github.com/repos/planetarypy/pdsview/pulls/26/comments","review_comment_url":"https://api.github.com/repos/planetarypy/pdsview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/planetarypy/pdsview/issues/26/comments","statuses_url":"https://api.github.com/repos/planetarypy/pdsview/statuses/73de31ed4e2888997dcda488a4d612a8f9472e2c","head":{"label":"pbvarga1:Region_of_Interest","ref":"Region_of_Interest","sha":"73de31ed4e2888997dcda488a4d612a8f9472e2c","user":{"login":"pbvarga1","id":12278722,"avatar_url":"https://avatars.githubusercontent.com/u/12278722?v=3","gravatar_id":"","url":"https://api.github.com/users/pbvarga1","html_url":"https://github.com/pbvarga1","followers_url":"https://api.github.com/users/pbvarga1/followers","following_url":"https://api.github.com/users/pbvarga1/following{/other_user}","gists_url":"https://api.github.com/users/pbvarga1/gists{/gist_id}","starred_url":"https://api.github.com/users/pbvarga1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbvarga1/subscriptions","organizations_url":"https://api.github.com/users/pbvarga1/orgs","repos_url":"https://api.github.com/users/pbvarga1/repos","events_url":"https://api.github.com/users/pbvarga1/events{/privacy}","received_events_url":"https://api.github.com/users/pbvarga1/received_events","type":"User","site_admin":false},"repo":{"id":39840868,"name":"pdsview","full_name":"pbvarga1/pdsview","owner":{"login":"pbvarga1","id":12278722,"avatar_url":"https://avatars.githubusercontent.com/u/12278722?v=3","gravatar_id":"","url":"https://api.github.com/users/pbvarga1","html_url":"https://github.com/pbvarga1","followers_url":"https://api.github.com/users/pbvarga1/followers","following_url":"https://api.github.com/users/pbvarga1/following{/other_user}","gists_url":"https://api.github.com/users/pbvarga1/gists{/gist_id}","starred_url":"https://api.github.com/users/pbvarga1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbvarga1/subscriptions","organizations_url":"https://api.github.com/users/pbvarga1/orgs","repos_url":"https://api.github.com/users/pbvarga1/repos","events_url":"https://api.github.com/users/pbvarga1/events{/privacy}","received_events_url":"https://api.github.com/users/pbvarga1/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pbvarga1/pdsview","description":"Python PDS Image Viewer","fork":true,"url":"https://api.github.com/repos/pbvarga1/pdsview","forks_url":"https://api.github.com/repos/pbvarga1/pdsview/forks","keys_url":"https://api.github.com/repos/pbvarga1/pdsview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pbvarga1/pdsview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pbvarga1/pdsview/teams","hooks_url":"https://api.github.com/repos/pbvarga1/pdsview/hooks","issue_events_url":"https://api.github.com/repos/pbvarga1/pdsview/issues/events{/number}","events_url":"https://api.github.com/repos/pbvarga1/pdsview/events","assignees_url":"https://api.github.com/repos/pbvarga1/pdsview/assignees{/user}","branches_url":"https://api.github.com/repos/pbvarga1/pdsview/branches{/branch}","tags_url":"https://api.github.com/repos/pbvarga1/pdsview/tags","blobs_url":"https://api.github.com/repos/pbvarga1/pdsview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pbvarga1/pdsview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pbvarga1/pdsview/git/refs{/sha}","trees_url":"https://api.github.com/repos/pbvarga1/pdsview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pbvarga1/pdsview/statuses/{sha}","languages_url":"https://api.github.com/repos/pbvarga1/pdsview/languages","stargazers_url":"https://api.github.com/repos/pbvarga1/pdsview/stargazers","contributors_url":"https://api.github.com/repos/pbvarga1/pdsview/contributors","subscribers_url":"https://api.github.com/repos/pbvarga1/pdsview/subscribers","subscription_url":"https://api.github.com/repos/pbvarga1/pdsview/subscription","commits_url":"https://api.github.com/repos/pbvarga1/pdsview/commits{/sha}","git_commits_url":"https://api.github.com/repos/pbvarga1/pdsview/git/commits{/sha}","comments_url":"https://api.github.com/repos/pbvarga1/pdsview/comments{/number}","issue_comment_url":"https://api.github.com/repos/pbvarga1/pdsview/issues/comments{/number}","contents_url":"https://api.github.com/repos/pbvarga1/pdsview/contents/{+path}","compare_url":"https://api.github.com/repos/pbvarga1/pdsview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pbvarga1/pdsview/merges","archive_url":"https://api.github.com/repos/pbvarga1/pdsview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pbvarga1/pdsview/downloads","issues_url":"https://api.github.com/repos/pbvarga1/pdsview/issues{/number}","pulls_url":"https://api.github.com/repos/pbvarga1/pdsview/pulls{/number}","milestones_url":"https://api.github.com/repos/pbvarga1/pdsview/milestones{/number}","notifications_url":"https://api.github.com/repos/pbvarga1/pdsview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pbvarga1/pdsview/labels{/name}","releases_url":"https://api.github.com/repos/pbvarga1/pdsview/releases{/id}","created_at":"2015-07-28T15:06:50Z","updated_at":"2015-07-28T15:06:50Z","pushed_at":"2015-08-17T16:36:24Z","git_url":"git://github.com/pbvarga1/pdsview.git","ssh_url":"git@github.com:pbvarga1/pdsview.git","clone_url":"https://github.com/pbvarga1/pdsview.git","svn_url":"https://github.com/pbvarga1/pdsview","homepage":null,"size":203,"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":"planetarypy:master","ref":"master","sha":"6d557d643f7b7b6fccf77b122ebba6199d98e5c8","user":{"login":"planetarypy","id":11862120,"avatar_url":"https://avatars.githubusercontent.com/u/11862120?v=3","gravatar_id":"","url":"https://api.github.com/users/planetarypy","html_url":"https://github.com/planetarypy","followers_url":"https://api.github.com/users/planetarypy/followers","following_url":"https://api.github.com/users/planetarypy/following{/other_user}","gists_url":"https://api.github.com/users/planetarypy/gists{/gist_id}","starred_url":"https://api.github.com/users/planetarypy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetarypy/subscriptions","organizations_url":"https://api.github.com/users/planetarypy/orgs","repos_url":"https://api.github.com/users/planetarypy/repos","events_url":"https://api.github.com/users/planetarypy/events{/privacy}","received_events_url":"https://api.github.com/users/planetarypy/received_events","type":"Organization","site_admin":false},"repo":{"id":33638072,"name":"pdsview","full_name":"planetarypy/pdsview","owner":{"login":"planetarypy","id":11862120,"avatar_url":"https://avatars.githubusercontent.com/u/11862120?v=3","gravatar_id":"","url":"https://api.github.com/users/planetarypy","html_url":"https://github.com/planetarypy","followers_url":"https://api.github.com/users/planetarypy/followers","following_url":"https://api.github.com/users/planetarypy/following{/other_user}","gists_url":"https://api.github.com/users/planetarypy/gists{/gist_id}","starred_url":"https://api.github.com/users/planetarypy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/planetarypy/subscriptions","organizations_url":"https://api.github.com/users/planetarypy/orgs","repos_url":"https://api.github.com/users/planetarypy/repos","events_url":"https://api.github.com/users/planetarypy/events{/privacy}","received_events_url":"https://api.github.com/users/planetarypy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/planetarypy/pdsview","description":"Python PDS Image Viewer","fork":false,"url":"https://api.github.com/repos/planetarypy/pdsview","forks_url":"https://api.github.com/repos/planetarypy/pdsview/forks","keys_url":"https://api.github.com/repos/planetarypy/pdsview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/planetarypy/pdsview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/planetarypy/pdsview/teams","hooks_url":"https://api.github.com/repos/planetarypy/pdsview/hooks","issue_events_url":"https://api.github.com/repos/planetarypy/pdsview/issues/events{/number}","events_url":"https://api.github.com/repos/planetarypy/pdsview/events","assignees_url":"https://api.github.com/repos/planetarypy/pdsview/assignees{/user}","branches_url":"https://api.github.com/repos/planetarypy/pdsview/branches{/branch}","tags_url":"https://api.github.com/repos/planetarypy/pdsview/tags","blobs_url":"https://api.github.com/repos/planetarypy/pdsview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/planetarypy/pdsview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/planetarypy/pdsview/git/refs{/sha}","trees_url":"https://api.github.com/repos/planetarypy/pdsview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/planetarypy/pdsview/statuses/{sha}","languages_url":"https://api.github.com/repos/planetarypy/pdsview/languages","stargazers_url":"https://api.github.com/repos/planetarypy/pdsview/stargazers","contributors_url":"https://api.github.com/repos/planetarypy/pdsview/contributors","subscribers_url":"https://api.github.com/repos/planetarypy/pdsview/subscribers","subscription_url":"https://api.github.com/repos/planetarypy/pdsview/subscription","commits_url":"https://api.github.com/repos/planetarypy/pdsview/commits{/sha}","git_commits_url":"https://api.github.com/repos/planetarypy/pdsview/git/commits{/sha}","comments_url":"https://api.github.com/repos/planetarypy/pdsview/comments{/number}","issue_comment_url":"https://api.github.com/repos/planetarypy/pdsview/issues/comments{/number}","contents_url":"https://api.github.com/repos/planetarypy/pdsview/contents/{+path}","compare_url":"https://api.github.com/repos/planetarypy/pdsview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/planetarypy/pdsview/merges","archive_url":"https://api.github.com/repos/planetarypy/pdsview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/planetarypy/pdsview/downloads","issues_url":"https://api.github.com/repos/planetarypy/pdsview/issues{/number}","pulls_url":"https://api.github.com/repos/planetarypy/pdsview/pulls{/number}","milestones_url":"https://api.github.com/repos/planetarypy/pdsview/milestones{/number}","notifications_url":"https://api.github.com/repos/planetarypy/pdsview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/planetarypy/pdsview/labels{/name}","releases_url":"https://api.github.com/repos/planetarypy/pdsview/releases{/id}","created_at":"2015-04-08T23:38:09Z","updated_at":"2015-06-08T01:21:45Z","pushed_at":"2015-08-26T12:53:46Z","git_url":"git://github.com/planetarypy/pdsview.git","ssh_url":"git@github.com:planetarypy/pdsview.git","clone_url":"https://github.com/planetarypy/pdsview.git","svn_url":"https://github.com/planetarypy/pdsview","homepage":null,"size":404,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":7,"forks":3,"open_issues":7,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/26"},"html":{"href":"https://github.com/planetarypy/pdsview/pull/26"},"issue":{"href":"https://api.github.com/repos/planetarypy/pdsview/issues/26"},"comments":{"href":"https://api.github.com/repos/planetarypy/pdsview/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/planetarypy/pdsview/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/planetarypy/pdsview/statuses/73de31ed4e2888997dcda488a4d612a8f9472e2c"}}}}