Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Add convenience function Event.encoded_dataset() #888

Merged
merged 10 commits into from
Nov 17, 2023
Prev Previous commit
Next Next commit
Use encoded_dataset() in apps
  • Loading branch information
scaramallion committed Nov 17, 2023
commit 54eabd3556a0cec80a568f4a1c23126f9562a28c
6 changes: 1 addition & 5 deletions pynetdicom/apps/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from pydicom import dcmread
from pydicom.datadict import tag_for_keyword, repeater_has_keyword, get_entry
from pydicom.dataset import Dataset
from pydicom.filewriter import write_file_meta_info
from pydicom.tag import Tag
from pydicom.uid import DeflatedExplicitVRLittleEndian

Expand Down Expand Up @@ -629,10 +628,7 @@ def handle_store(event, args, app_logger):
if event.context.transfer_syntax == DeflatedExplicitVRLittleEndian:
# Workaround for pydicom issue #1086
with open(filename, "wb") as f:
f.write(b"\x00" * 128)
f.write(b"DICM")
write_file_meta_info(f, event.file_meta)
f.write(encode(ds, False, True, True))
f.write(event.encoded_dataset()
else:
# We use `write_like_original=False` to ensure that a compliant
# File Meta Information Header is written
Expand Down
Loading