[vtkusers] Problem with volume rendering inside of Qt application

Jakub Łągwa kubalagwa at gmail.com
Mon Jul 28 12:47:36 EDT 2014


Hello,

I have a strange problem with showing VTK volume in QVTKWidget. I can
compile example such as as:
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Medical/Cxx/Medical4.cxx
and it work fine. But when I want to use exactly the same code in my sample
Qt application (let's say - render only after user press a button) nothing
is shown in QVTKWidget (I tried also with QVTKInteractor instead of the one
from example). I have this problem only when I want to use vtkVolume and
than add the volume to renderer with AddVolume. If I make other 3D
visualisation for example with vtkContourFilter and than I add it to
renderer with AddActor method - everything works fine.
I was trying to solve this problem for a couple of days but I found some
things that I can't understand in any way. If I take, for example,
Medical4.cxx file and add there
#include <QApplication>
and than
QApplication a(argc, argv); as a first instruction in main - nothing is
rendered. But if I move this line after iren->Start() - it renders well
again. So my question is - is it some kind of known issue that I have to
make some part of VTK pipeline initialization before Qt application could
start? Or maybe I am doing somthing totaly wrong? Thanks in advance if
someone could help me, I would also apreciate if someone could check the
behaviour with this
QApplication a(argc, argv);
instruction inside (for example) Medical4.cxx - if nobody will be able to
reproduce it, maybe I will try to build on other OS. Currently I am working
on Ubuntu 12.04 with VTK 5.8 and Qt 4.8.1.

Best regards,
Jakub
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140728/73aaa956/attachment.html>


More information about the vtkusers mailing list