Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a generator to get bytes of
pydicom.Dataset
s (#78)
in `store_instances` of `DICOMwebClient`. The `store_instances` method accepts a set of DICOM frames, dumps them to bytes, and, finally, encodes them into a multipart/related request. The above process results in storing the original DICOM frames in memory 3 times: 1. as the original `pydicom.Dataset` instances passed into `store_instances` 2. as bytes encoded in `store_instances` 3. as the concatenation of the above bytes created in `_encode_multipart_message` Using a generator in `store_instances` reduces memory footprint by 1/3, since the original `pydicom.Dataset`s are dumped into bytes one by one while the multipart request body is being created by `_encode_multipart_message`.
- Loading branch information