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
Get pixels values from a Dicom
Moderator: Moderator Team
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
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
Who is online
Users browsing this forum: Google [Bot] and 1 guest