[Insight-users] How to transform ITK image reader to Qt image type?

jiang jiang at TI . Uni-Trier . DE
Fri, 15 Aug 2003 15:24:02 +0200


Hi,
I want to use Qt to produce UI. If I use Qt to load one image, I will do:
image.load(filename, 0); //QImage image
pm.convertFromImage(image, PreferDither); //QPixmap	pm;
painter.drawPixmap(0,0,  pm,0,0,-1,-1); //QPainter painter(this);

Now I use Qt to load image:
typedef unsigned short                    PixelType;
typedef itk::Image<PixelType, 2>          ImageType;
typedef itk::ImageFileReader<ImageType>   ReaderType;
reader=ReaderType::New();
reader->SetFileName( filename );
reader->Update();

My question is how can I transform from ITK ImageType to Qt QImage or
QPixmap.
Thanks a lot.


Chunyan