Results 1 to 3 of 3

Thread: Operations in an image opened using VTK, Qt and QVTKWidget

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Operations in an image opened using VTK, Qt and QVTKWidget

    How do i do to use in an image opened (from a VTK image using QVTKWidget) some operations like write, draw, create an image with zoom and create circles and polygons lines? And then export it to other image format like jpeg for example. (Using VTK, Qt and QVTKWidget).

    *I already can to open the image using VTK and QVTKWidget what i need it to do the others operations.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,320
    Thanks
    316
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Operations in an image opened using VTK, Qt and QVTKWidget

    You need to learn how to use VTK to do that. QVTKWidget is simply an interface to VTK that allows a vtkRenderWindow to be hosted inside a QWidget. If you draw into this widget using Qt, VTK will know nothing about that; likewise, Qt does not know anything about what VTK is drawing in the widget. So if you want to be able to interactively draw on the VTK window and be able to save everything to jpeg, you have to do it using VTK, not Qt.

    You could also capture the QVTKWidget contents to a QImage after rendering is complete, then draw on the QImage using Qt. Here is a link to code that can capture the VTK image to a QImage. The VTK documentation has a similar example here.

  3. #3
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Operations in an image opened using VTK, Qt and QVTKWidget

    I made the transformation from VTK image to QImage but when I put this image on a QLabel what I see is not the right image, there are some superpositions and errors. Here Screenshot at 2012-04-04 13_47_27.jpg is how it would be. And Here Screenshot at 2012-04-04 13_43_58.jpg is how it is. And I can't use the method to transform QImage from Widget ( QImage ctk::grabVTKWidget(QWidget* widget, QRect rectangle) ) because I'don't know what it necessary to match the QRect with the QWidget and how to do it.

Similar Threads

  1. QVTKWidget
    By floyd.pepper in forum Newbie
    Replies: 1
    Last Post: 7th March 2012, 14:15
  2. In which thread are TCP IO-Operations done?
    By P@u1 in forum Qt Programming
    Replies: 9
    Last Post: 21st June 2011, 13:02
  3. File operations
    By MTK358 in forum Newbie
    Replies: 3
    Last Post: 12th September 2010, 23:04
  4. Bit operations
    By Lykurg in forum General Programming
    Replies: 1
    Last Post: 8th April 2010, 11:11
  5. Saving already opened image ...
    By Godlike in forum Newbie
    Replies: 14
    Last Post: 28th March 2006, 21:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.