You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pydicom dataset decompress() doesn't update the length of the pixel data automatically. It only gets updated while the dataset is saved to a file. I also tried deepcopy() of the dataset, but that too doesn't work. So have to dump the decompressed dataset on to the disk and reload.
Expected behavior
Length of the pixel data should get updated as part of the dataset decompress()
Steps To Reproduce
Read and note pixel data length of a dicom file that has compressed pixel data.
Run dataset.decompress()
Again read and note the pixel data length and notice that the length has not changed.
Weirdly, I don't think it's ever worked the way it claims to in the docstring, it only decompresses to the Dataset.pixel_array property, not the dataset's Pixel Data value (even though it changes the transfer syntax). It'll get fixed in the next release.
You should just be able to do ds.PixelData = ds.pixel_array.tobytes() instead of saving/reloading
Describe the bug
Pydicom dataset decompress() doesn't update the length of the pixel data automatically. It only gets updated while the dataset is saved to a file. I also tried deepcopy() of the dataset, but that too doesn't work. So have to dump the decompressed dataset on to the disk and reload.
Expected behavior
Length of the pixel data should get updated as part of the dataset decompress()
Steps To Reproduce
Your environment
The text was updated successfully, but these errors were encountered: