2

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

1 Answer 1

4

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.