Hi Mathias, thank you very much for your quick reply! I could compile your code but the tubes are not displayed. I'm using MITK 0.6. However, I posted a new message this morning which states how I found this work-around you mentioned as well in your email: ..."includingVtkActors".... I am now able to display the tubes but there are some other minor problems which I was not able to solve yet. I would deeply appreciate if you could give me a helping hand on that.
I know of the new version of MITK but I kind of have to stick with the old one because it is part of a bigger software project that I am working with at the moment. Cheers, Steffen Seitel Mathias schrieb: > Hello Steffen, > > What version of MITK are you using? There have been some significant > changes in the way rendering is handled in MITK recently. Particularly, > mitk::RenderWindow doesn't exist any more (instead vtkRenderWindow and > the Qt-VTK interface provided by Kitware are used directly now). > > I tried your code on my system and it seems to work fine; the tubes are > displayed both in the 2D and 3D windows. I'm attaching the code to make > sure that we're talking on the same basis... > > Before the changes in MITK, as a way to make sure that the 3D actors are > updated properly, the method RenderingManager::RequestUpdateAll() > provided a bool flag "includingVtkActors". Please try setting this flag > to "true" to see if it solves your problem. (Note that the flag still > exists in the SVN version of MITK, but is no longer evaluated > internally.) > > Alternatively, you may want to use the current SVN version of MITK > > (see http://www.mitk.org/download/download.html) > > > With regards, > Mathias > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Steffen > Oeltze > Sent: Thursday, February 21, 2008 6:13 PM > To: [email protected] > Subject: [mitk-users] vtkTubeFilter > > Hi, > > I'm new to MITK and I would like to use it to display tubes around a > polyline that I have generated using "vtkTubeFilter". The code works > fine when using VTK only but I would like to integrate it into some > application that uses MITK. > > I have successfully visualized data from other sources with MITK > already, however, there seems to be a problem with the output of > "vtkTubeFilter". Below you find my code, which works fine for other > data, but not in this particular case. In the 2D-views of the > QmitkStdMultiWidget, I can see the cross-sections of the tubes, but > nothing is visualized in the 3d-view. My original vtkPolyData which > serves as an input to vtkTubeFilter consists only of points and the > connecting polyline. > > Any help is deeply appreciated. > > Thanks in advance, > Steffen > > > > mitk::DataTree::Pointer tree=mitk::DataTree::New(); > mitk::DataTreePreOrderIterator it(tree); > mitk::DataStorage::CreateInstance(tree); > ... > > vtkPolyData *pointEvolution = vtkPolyData::New(); > ... > > pointEvolution->SetPoints(samplePts); > pointEvolution->SetLines(polyLine); > ... > > vtkTubeFilter *profileTubes = vtkTubeFilter::New(); > profileTubes->SetNumberOfSides(20); > profileTubes->SetInput(pointEvolution); > profileTubes->SetRadius(10); > profileTubes->Update(); > ... > mitk::Surface::Pointer tubes = mitk::Surface::New(); > tubes->SetVtkPolyData(profileTubes->GetOutput()); > > mitk::DataTreeNode::Pointer node = mitk::DataTreeNode::New(); > node->SetData(tubes); > node->SetProperty( "visible", new mitk::BoolProperty( true ) ); > > it.Add(node); > > QmitkStdMultiWidget* renderWindow = new QmitkStdMultiWidget(NULL, ""); > renderWindow->SetData(&it); > renderWindow->InitializeStandardViews(&it); > > qtapplication.setMainWidget(renderWindow); > renderWindow->show(); > renderWindow->Fit(); > mitk::RenderingManager::GetInstance()->RequestUpdateAll(); > qtapplication.exec(); > > > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > mitk-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mitk-users > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
