Get pixels values from a Dicom

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
raven8819
Posts: 3
Joined: Wed, 2011-10-12, 16:51
Location: France

Get pixels values from a Dicom

#1 Post by raven8819 »

Hello,
I would like loading one dicom file to make a simple viewer. I follow an example from the dcmtk documentation to load the file, no problem to do that, but the colors of my pixels are not reading correctly ! Could you please tell me the method "step by step" to extract the pixel data ? Thank

Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

#2 Post by Shaeto »

1. open dicom file by DicomImage class (check class docs dcmtk/dcmimgle/dcmimage.h)
2. check DicomImage object status by if (di->getStatus() != EIS_Normal) { failed to open dicom }
3. use getWidth/getHeight/getDepth/getMinMaxValues/getPhotometricInterpretation/getOutputDataSize/getOutputData methods to get pixels buffer. draw it.

also check dcm2pnm.cc to learn how to register decompression codecs if you want to draw compressed images. (look for ::registerCodecs)

thats all

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest