Search code examples
c++qtdicomitkgdcm

Draw dicom raw data in qt


I'm trying to develop a tool to visualize dicom images I'm using itk library but i have some problem drawing the data I'm using gdcm library provided by itk library as a third party lib.

I'm reading the image correctly i retrieved the tags ... but when i retrieve the pixels data using

unsigned short buffer* = ImageFileReader<Image<unsigned short,2>>->GetOutput()->getBufferPointer();

and i put it in QPixmap or QImage i tried both,Qpixelmap when i do loadData i get false as a return value and using QImage, the app crashes !

Any help ? thank you


Solution

  • Look at this example, http://gdcm.sourceforge.net/html/ConvertToQImage_8cxx-example.html

    Just use gdcm to read the image and convert it to qimage.

    Keep in mind that dicom images are not an image format that qt can draw, you need a conversion step.