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.
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.
2 Attachment(s)
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 Attachment 7561 is how it would be. And Here Attachment 7562 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.