How to convert 16 bit dcm file to 8 bit dcm file

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
ramprasad85
Posts: 2
Joined: Fri, 2012-12-28, 11:59

How to convert 16 bit dcm file to 8 bit dcm file

#1 Post by ramprasad85 »

I want to convert 16 bit gray dcm file to 8 bit gray dcm file
I used dcm2pnm.exe to convert the 16 bit pixel data to 8 bit bmp using

Code: Select all

dcm2pnm.exe +ob src_16bit.dcm 8bit.bmp
tried to make a new dcm using the 8bit data and other details from source file

Code: Select all

img2dcm.exe -i BMP --series-from src_16bit.dcm 8bit.bmp 8bit.dcm
but it turns out that the resulting file has 24bit RGB data :roll:

Please help me

As an alternative,
I managed to create an 8bit dcm file using gdcm's gdcmimg.exe.

Code: Select all

dcm2pnm.exe +op src_16bit.dcm 8bit.pgm
gdcmimg.exe 8bit.pgm anon.dcm
But I dont know how to add the patient/study/series information in src_16bit.dcm to anon.dcm

Is there some way to achieve this using dcmtk or any other such tool kit?
Kindly help

Thanks and Regards

J. Riesmeier
DCMTK Developer
Posts: 2517
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: How to convert 16 bit dcm file to 8 bit dcm file

#2 Post by J. Riesmeier »

but it turns out that the resulting file has 24bit RGB data
Yes, but this is consistent with the description in the documentation (man page).
Is there some way to achieve this using dcmtk or any other such tool kit?
Of course it is, but it requires writing a new program ...

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest