Replies: 2 comments 2 replies
-
pydicom doesn't natively support compression (except for RLE Lossless, which as you've seen isn't a very good compressor). You need to use third party libraries to perform the actual compression, then you can use pydicom to add the compressed data to your datasets. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@YaroslavPavlovich could you provide more details, please? Initial transfer syntax would be a good start, as well as what transfer syntax you would like to recompress to. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm working on dicom video PixelData, and want to save it back to disk.
The thing is, while reading the data, I decompress it. Is there an easy way to compress it back before saving it to disk ? Because the new file is 25x bigger than the original file, for now.
I've tried to compress it back with
dcm.compress
but it raisesValueError: The Transfer Syntax UID element in 'FileDataset.file_meta' is compressed but the pixel data has been decompressed
on save.I've also tried to use PIL:
To file size still goes from 4MB to 80MB tho, and is not valid anymore:
ValueError: The amount of decoded RLE segment data doesn't match the expected amount (321207 vs. 480000 bytes)
.I tried
which worked, but I'm still going from 4MB to 107MB.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions