{"action":"created","comment":{"url":"https://api.github.com/repos/pydicom/pydicom/pulls/comments/183235843","pull_request_review_id":114200401,"id":183235843,"diff_hunk":"@@ -599,6 +607,27 @@ def get_item(self, key):\n             return self[key]\n         return data_elem\n \n+    def _dataset_slice(self, slice):\n+        \"\"\"Return a slice that has the same properties as the original\n+        dataset.\n+        \"\"\"\n+        tags = self._slice_dataset(slice.start, slice.stop, slice.step)\n+        dataset = Dataset({tag: self.get_item(tag) for tag in tags})\n+        dataset.read_implicit_vr = self.read_implicit_vr\n+        dataset.read_little_endian = self.read_little_endian\n+        dataset.is_little_endian = self.is_little_endian\n+        dataset.is_implicit_VR = self.is_implicit_VR\n+        return dataset\n+\n+    def write_like_original(self):\n+        \"\"\"Return True if the properties to be used for writing are set and\n+        have the same value as the ones in the dataset after reading it.\n+        \"\"\"\n+        return (self.is_implicit_VR is not None and\n+                self.is_little_endian is not None and\n+                self.read_implicit_vr == self.is_implicit_VR and\n+                self.read_little_endian == self.is_little_endian)\n+","path":"pydicom/dataset.py","position":64,"original_position":64,"commit_id":"8b7c163519581ef348068ae9ca2ffcda61d588ce","original_commit_id":"8b7c163519581ef348068ae9ca2ffcda61d588ce","user":{"login":"mrbean-bremen","id":4623701,"avatar_url":"https://avatars1.githubusercontent.com/u/4623701?v=4","gravatar_id":"","url":"https://api.github.com/users/mrbean-bremen","html_url":"https://github.com/mrbean-bremen","followers_url":"https://api.github.com/users/mrbean-bremen/followers","following_url":"https://api.github.com/users/mrbean-bremen/following{/other_user}","gists_url":"https://api.github.com/users/mrbean-bremen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrbean-bremen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrbean-bremen/subscriptions","organizations_url":"https://api.github.com/users/mrbean-bremen/orgs","repos_url":"https://api.github.com/users/mrbean-bremen/repos","events_url":"https://api.github.com/users/mrbean-bremen/events{/privacy}","received_events_url":"https://api.github.com/users/mrbean-bremen/received_events","type":"User","site_admin":false},"body":"Good point! I haven't thought about this.","created_at":"2018-04-22T12:57:17Z","updated_at":"2018-04-22T12:57:17Z","html_url":"https://github.com/pydicom/pydicom/pull/616#discussion_r183235843","pull_request_url":"https://api.github.com/repos/pydicom/pydicom/pulls/616","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/comments/183235843"},"html":{"href":"https://github.com/pydicom/pydicom/pull/616#discussion_r183235843"},"pull_request":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/616"}},"in_reply_to_id":183223230},"pull_request":{"url":"https://api.github.com/repos/pydicom/pydicom/pulls/616","id":180681824,"html_url":"https://github.com/pydicom/pydicom/pull/616","diff_url":"https://github.com/pydicom/pydicom/pull/616.diff","patch_url":"https://github.com/pydicom/pydicom/pull/616.patch","issue_url":"https://api.github.com/repos/pydicom/pydicom/issues/616","number":616,"state":"open","locked":false,"title":"[MRG] Use raw data elements for writing if possible","user":{"login":"mrbean-bremen","id":4623701,"avatar_url":"https://avatars1.githubusercontent.com/u/4623701?v=4","gravatar_id":"","url":"https://api.github.com/users/mrbean-bremen","html_url":"https://github.com/mrbean-bremen","followers_url":"https://api.github.com/users/mrbean-bremen/followers","following_url":"https://api.github.com/users/mrbean-bremen/following{/other_user}","gists_url":"https://api.github.com/users/mrbean-bremen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrbean-bremen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrbean-bremen/subscriptions","organizations_url":"https://api.github.com/users/mrbean-bremen/orgs","repos_url":"https://api.github.com/users/mrbean-bremen/repos","events_url":"https://api.github.com/users/mrbean-bremen/events{/privacy}","received_events_url":"https://api.github.com/users/mrbean-bremen/received_events","type":"User","site_admin":false},"body":"- see #512 \r\n- speeds up writing back the same or slightly changed dataset with the same transfer syntax\r\n- has the most impact for files with many tags\r\n<!--\r\nThanks for contributing a pull request! Please ensure you have taken a look at\r\nthe contribution guidelines: https://github.com/pydicom/pydicom/blob/master/CONTRIBUTING.md#contributing-pull-requests\r\n-->\r\n#### Reference Issue\r\n<!-- Example: Fixes #1234 -->\r\n\r\n\r\n#### What does this implement/fix? Explain your changes.\r\n<!--\r\nPlease summarize the key points of the reference issue, problem or contribution\r\nto facilitate reviewing task. Of course reviewers can always refer to the\r\noriginal issue but facilitating the reviewing process is much appreciated.\r\n-->\r\n\r\n#### Any other comments?\r\n<!--\r\n-->\r\n\r\n<!--\r\nPlease be aware that we are a loose team of volunteers so patience is\r\nnecessary; assistance handling other issues is very welcome. We value\r\nall user contributions, no matter how minor they are. If we are slow to\r\nreview, either the pull request needs some benchmarking, tinkering,\r\nconvincing, etc. or more likely the reviewers are simply busy. In either\r\ncase, we ask for your understanding during the review process.\r\n\r\nThanks for contributing!\r\n-->\r\n","created_at":"2018-04-10T17:57:19Z","updated_at":"2018-04-22T12:57:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5acc95db74d3de10075b546cf1acc570808aa5ae","assignee":null,"assignees":[],"requested_reviewers":[{"login":"scaramallion","id":10226372,"avatar_url":"https://avatars2.githubusercontent.com/u/10226372?v=4","gravatar_id":"","url":"https://api.github.com/users/scaramallion","html_url":"https://github.com/scaramallion","followers_url":"https://api.github.com/users/scaramallion/followers","following_url":"https://api.github.com/users/scaramallion/following{/other_user}","gists_url":"https://api.github.com/users/scaramallion/gists{/gist_id}","starred_url":"https://api.github.com/users/scaramallion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaramallion/subscriptions","organizations_url":"https://api.github.com/users/scaramallion/orgs","repos_url":"https://api.github.com/users/scaramallion/repos","events_url":"https://api.github.com/users/scaramallion/events{/privacy}","received_events_url":"https://api.github.com/users/scaramallion/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pydicom/pydicom/pulls/616/commits","review_comments_url":"https://api.github.com/repos/pydicom/pydicom/pulls/616/comments","review_comment_url":"https://api.github.com/repos/pydicom/pydicom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydicom/pydicom/issues/616/comments","statuses_url":"https://api.github.com/repos/pydicom/pydicom/statuses/8b7c163519581ef348068ae9ca2ffcda61d588ce","head":{"label":"mrbean-bremen:fast-write","ref":"fast-write","sha":"8b7c163519581ef348068ae9ca2ffcda61d588ce","user":{"login":"mrbean-bremen","id":4623701,"avatar_url":"https://avatars1.githubusercontent.com/u/4623701?v=4","gravatar_id":"","url":"https://api.github.com/users/mrbean-bremen","html_url":"https://github.com/mrbean-bremen","followers_url":"https://api.github.com/users/mrbean-bremen/followers","following_url":"https://api.github.com/users/mrbean-bremen/following{/other_user}","gists_url":"https://api.github.com/users/mrbean-bremen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrbean-bremen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrbean-bremen/subscriptions","organizations_url":"https://api.github.com/users/mrbean-bremen/orgs","repos_url":"https://api.github.com/users/mrbean-bremen/repos","events_url":"https://api.github.com/users/mrbean-bremen/events{/privacy}","received_events_url":"https://api.github.com/users/mrbean-bremen/received_events","type":"User","site_admin":false},"repo":{"id":65673081,"name":"pydicom","full_name":"mrbean-bremen/pydicom","owner":{"login":"mrbean-bremen","id":4623701,"avatar_url":"https://avatars1.githubusercontent.com/u/4623701?v=4","gravatar_id":"","url":"https://api.github.com/users/mrbean-bremen","html_url":"https://github.com/mrbean-bremen","followers_url":"https://api.github.com/users/mrbean-bremen/followers","following_url":"https://api.github.com/users/mrbean-bremen/following{/other_user}","gists_url":"https://api.github.com/users/mrbean-bremen/gists{/gist_id}","starred_url":"https://api.github.com/users/mrbean-bremen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrbean-bremen/subscriptions","organizations_url":"https://api.github.com/users/mrbean-bremen/orgs","repos_url":"https://api.github.com/users/mrbean-bremen/repos","events_url":"https://api.github.com/users/mrbean-bremen/events{/privacy}","received_events_url":"https://api.github.com/users/mrbean-bremen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrbean-bremen/pydicom","description":"Read, modify and write DICOM files with python code","fork":true,"url":"https://api.github.com/repos/mrbean-bremen/pydicom","forks_url":"https://api.github.com/repos/mrbean-bremen/pydicom/forks","keys_url":"https://api.github.com/repos/mrbean-bremen/pydicom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrbean-bremen/pydicom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrbean-bremen/pydicom/teams","hooks_url":"https://api.github.com/repos/mrbean-bremen/pydicom/hooks","issue_events_url":"https://api.github.com/repos/mrbean-bremen/pydicom/issues/events{/number}","events_url":"https://api.github.com/repos/mrbean-bremen/pydicom/events","assignees_url":"https://api.github.com/repos/mrbean-bremen/pydicom/assignees{/user}","branches_url":"https://api.github.com/repos/mrbean-bremen/pydicom/branches{/branch}","tags_url":"https://api.github.com/repos/mrbean-bremen/pydicom/tags","blobs_url":"https://api.github.com/repos/mrbean-bremen/pydicom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrbean-bremen/pydicom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrbean-bremen/pydicom/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrbean-bremen/pydicom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrbean-bremen/pydicom/statuses/{sha}","languages_url":"https://api.github.com/repos/mrbean-bremen/pydicom/languages","stargazers_url":"https://api.github.com/repos/mrbean-bremen/pydicom/stargazers","contributors_url":"https://api.github.com/repos/mrbean-bremen/pydicom/contributors","subscribers_url":"https://api.github.com/repos/mrbean-bremen/pydicom/subscribers","subscription_url":"https://api.github.com/repos/mrbean-bremen/pydicom/subscription","commits_url":"https://api.github.com/repos/mrbean-bremen/pydicom/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrbean-bremen/pydicom/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrbean-bremen/pydicom/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrbean-bremen/pydicom/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrbean-bremen/pydicom/contents/{+path}","compare_url":"https://api.github.com/repos/mrbean-bremen/pydicom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrbean-bremen/pydicom/merges","archive_url":"https://api.github.com/repos/mrbean-bremen/pydicom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrbean-bremen/pydicom/downloads","issues_url":"https://api.github.com/repos/mrbean-bremen/pydicom/issues{/number}","pulls_url":"https://api.github.com/repos/mrbean-bremen/pydicom/pulls{/number}","milestones_url":"https://api.github.com/repos/mrbean-bremen/pydicom/milestones{/number}","notifications_url":"https://api.github.com/repos/mrbean-bremen/pydicom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrbean-bremen/pydicom/labels{/name}","releases_url":"https://api.github.com/repos/mrbean-bremen/pydicom/releases{/id}","deployments_url":"https://api.github.com/repos/mrbean-bremen/pydicom/deployments","created_at":"2016-08-14T15:31:07Z","updated_at":"2016-08-14T15:31:08Z","pushed_at":"2018-04-21T12:38:31Z","git_url":"git://github.com/mrbean-bremen/pydicom.git","ssh_url":"git@github.com:mrbean-bremen/pydicom.git","clone_url":"https://github.com/mrbean-bremen/pydicom.git","svn_url":"https://github.com/mrbean-bremen/pydicom","homepage":null,"size":14562,"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,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pydicom:master","ref":"master","sha":"5a18dec7f5a02ef448248d9f8716a4e0d6903ee6","user":{"login":"pydicom","id":28906941,"avatar_url":"https://avatars2.githubusercontent.com/u/28906941?v=4","gravatar_id":"","url":"https://api.github.com/users/pydicom","html_url":"https://github.com/pydicom","followers_url":"https://api.github.com/users/pydicom/followers","following_url":"https://api.github.com/users/pydicom/following{/other_user}","gists_url":"https://api.github.com/users/pydicom/gists{/gist_id}","starred_url":"https://api.github.com/users/pydicom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydicom/subscriptions","organizations_url":"https://api.github.com/users/pydicom/orgs","repos_url":"https://api.github.com/users/pydicom/repos","events_url":"https://api.github.com/users/pydicom/events{/privacy}","received_events_url":"https://api.github.com/users/pydicom/received_events","type":"Organization","site_admin":false},"repo":{"id":14006067,"name":"pydicom","full_name":"pydicom/pydicom","owner":{"login":"pydicom","id":28906941,"avatar_url":"https://avatars2.githubusercontent.com/u/28906941?v=4","gravatar_id":"","url":"https://api.github.com/users/pydicom","html_url":"https://github.com/pydicom","followers_url":"https://api.github.com/users/pydicom/followers","following_url":"https://api.github.com/users/pydicom/following{/other_user}","gists_url":"https://api.github.com/users/pydicom/gists{/gist_id}","starred_url":"https://api.github.com/users/pydicom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydicom/subscriptions","organizations_url":"https://api.github.com/users/pydicom/orgs","repos_url":"https://api.github.com/users/pydicom/repos","events_url":"https://api.github.com/users/pydicom/events{/privacy}","received_events_url":"https://api.github.com/users/pydicom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pydicom/pydicom","description":"Read, modify and write DICOM files with python code","fork":false,"url":"https://api.github.com/repos/pydicom/pydicom","forks_url":"https://api.github.com/repos/pydicom/pydicom/forks","keys_url":"https://api.github.com/repos/pydicom/pydicom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydicom/pydicom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydicom/pydicom/teams","hooks_url":"https://api.github.com/repos/pydicom/pydicom/hooks","issue_events_url":"https://api.github.com/repos/pydicom/pydicom/issues/events{/number}","events_url":"https://api.github.com/repos/pydicom/pydicom/events","assignees_url":"https://api.github.com/repos/pydicom/pydicom/assignees{/user}","branches_url":"https://api.github.com/repos/pydicom/pydicom/branches{/branch}","tags_url":"https://api.github.com/repos/pydicom/pydicom/tags","blobs_url":"https://api.github.com/repos/pydicom/pydicom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydicom/pydicom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydicom/pydicom/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydicom/pydicom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydicom/pydicom/statuses/{sha}","languages_url":"https://api.github.com/repos/pydicom/pydicom/languages","stargazers_url":"https://api.github.com/repos/pydicom/pydicom/stargazers","contributors_url":"https://api.github.com/repos/pydicom/pydicom/contributors","subscribers_url":"https://api.github.com/repos/pydicom/pydicom/subscribers","subscription_url":"https://api.github.com/repos/pydicom/pydicom/subscription","commits_url":"https://api.github.com/repos/pydicom/pydicom/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydicom/pydicom/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydicom/pydicom/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydicom/pydicom/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydicom/pydicom/contents/{+path}","compare_url":"https://api.github.com/repos/pydicom/pydicom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydicom/pydicom/merges","archive_url":"https://api.github.com/repos/pydicom/pydicom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydicom/pydicom/downloads","issues_url":"https://api.github.com/repos/pydicom/pydicom/issues{/number}","pulls_url":"https://api.github.com/repos/pydicom/pydicom/pulls{/number}","milestones_url":"https://api.github.com/repos/pydicom/pydicom/milestones{/number}","notifications_url":"https://api.github.com/repos/pydicom/pydicom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydicom/pydicom/labels{/name}","releases_url":"https://api.github.com/repos/pydicom/pydicom/releases{/id}","deployments_url":"https://api.github.com/repos/pydicom/pydicom/deployments","created_at":"2013-10-31T02:58:52Z","updated_at":"2018-04-20T04:03:48Z","pushed_at":"2018-04-21T21:30:14Z","git_url":"git://github.com/pydicom/pydicom.git","ssh_url":"git@github.com:pydicom/pydicom.git","clone_url":"https://github.com/pydicom/pydicom.git","svn_url":"https://github.com/pydicom/pydicom","homepage":null,"size":17764,"stargazers_count":404,"watchers_count":404,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":183,"mirror_url":null,"archived":false,"open_issues_count":57,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":183,"open_issues":57,"watchers":404,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/616"},"html":{"href":"https://github.com/pydicom/pydicom/pull/616"},"issue":{"href":"https://api.github.com/repos/pydicom/pydicom/issues/616"},"comments":{"href":"https://api.github.com/repos/pydicom/pydicom/issues/616/comments"},"review_comments":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/616/comments"},"review_comment":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydicom/pydicom/pulls/616/commits"},"statuses":{"href":"https://api.github.com/repos/pydicom/pydicom/statuses/8b7c163519581ef348068ae9ca2ffcda61d588ce"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mrbean-bremen"}}