[Insight-users] [vtkusers] Programming challenges with QT, VTK, and ITK

Xiaopeng Yang yxp233 at postech.ac.kr
Fri Dec 17 07:13:04 EST 2010


Hello Park,

 

It has been a very long time since I received your help. These days I am still working on this problem. Now I can get the VTK coordinate (i.e., world coordinate). You mentioned that if I use itk ImageToVTKImageFilter, I can directly use the VTK coordinate as ITK coordinate. However, I could not understand clearly. In my program, I need ITK coordinate for applying ITK region growing algorithm. I do not know how to translate VTK coordinate to ITK coordinate. Could you please explain more in detail?

 

Thanks very much!

 

Xiaopeng

 

发件人: (Samuel) Byeongjun Park [mailto:byeongjun.park at case.edu] 
发送时间: 2010년 10월 27일 수요일 오후 10:41
收件人: 'Xiaopeng Yang'
抄送: 'vtk'
主题: RE: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Hi,

 

My name is Sam Park. Since you told you are using QT, I think you are using QVTKWidget.

You can make your own QVTK widget class inheriting QVTKWidget.

In there, override 

   Virtual void mousePressEvent(QMouseEvent *pevent);

You can read the mouse position in QVTKWidget window.

Then,

1.       Get the QT coordinate point (x,y)

2.       Flip y value by  y=height-y;

3.       Get the pointer of the Render in your QVTKWidget object.

4.       double wpoint[4];

5.       Render->SetDisplayPoint(x,y,0);

6.       Render->DisplayToWorld(); 

7.       Render->GetWorldPoint(wpoint);

 

Now You have the VTK coordinate of the point you clicked.

If you imported CT image in ITK and utilized itk::ImageToVTKImageFilter, 

you can directly use the VTK coordinate as ITK coordinate.

 

Good luck.

 

Sam.

-------------- Innovation for the Future Radiation Oncology 

(Samuel) Byeongjun Park, Ph.D.  -- Research associate of Sohn Lab.

Case Western Reserve Univerisity, School of Medicine

Visiting: Wood building W517,  Phone: 1-216-368-6583

 

 

 

From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of Xiaopeng Yang
Sent: Tuesday, October 26, 2010 9:06 PM
To: 'Luis Ibanez'
Cc: 'itk'; 'vtk'
Subject: [vtkusers] Programming challenges with QT, VTK, and ITK

 

Dear Luis,

 

How are you doing? Thank you very much for your help so far. Sorry to ask you a question again.

 

I am now developing a liver segmentation program using QT, VTK, and ITK based on CT images. In my program, fast marching algorithm is used to extract the liver by multiple seed points. To pick the positions of the seed points, vtkImagePlaneWidget is applied. The problem is how to save the multiple seed points I selected by left-clicking of the mouse so that I do not need to type those positions into the code, which is time consuming.

 

Please provide me with your suggestions. I working on this for almost one week still I cannot figure it out.

 

Thanks,

Xiaopeng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101217/56776f3c/attachment-0001.htm>


More information about the Insight-users mailing list