AW: [Insight-users] Show a ITK Image data in Qt

jiang jiang at TI . Uni-Trier . DE
Thu, 11 Dec 2003 11:31:04 +0100


Hi Luis,
I solve this "unclear" problem. Because I forget to rescale image data from
signed short to unsigned char. Since the slice view shows the image  as
unsigned char, but the image data is signed short.

Best,

Chunyan

-----Ursprungliche Nachricht-----
Von: Luis Ibanez [mailto:luis . ibanez at kitware . com]
Gesendet: Mittwoch, 10. Dezember 2003 22:25
An: jiang
Cc: ITK
Betreff: Re: [Insight-users] Show a ITK Image data in Qt


Hi Chuyang,


When you say "unclear" do you mean "blurred" (smoothed) ?
or do you mean "dark"  ?

can you post a screenshot of the GUI somewhere in the web ?

Thanks,


   Luis



-----------
jiang wrote:

> Dear ITK users,
> I read a series of DICOM file to build a volume and show three slice view
in
> different direction. I use Qt as user interface. And I adapt the
> ApplicationModel as Luis recommended
>
http://public . kitware . com/pipermail/insight-users/2003-September/005094 . html
> It works fine. Now I want to display one slice of the volume in another
> QFrame. I extract one slice from volume by itk::ExtractImageFilter. And
use
> itk::ImageRegionIterator to access the image and copy data to QImage as
> below:
> 	it(DesiredPiece,DesiredPiece->GetBufferedRegion());
> 	it.GoToBegin();
> 	for (unsigned int i=0;i<Size[0];i++)
> 	{
> 	  for (unsigned int j=0;j<Size[1];j++)
> 	  {
> 		image ->setPixel(j,i,it.Get());
> 		it++;
> 	  }
> 	}
>
> Then show the QImage in the following code:
> Julien gave me some hints about how to do it in
> http://www . itk . org/pipermail/insight-users/2003-August/004568 . html
> 	if(image->isNull())
> 		image->create(size[0],size[1],8,2000 );
>
> 	for (unsigned int i=0;i<256;i++)
> 	{
> 	  QColor* rgb = new QColor(i,i,i);
> 	  image ->setColor(i,rgb->rgb());
> 	}
>
> 	ProcessImage.CopyDesiredPiece(image);//It is the above copy function
> 	bool ok;
> 	ok=	pm.convertFromImage(*image, Qt::PreferDither );
>
> Then use QLabel to show pm:
> label->setPixmap(pm );
>
>
> My problem is: the image which is showed in the QFrame is not same as the
> slice shown in slice view as ApplicationModel does. In the slice view the
> image is very clear. But in the QFrame the same image data, but it is very
> unclear. I consider that it might be the parameters of window width and
> window center of image data. The data type is signed short.
> How can I show the image in the QFrame same as it is shown in the slice
> view?
>
>
> Thank you very much!
>
>
> Chunyan
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>