Qt – Problem in displaying sequence of DICOM images using QT

dicomimageopenglqtsequence

i'm working in Linux [GCC Compiler] ,
i'm using Eclipse with CDT + QT to compile
I need to display sequence of DICOM images using QT window and OpenGL functions
pls let me know which is the function to display sequence of images
i'm using 3 functions
1) initiallizeGL() to initallize OpenGL functions.
2) resizeGL() instead of glutInitWindowSize() in Glut.
3) paintGL() instead of glutDisplayFunc() in Glut.
4) updateGL() instead of glutPostRedisplay() in Glut.

also pls let me know which are the Glut equivalent functions in QT
glutMainLoop();
glutSwapBuffers();
glutInitDisplayMode();
glutIdleFunc(idle);
glutInit(&argc, argv);

Best Answer

You should be able to easily display images by simply using QGLWidget as your painting device which - depending on your specific usecase - might simplify your implementation. This will draw the image using the OpenGL paint engine in Qt. Something like the following should allow you to display an image;

class CustomWidget : public QGLWidget
{ 
public:
    CustomWidget(QWidget* parent=0) : QGLWidget(parent), pix("foo.jpg")
    {

    }

protected:
    void paintEvent(QPaintEvent *pe)
    {
        QPainter p(this);
        // maybe update the pixmap
        p.drawPixmap(this->rect(),pix);
    }

private:
    QPixmap pix;
};

If you need to put it in a 3D scene, you probably need to load the image as a texture. Some of the Qt OpenGL demos should be able to give you a starting point, e.g. the 'Boxes' demo;

http://doc.trolltech.com/4.6-snapshot/demos-boxes.html