File Size

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

File Size

#1 Post by George »

Hello,

I am noticing a diffrence when I re-create some dicom files by splitting to images and back, I tried to modified the transfer syntax but it is lossless and modifying it did not change anything

Code: Select all

george_z@dckr-build:~/dicom$ dcmdump cre_img.dcm | grep 0002,0010
(0002,0010) UI =LittleEndianImplicit                    #  18, 1 TransferSyntaxUID
george_z@dckr-build:~/dicom$ dcmconv +te cre_img.dcm converted_cre_img.dcm
george_z@dckr-build:~/dicom$ dcmdump converted_cre_img.dcm | grep 0002,0010
(0002,0010) UI =LittleEndianExplicit                    #  20, 1 TransferSyntaxUID
george_z@dckr-build:~/dicom$ ll -h converted_cre_img.dcm
-rw-rw-r-- 1 george_z george_z 8.2M Dec 18 11:14 converted_cre_img.dcm
george_z@dckr-build:~/dicom$ ll -h out.dcm
-rw-rw-r-- 1 george_z george_z 2.8M Dec  1 19:40 out.dcm
george_z@dckr-build:~/dicom$ ll -h cre_img.dcm
-rw-rw-r-- 1 george_z george_z 8.2M Dec 17 08:49 cre_img.dcm
Do you have any idea how to resolve this issue?

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: File Size

#2 Post by Michael Onken »

Hi George,

Code: Select all

george_z@dckr-build:~/dicom$ ll -h converted_cre_img.dcm
-rw-rw-r-- 1 george_z george_z 8.2M Dec 18 11:14 converted_cre_img.dcm

george_z@dckr-build:~/dicom$ ll -h cre_img.dcm
-rw-rw-r-- 1 george_z george_z 8.2M Dec 17 08:49 cre_img.dcm
This makes sense to me. What are you expecting to see instead?

Is out.dcm relevant for the question?

Code: Select all

george_z@dckr-build:~/dicom$ ll -h out.dcm
-rw-rw-r-- 1 george_z george_z 2.8M Dec  1 19:40 out.dcm
If so, how was it produced?

Best regards,
Michael

George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

Re: File Size

#3 Post by George »

Hello,

out.dcm is the original file, in which I used to extract .bmp frames from and then I used those *.bmp files to create the new file, this new file is allot bigger
and I am trying to reduce the file size. back to original, any ideas how?

Best Regards
George

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: File Size

#4 Post by Michael Onken »

I think BMP supports some compression extensions, maybe your BMP file(s) have been compressed.

There is no way to make the pixel data in DICOM smaller than what you have using uncompressed transfer syntaxes.

You can try ZIP compression (dcmconv +td <input> <output>), or RLE compression (dcmcrle <input> <output>), or JPEG Lossless (dcmcjpeg <input> <output>) to name the most prominent lossless compression schemes.

Best,
Michael

George
Posts: 52
Joined: Sun, 2023-11-12, 16:50

Re: File Size

#5 Post by George »

Hello,

I was wondering if you can also point to a dcmtk function that create a dicom based on png/bmp files and also when using diffrent files with diffrent file sizes
then the generated dicom size is different

Best Regards
George

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: File Size

#6 Post by Michael Onken »

The img2dcm tool can create DICOM files from BMP images. The source code demonstrates how to use the library for that.

Best,
Michael

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Baidu [Spider] and 1 guest