Replies: 1 comment
-
dcm = pydicom.read_file(filename)
dcm.pixel_array[0:1, 0:1] = [[5]]
dcm.PixelData = dcm.pixel_array.tobytes()
dcm.save_as("temp_file.dcm") For compressed transfer syntaxes, the process is more complicated, as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the issue
When I attempt to modify a FileDataset's pixel_array, and then save that FileDataset to a path on my local system, and then execute a
pydicom.read_file
on the new .dcm file, I expect the changes to the previous FileDataset's pixel_array to be present in the FileDataset generated by executingpydicom.read_file
on the new .dcm file, but the changes are not present. Instead, it appears as though a copy of the original state of the FileDataset is copied to the new .dcm file.Here is my env_info:
Steps to reproduce
Beta Was this translation helpful? Give feedback.
All reactions